(self, current, tokens)
return SmtLibCommand(current, [name, [], rtype])
(define-sort <name> <args> <fun_def>)
(define-sort <name> <args> <fun_def>)
( define - sort <name > <args > <fun_def > )
def _cmd_define_sort(self, current, tokens):
        """(define-sort <name> <args> <fun_def>)"""
        name = self.parse_atom(tokens, current)
        self.consume_opening(tokens, current)

        params = []
        cur = tokens.consume()
        while cur != ')':
            params.append(cur)
            cur = tokens.consume()

        rtype = self.parse_type(tokens, current, type_params=params)
        if isinstance(rtype, PartialType):
            rtype.name = name
        elif isinstance(rtype, tuple):
            def definition(*args):
                return args[params.index(rtype[0])]
            rtype = PartialType(name, definition)
        self.consume_closing(tokens, current)
        self.cache.define(name, [], rtype)
        return SmtLibCommand(current, [name, [], rtype])
def _cmd_define_sort ( self , current , tokens ) : name = self . parse_atom ( tokens , current ) self . consume_opening ( tokens , current ) params = [ ] cur = tokens . consume ( ) while cur != ')' : params . append ( cur ) cur = tokens . consume ( ) rtype = self . parse_type ( tokens , current , type_params = params ) if isinstance ( rtype , PartialType ) : rtype . name = name elif isinstance ( rtype , tuple ) : def definition ( * args ) : return args [ params . index ( rtype [ 0 ] ) ] rtype = PartialType ( name , definition ) self . consume_closing ( tokens , current ) self . cache . define ( name , [ ] , rtype ) return SmtLibCommand ( current , [ name , [ ] , rtype ] )