def Or(*args): size = len(args) clause = args[size-1].cons justify = args[size-1].justify curr = size-2 while curr >= 0: clause = z3.Or(args[curr].cons,clause) justify += args[curr].justify curr -= 1 a = SMTConstraint(clause) a.justify = justify return a
def And(*args): size = len(args) clause = args[size - 1].cons justify = args[size - 1].justify curr = size - 2 while curr >= 0: clause = z3.And(args[curr].cons, clause) justify += args[curr].justify curr -= 1 a = SMTConstraint(clause) a.justify = justify return a
def implies(ps, cs): i = SMTConstraint(z3.Implies(ps.cons, cs.cons)) i.justify += ps.justify + cs.justify return i
def empty(xs): return SMTConstraint(empty_f(xs))
def mem(x, xs): return SMTConstraint(mem_f(x, xs))
def exists(vs, cs): f = SMTConstraint(z3.Exists(vs, cs.cons)) f.justify = cs.justify return f
def forall(vs, cs): f = SMTConstraint(z3.ForAll(vs, cs.cons)) f.justify = cs.justify return f
def Not(cs): n = SMTConstraint(z3.Not(cs.cons)) n.justify = cs.justify return n
def exists(vs, cs): f = SMTConstraint( z3.Exists(vs, cs.cons) ) f.justify = cs.justify return f
def forall(vs, cs): f = SMTConstraint( z3.ForAll(vs, cs.cons) ) f.justify = cs.justify return f
def Not(cs): n = SMTConstraint( z3.Not(cs.cons) ) n.justify = cs.justify return n