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

Polysat: check test results, forbidden intervals for coefficient -1 (#5241)

* Use scoped_ptr for condition

* Check solver result in unit tests

* Add test for unusual cjust

* Add solver::get_value

* Broken assertion

* Support forbidden interval for coefficient -1
This commit is contained in:
Jakob Rath 2021-05-04 18:33:55 +02:00 committed by GitHub
parent 5791b41133
commit fd1758ffab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 164 additions and 58 deletions

View file

@ -70,16 +70,14 @@ namespace polysat {
rational longest_len;
unsigned longest_i = UINT_MAX;
for (constraint* c : conflict) {
LOG("constraint: " << *c);
LOG_H3("Computing forbidden interval for: " << *c);
eval_interval interval = eval_interval::full();
constraint* neg_cond = nullptr; // TODO: change to scoped_ptr
scoped_ptr<constraint> neg_cond;
if (c->forbidden_interval(s, v, interval, neg_cond)) {
LOG("~> interval: " << interval);
LOG(" neg_cond: " << show_deref(neg_cond));
if (interval.is_currently_empty()) {
dealloc(neg_cond);
LOG("interval: " << interval);
LOG("neg_cond: " << show_deref(neg_cond));
if (interval.is_currently_empty())
continue;
}
if (interval.is_full())
has_full = true;
else {
@ -89,7 +87,7 @@ namespace polysat {
longest_i = records.size();
}
}
records.push_back({std::move(interval), neg_cond, c});
records.push_back({std::move(interval), std::move(neg_cond), c});
if (has_full)
break;
}
@ -119,6 +117,7 @@ namespace polysat {
return false;
}
LOG("seq: " << seq);
SASSERT(seq.size() >= 2); // otherwise has_full should have been true
p_dependency* d = nullptr;
unsigned lemma_lvl = 0;