mirror of
https://github.com/Z3Prover/z3
synced 2025-08-07 11:41:22 +00:00
forbidden intervals only used by viable
This commit is contained in:
parent
afc711d6ec
commit
c648b57493
5 changed files with 10 additions and 9 deletions
|
@ -35,7 +35,6 @@ namespace polysat {
|
||||||
m_conflict(*this),
|
m_conflict(*this),
|
||||||
m_simplify(*this),
|
m_simplify(*this),
|
||||||
m_restart(*this),
|
m_restart(*this),
|
||||||
m_forbidden_intervals(*this),
|
|
||||||
m_bvars(),
|
m_bvars(),
|
||||||
m_free_pvars(m_activity),
|
m_free_pvars(m_activity),
|
||||||
m_constraints(m_bvars),
|
m_constraints(m_bvars),
|
||||||
|
|
|
@ -31,7 +31,6 @@ Author:
|
||||||
#include "math/polysat/justification.h"
|
#include "math/polysat/justification.h"
|
||||||
#include "math/polysat/linear_solver.h"
|
#include "math/polysat/linear_solver.h"
|
||||||
#include "math/polysat/search_state.h"
|
#include "math/polysat/search_state.h"
|
||||||
#include "math/polysat/forbidden_intervals.h"
|
|
||||||
#include "math/polysat/trail.h"
|
#include "math/polysat/trail.h"
|
||||||
#include "math/polysat/viable.h"
|
#include "math/polysat/viable.h"
|
||||||
#include "math/polysat/log.h"
|
#include "math/polysat/log.h"
|
||||||
|
@ -89,7 +88,6 @@ namespace polysat {
|
||||||
conflict m_conflict;
|
conflict m_conflict;
|
||||||
simplify m_simplify;
|
simplify m_simplify;
|
||||||
restart m_restart;
|
restart m_restart;
|
||||||
forbidden_intervals m_forbidden_intervals;
|
|
||||||
bool_var_manager m_bvars; // Map boolean variables to constraints
|
bool_var_manager m_bvars; // Map boolean variables to constraints
|
||||||
var_queue m_free_pvars; // free poly vars
|
var_queue m_free_pvars; // free poly vars
|
||||||
stats m_stats;
|
stats m_stats;
|
||||||
|
|
|
@ -133,7 +133,7 @@ namespace polysat {
|
||||||
LOG("Substituted RHS: " << rhs() << " := " << q);
|
LOG("Substituted RHS: " << rhs() << " := " << q);
|
||||||
|
|
||||||
if (is_always_false(is_positive, p, q)) {
|
if (is_always_false(is_positive, p, q)) {
|
||||||
s.set_conflict({this, is_positive});
|
s.set_conflict(sc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (p.is_val() && q.is_val()) {
|
if (p.is_val() && q.is_val()) {
|
||||||
|
|
|
@ -27,7 +27,10 @@ just check if the cached phase is viable without detecting that it is a propagat
|
||||||
|
|
||||||
namespace polysat {
|
namespace polysat {
|
||||||
|
|
||||||
viable::viable(solver& s) : s(s) {}
|
viable::viable(solver& s):
|
||||||
|
s(s),
|
||||||
|
m_forbidden_intervals(s) {
|
||||||
|
}
|
||||||
|
|
||||||
viable::~viable() {
|
viable::~viable() {
|
||||||
for (entry* e : m_alloc)
|
for (entry* e : m_alloc)
|
||||||
|
@ -93,9 +96,9 @@ namespace polysat {
|
||||||
return prop;
|
return prop;
|
||||||
|
|
||||||
try_viable:
|
try_viable:
|
||||||
if (s.m_viable.intersect(v, sc)) {
|
if (intersect(v, sc)) {
|
||||||
rational val;
|
rational val;
|
||||||
switch (s.m_viable.find_viable(v, val)) {
|
switch (find_viable(v, val)) {
|
||||||
case dd::find_t::singleton:
|
case dd::find_t::singleton:
|
||||||
s.propagate(v, val, sc); // TBD why is sc used as justification? It should be all of viable
|
s.propagate(v, val, sc); // TBD why is sc used as justification? It should be all of viable
|
||||||
prop = true;
|
prop = true;
|
||||||
|
@ -116,9 +119,8 @@ namespace polysat {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool viable::intersect(pvar v, signed_constraint const& c) {
|
bool viable::intersect(pvar v, signed_constraint const& c) {
|
||||||
auto& fi = s.m_forbidden_intervals;
|
|
||||||
entry* ne = alloc_entry();
|
entry* ne = alloc_entry();
|
||||||
if (!fi.get_interval(c, v, *ne)) {
|
if (!m_forbidden_intervals.get_interval(c, v, *ne)) {
|
||||||
m_alloc.push_back(ne);
|
m_alloc.push_back(ne);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ Author:
|
||||||
#include "math/polysat/types.h"
|
#include "math/polysat/types.h"
|
||||||
#include "math/polysat/conflict.h"
|
#include "math/polysat/conflict.h"
|
||||||
#include "math/polysat/constraint.h"
|
#include "math/polysat/constraint.h"
|
||||||
|
#include "math/polysat/forbidden_intervals.h"
|
||||||
#include "math/polysat/univariate/univariate_solver.h"
|
#include "math/polysat/univariate/univariate_solver.h"
|
||||||
|
|
||||||
namespace polysat {
|
namespace polysat {
|
||||||
|
@ -33,6 +34,7 @@ namespace polysat {
|
||||||
friend class test_fi;
|
friend class test_fi;
|
||||||
|
|
||||||
solver& s;
|
solver& s;
|
||||||
|
forbidden_intervals m_forbidden_intervals;
|
||||||
|
|
||||||
struct entry : public dll_base<entry>, public fi_record {
|
struct entry : public dll_base<entry>, public fi_record {
|
||||||
entry() : fi_record({ eval_interval::full(), {}, {}, rational::one()}) {}
|
entry() : fi_record({ eval_interval::full(), {}, {}, rational::one()}) {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue