Example #1
0
def sort_infer(term):
    res = concretize_sorts(term)
    for x in chain(lu.used_variables(res),lu.used_constants(res)):
        if lg.contains_topsort(x.sort) or lg.is_polymorphic(x.sort):
            raise IvyError(None,"cannot infer sort of {} in {}".format(x,term))
#    print "sort_infer: res = {!r}".format(res)
    return res
Example #2
0
def sort_infer(term):
    res = concretize_sorts(term)
    for x in chain(lu.used_variables(res),lu.used_constants(res)):
        if lg.contains_topsort(x.sort) or lg.is_polymorphic(x.sort):
            raise IvyError(None,"cannot infer sort of {}".format(x))
#    print "sort_infer: res = {!r}".format(res)
    return res
Example #3
0
def check_concretely_sorted(term,no_error=False,unsorted_var_names=()):
    for x in chain(lu.used_variables(term),lu.used_constants(term)):
        if lg.contains_topsort(x.sort) or lg.is_polymorphic(x.sort):
            if x.name not in unsorted_var_names:
                if no_error:
                    raise lg.SortError
                raise IvyError(None,"cannot infer sort of {} in {}".format(x,repr(term)))
Example #4
0
def check_concretely_sorted(term, no_error=False, unsorted_var_names=()):
    for x in chain(lu.used_variables(term), lu.used_constants(term)):
        if lg.contains_topsort(x.sort) or lg.is_polymorphic(x.sort):
            if x.name not in unsorted_var_names:
                if no_error:
                    raise lg.SortError
                raise IvyError(
                    None,
                    "cannot infer sort of {} in {}".format(x, repr(term)))
Example #5
0
def is_concretely_sorted(term):
    return not lg.contains_topsort(term) and not lg.is_polymorphic(term)
Example #6
0
def is_concretely_sorted(term):
    return not lg.contains_topsort(term) and not lg.is_polymorphic(term)