mirror of
https://github.com/Z3Prover/z3
synced 2025-07-03 11:25:40 +00:00
Collect relevant entries
This commit is contained in:
parent
7987ac4475
commit
878d4a2fd0
2 changed files with 12 additions and 8 deletions
|
@ -1343,8 +1343,6 @@ namespace polysat {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO: (combining intervals across equivalence classes from slicing)
|
|
||||||
//
|
|
||||||
// When iterating over intervals:
|
// When iterating over intervals:
|
||||||
// - instead of only intervals of v, go over intervals of each entry of overlaps
|
// - instead of only intervals of v, go over intervals of each entry of overlaps
|
||||||
// - need a function to map interval from overlap into an interval over v
|
// - need a function to map interval from overlap into an interval over v
|
||||||
|
@ -1525,15 +1523,17 @@ namespace polysat {
|
||||||
rational& val
|
rational& val
|
||||||
) {
|
) {
|
||||||
ptr_vector<entry> refine_todo;
|
ptr_vector<entry> refine_todo;
|
||||||
|
ptr_vector<entry> relevant_entries;
|
||||||
|
|
||||||
// max number of interval refinements before falling back to the univariate solver
|
// max number of interval refinements before falling back to the univariate solver
|
||||||
unsigned const refinement_budget = 100;
|
unsigned const refinement_budget = 100;
|
||||||
unsigned refinements = refinement_budget;
|
unsigned refinements = refinement_budget;
|
||||||
|
|
||||||
while (refinements--) {
|
while (refinements--) {
|
||||||
lbool result = find_on_layer(v, widths.size() - 1, widths, overlaps, fbi, to_cover_lo, to_cover_hi, val, refine_todo);
|
relevant_entries.clear();
|
||||||
|
lbool result = find_on_layer(v, widths.size() - 1, widths, overlaps, fbi, to_cover_lo, to_cover_hi, val, refine_todo, relevant_entries);
|
||||||
|
|
||||||
// store bit intervals we have used
|
// store bit-intervals we have used
|
||||||
for (entry* e : refine_todo)
|
for (entry* e : refine_todo)
|
||||||
intersect(v, e);
|
intersect(v, e);
|
||||||
refine_todo.clear();
|
refine_todo.clear();
|
||||||
|
@ -1578,7 +1578,8 @@ namespace polysat {
|
||||||
rational const& to_cover_lo,
|
rational const& to_cover_lo,
|
||||||
rational const& to_cover_hi,
|
rational const& to_cover_hi,
|
||||||
rational& val,
|
rational& val,
|
||||||
ptr_vector<entry>& refine_todo
|
ptr_vector<entry>& refine_todo,
|
||||||
|
ptr_vector<entry>& relevant_entries
|
||||||
) {
|
) {
|
||||||
unsigned const w = widths[w_idx];
|
unsigned const w = widths[w_idx];
|
||||||
rational const& mod_value = rational::power_of_two(w);
|
rational const& mod_value = rational::power_of_two(w);
|
||||||
|
@ -1659,6 +1660,8 @@ namespace polysat {
|
||||||
if (!e)
|
if (!e)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
relevant_entries.push_back(e);
|
||||||
|
|
||||||
if (e->interval.is_full())
|
if (e->interval.is_full())
|
||||||
return l_false;
|
return l_false;
|
||||||
|
|
||||||
|
@ -1722,7 +1725,7 @@ namespace polysat {
|
||||||
lower_cover_lo = 0;
|
lower_cover_lo = 0;
|
||||||
lower_cover_hi = lower_mod_value;
|
lower_cover_hi = lower_mod_value;
|
||||||
rational a;
|
rational a;
|
||||||
lbool result = find_on_layer(v, w_idx - 1, widths, overlaps, fbi, lower_cover_lo, lower_cover_hi, a, refine_todo);
|
lbool result = find_on_layer(v, w_idx - 1, widths, overlaps, fbi, lower_cover_lo, lower_cover_hi, a, refine_todo, relevant_entries);
|
||||||
VERIFY(result != l_undef);
|
VERIFY(result != l_undef);
|
||||||
if (result == l_false)
|
if (result == l_false)
|
||||||
return l_false; // conflict
|
return l_false; // conflict
|
||||||
|
@ -1742,7 +1745,7 @@ namespace polysat {
|
||||||
lower_cover_hi = mod(next_val, lower_mod_value);
|
lower_cover_hi = mod(next_val, lower_mod_value);
|
||||||
|
|
||||||
rational a;
|
rational a;
|
||||||
lbool result = find_on_layer(v, w_idx - 1, widths, overlaps, fbi, lower_cover_lo, lower_cover_hi, a, refine_todo);
|
lbool result = find_on_layer(v, w_idx - 1, widths, overlaps, fbi, lower_cover_lo, lower_cover_hi, a, refine_todo, relevant_entries);
|
||||||
if (result == l_false)
|
if (result == l_false)
|
||||||
return l_false; // conflict
|
return l_false; // conflict
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,8 @@ public:
|
||||||
rational const& to_cover_lo,
|
rational const& to_cover_lo,
|
||||||
rational const& to_cover_hi,
|
rational const& to_cover_hi,
|
||||||
rational& out_val,
|
rational& out_val,
|
||||||
ptr_vector<entry>& refine_todo);
|
ptr_vector<entry>& refine_todo,
|
||||||
|
ptr_vector<entry>& relevant_entries);
|
||||||
|
|
||||||
std::pair<entry*, bool> find_value(rational const& val, entry* entries);
|
std::pair<entry*, bool> find_value(rational const& val, entry* entries);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue