def apply_z3_func(pred, tup): if not isinstance(pred, z3.FuncDeclRef): return pred(*tup) _args, sz = z3._to_ast_array(tup) fact = z3._to_expr_ref(z3.Z3_mk_app(pred.ctx_ref(), pred.ast, sz, _args), pred.ctx) return fact
def apply_z3_func(pred, tup): if isinstance(pred, z3.BoolRef): assert not tup return pred if not isinstance(pred, z3.FuncDeclRef): return pred(*tup) _args, sz = z3._to_ast_array(tup) fact = z3._to_expr_ref(z3.Z3_mk_app(pred.ctx_ref(), pred.ast, sz, _args), pred.ctx) return fact
def my_and(*args): ctx = z3.main_ctx() _args, sz = z3._to_ast_array(args) return z3.BoolRef(z3.Z3_mk_and(ctx.ref(), sz, _args), ctx)