3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-12 02:04:43 +00:00

Polysat: add two more prototype rules (#5355)

* Add try_div to PDDs

* x>y is false when x==y

* First version of the other two prototype rules

* More band-aid fixes...
This commit is contained in:
Jakob Rath 2021-06-18 17:48:50 +02:00 committed by GitHub
parent 3e1cfcd538
commit c4963f4381
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 239 additions and 17 deletions

View file

@ -28,13 +28,15 @@ namespace polysat {
}
void ule_constraint::narrow(solver& s) {
SASSERT(!is_undef());
LOG_H3("Narrowing " << *this);
LOG("Assignment: " << s.assignment());
auto p = lhs().subst_val(s.assignment());
LOG("Substituted LHS: " << lhs() << " := " << p);
auto q = rhs().subst_val(s.assignment());
LOG("Substituted RHS: " << rhs() << " := " << q);
SASSERT(!is_undef());
if (is_always_false(p, q)) {
s.set_conflict(*this);
return;
@ -95,8 +97,8 @@ namespace polysat {
VERIFY(!is_undef());
if (is_positive())
return lhs.is_val() && rhs.is_val() && lhs.val() > rhs.val();
else
return lhs.is_val() && rhs.is_val() && lhs.val() <= rhs.val();
else
return (lhs.is_val() && rhs.is_val() && lhs.val() <= rhs.val()) || (lhs == rhs);
}
bool ule_constraint::is_always_false() {