3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-24 03:57:51 +00:00

track _all_ interval end-points for propagation (in fact only need end-points at unit location, not the others so this can be tuned

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2022-04-13 12:22:43 +02:00
parent be488f75ab
commit da168cad2d
2 changed files with 43 additions and 1 deletions

View file

@ -168,6 +168,43 @@ namespace polysat {
return constraints(*this, v);
}
class int_iterator {
entry* curr = nullptr;
bool visited = false;
public:
int_iterator(entry* curr, bool visited) :
curr(curr), visited(visited || !curr) {}
int_iterator& operator++() {
visited = true;
curr = curr->next();
return *this;
}
eval_interval const& operator*() {
return curr->interval;
}
bool operator==(int_iterator const& other) const {
return visited == other.visited && curr == other.curr;
}
bool operator!=(int_iterator const& other) const {
return !(*this == other);
}
};
class intervals {
viable const& v;
pvar var;
public:
intervals(viable const& v, pvar var): v(v), var(var) {}
int_iterator begin() const { return int_iterator(v.m_units[var], false); }
int_iterator end() const { return int_iterator(v.m_units[var], true); }
};
intervals units(pvar v) { return intervals(*this, v); }
std::ostream& display(std::ostream& out, pvar v) const;
struct var_pp {