3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-05-15 10:12:11 -07:00
parent 683ce27c8f
commit 88bbe9d54e
6 changed files with 164 additions and 54 deletions

View file

@ -440,8 +440,8 @@ namespace polysat {
* - the variable v is queued to patch if v is basic.
*/
template<typename Ext>
void fixplex<Ext>::set_bounds(var_t v, numeral const& lo, numeral const& hi) {
m_vars[v] = mod_interval(lo, hi);
void fixplex<Ext>::set_bounds(var_t v, numeral const& l, numeral const& h) {
m_vars[v] = mod_interval(l, h);
if (in_bounds(v))
return;
if (is_base(v))
@ -454,10 +454,17 @@ namespace polysat {
void fixplex<Ext>::set_bounds(var_t v, rational const& _lo, rational const& _hi) {
numeral lo = m.from_rational(_lo);
numeral hi = m.from_rational(_hi);
m_stashed_bounds.push_back(stashed_bound(v, lo, hi));
m_stashed_bounds.push_back(stashed_bound(v, m_vars[v]));
set_bounds(v, lo, hi);
}
template<typename Ext>
void fixplex<Ext>::set_value(var_t v, rational const& _val) {
numeral val = m.from_rational(_val);
m_stashed_bounds.push_back(stashed_bound(v, m_vars[v]));
set_bounds(v, val, val + 1);
}
template<typename Ext>
void fixplex<Ext>::restore_bound() {
auto const& b = m_stashed_bounds.back();