3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-26 21:16:02 +00:00

Merge branch 'polysat' of https://github.com/Z3Prover/z3 into polysat

This commit is contained in:
Clemens Eisenhofer 2022-11-29 14:54:49 +01:00
commit 2b7fd152c4
34 changed files with 948 additions and 613 deletions

View file

@ -380,6 +380,7 @@ namespace polysat {
LOG("p2: " << p2);
clause_builder cb(s);
/*for (auto [w, wv] : a)
cb.push(~s.eq(s.var(w), wv));*/
cb.insert(~c);
@ -394,19 +395,19 @@ namespace polysat {
}
// Evaluate p under assignments in the core.
pdd free_variable_elimination::eval(pdd const& p, conflict& core, assignment_t& out_assignment) {
pdd free_variable_elimination::eval(pdd const& p, conflict& core, substitution& out_sub) {
// TODO: this should probably be a helper method on conflict.
// TODO: recognize constraints of the form "v1 == 27" to be used in the assignment?
// (but maybe useful evaluations are always part of core.vars() anyway?)
assignment_t& a = out_assignment;
SASSERT(a.empty());
substitution& sub = out_sub;
SASSERT(sub.empty());
for (auto v : p.free_vars())
if (core.contains_pvar(v))
a.push_back({v, s.get_value(v)});
sub.add(v, s.get_value(v));
pdd q = s.subst(a, p);
pdd q = sub.apply_to(p);
// TODO: like in the old conflict::minimize_vars, we can now try to remove unnecessary variables from a.