mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 20:05:51 +00:00
use same interval manager in pdd_interval as caller
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
f76432933f
commit
1aaf6d879f
2 changed files with 22 additions and 22 deletions
|
@ -25,27 +25,27 @@ typedef dep_intervals::interval interval;
|
|||
typedef dep_intervals::with_deps_t w_dep;
|
||||
// calculates the interval of a pdd expression based on the given intervals of the variables
|
||||
class pdd_interval {
|
||||
dep_intervals m_dep_intervals;
|
||||
std::function<interval (unsigned, bool)> m_var2interval;
|
||||
dep_intervals& m_dep_intervals;
|
||||
std::function<void (unsigned, bool, scoped_dep_interval&)> m_var2interval;
|
||||
|
||||
public:
|
||||
|
||||
pdd_interval(reslimit& lim): m_dep_intervals(lim) {}
|
||||
pdd_interval(dep_intervals& d): m_dep_intervals(d) {}
|
||||
|
||||
dep_intervals& m() { return m_dep_intervals; }
|
||||
|
||||
std::function<interval (unsigned, bool)>& var2interval() { return m_var2interval; } // setter
|
||||
const std::function<interval (unsigned, bool)>& var2interval() const { return m_var2interval; } // getter
|
||||
std::function<void (unsigned, bool, scoped_dep_interval&)>& var2interval() { return m_var2interval; } // setter
|
||||
const std::function<void (unsigned, bool, scoped_dep_interval&)>& var2interval() const { return m_var2interval; } // getter
|
||||
|
||||
template <w_dep wd>
|
||||
void get_interval(pdd const& p, scoped_dep_interval& ret) {
|
||||
if (p.is_val()) {
|
||||
m_dep_intervals.set_interval_for_scalar(ret.get(), p.val());
|
||||
m_dep_intervals.set_interval_for_scalar(ret, p.val());
|
||||
return;
|
||||
}
|
||||
bool deps = wd == w_dep::with_deps;
|
||||
interval a = m_var2interval(p.var(), deps);
|
||||
scoped_dep_interval hi(m()), lo(m()), t(m());
|
||||
scoped_dep_interval hi(m()), lo(m()), t(m()), a(m());
|
||||
m_var2interval(p.var(), deps, a);
|
||||
get_interval<wd>(p.hi(), hi);
|
||||
get_interval<wd>(p.lo(), lo);
|
||||
if (deps) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue