expr mk_and(expr_vector args) { vector<Z3_ast> array; for (int i = 0; i < args.size(); i++) array.push_back(args[i]); return to_expr(args.ctx(), Z3_mk_and(args.ctx(), array.size(), &(array[0]))); }
void ConstraintManager::resetSolver(solver& s, const expr_vector& core) { s.reset(); currentAssumptions.clear(); currentAssumptions.reserve(core.size()); CurrentIdx2Id.resize(core.size()); for (unsigned i = 0; i < core.size(); ++i) { expr p = core[i]; cid id = p2Id[p]; currentAssumptions.push_back(p); Id2CurrentIdx[id] = i; CurrentIdx2Id[i] = id; s.add(!p || id2CnfConstraint[id]); //s.add(p || !id2CnfConstraint[id]); } }
inline expr MkAtMost(expr_vector vars, unsigned k) { array<Z3_ast> _vars(vars.size()); for (unsigned i = 0; i < vars.size(); ++i) { _vars[i] = vars[i]; } expr r{ vars.ctx(), Z3_mk_atmost(vars.ctx(), vars.size(), _vars.ptr(), k) }; vars.check_error(); return r; }