3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-21 03:13:30 +00:00

preparing intblaster as self-contained solver.

add activate and propagate to constraints
support axiomatized operators band, lsh, rshl, rsha
This commit is contained in:
Nikolaj Bjorner 2023-12-12 11:11:37 -08:00
parent f388f58a4b
commit 2292a26a25
15 changed files with 368 additions and 326 deletions

View file

@ -70,6 +70,8 @@ Useful lemmas:
--*/
#include "util/log.h"
#include "sat/smt/polysat/core.h"
#include "sat/smt/polysat/constraints.h"
#include "sat/smt/polysat/ule_constraint.h"
@ -314,8 +316,6 @@ namespace polysat {
return display(out, l_true, m_lhs, m_rhs);
}
// Evaluate lhs <= rhs
lbool ule_constraint::eval(pdd const& lhs, pdd const& rhs) {
// NOTE: don't assume simplifications here because we also call this on partially substituted constraints
@ -343,4 +343,15 @@ namespace polysat {
return eval(a.apply_to(lhs()), a.apply_to(rhs()));
}
void ule_constraint::activate(core& c, bool sign, dependency const& d) {
auto p = c.subst(lhs());
auto q = c.subst(rhs());
auto& C = c.cs();
if (sign && !lhs().is_val() && !rhs().is_val()) {
c.add_clause("lhs > rhs ==> -1 > rhs", { d, C.ult(rhs(), -1) }, false);
c.add_clause("lhs > rhs ==> lhs > 0", { d, C.ult(0, lhs()) }, false);
}
}
}