mirror of
https://github.com/Z3Prover/z3
synced 2026-02-28 10:51:28 +00:00
Polysat: first pass at forbidden intervals (not yet fully integrated into solver) (#5227)
* Add interval class * Take dependency as const reference * Compute forbidden intervals for ule-constraints * Add class for evaluated interval * We need the evaluated bounds as well * Don't add constraint to cjust multiple times (hack, to be improved later) * typo * More interval helpers * Add constraint::ult factory function * Fix forbidden interval condition * Add solver::has_viable * Add conflict explanation using forbidden intervals (not yet fully integrated into solver)
This commit is contained in:
parent
60972de562
commit
f83705bf9f
14 changed files with 501 additions and 13 deletions
|
|
@ -42,6 +42,7 @@ namespace polysat {
|
|||
friend class eq_constraint;
|
||||
friend class var_constraint;
|
||||
friend class ule_constraint;
|
||||
friend class forbidden_intervals;
|
||||
|
||||
typedef ptr_vector<constraint> constraints;
|
||||
|
||||
|
|
@ -113,12 +114,20 @@ namespace polysat {
|
|||
}
|
||||
|
||||
void push_cjust(pvar v, constraint* c) {
|
||||
if (m_cjust[v].contains(c)) // TODO: better check (flag on constraint?)
|
||||
return;
|
||||
m_cjust[v].push_back(c);
|
||||
m_trail.push_back(trail_instr_t::just_i);
|
||||
m_cjust_trail.push_back(v);
|
||||
}
|
||||
|
||||
unsigned size(pvar v) const { return m_size[v]; }
|
||||
|
||||
/**
|
||||
* Check whether variable v has any viable values left according to m_viable.
|
||||
*/
|
||||
bool has_viable(pvar v);
|
||||
|
||||
/**
|
||||
* check if value is viable according to m_viable.
|
||||
*/
|
||||
|
|
@ -139,7 +148,6 @@ namespace polysat {
|
|||
*/
|
||||
void add_viable_dep(pvar v, p_dependency* dep);
|
||||
|
||||
|
||||
/**
|
||||
* Find a next viable value for variable.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue