Exemple #1
0
def function_model_to_clauses(h, f):
    sort = f.sort
    rng = sort.rng
    res = []
    fterm = fun_inst(f)
    if isinstance(rng, ivy_logic.EnumeratedSort) and not use_z3_enums:
        for c in rng.defines():
            eq = ivy_logic._eq_lit(fterm, ivy_logic.Constant(ivy_logic.Symbol(c, rng)))
            #            print "function_model_to_clauses: {}".format(eq)
            get_lit_facts(h, eq, res)
    # non-enumerated function types
    else:
        lit = ivy_logic.Literal(1, fun_eq_inst(f))
        get_lit_facts(h, lit, res)
    #        print "fun facts: {}".format([str(r) for r in res])
    return res
Exemple #2
0
def function_model_to_clauses(h,f):
    sort = f.sort
    rng = sort.rng
    res = []
    fterm = fun_inst(f)
    if isinstance(rng,ivy_logic.EnumeratedSort) and not use_z3_enums:
        for c in rng.defines():
            eq = ivy_logic._eq_lit(fterm,ivy_logic.Constant(ivy_logic.Symbol(c,rng)))
#            print "function_model_to_clauses: {}".format(eq)
            get_lit_facts(h,eq,res) 
    # non-enumerated function types
    else:
        lit = ivy_logic.Literal(1,fun_eq_inst(f))
        get_lit_facts(h,lit,res)
#        print "fun facts: {}".format([str(r) for r in res])
    return res