3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-27 00:18:45 +00:00

wip - updated version of elim_uncstr_tactic

- remove reduce_invertible. It is subsumed by reduce_uncstr(2)
- introduce a simplifier for reduce_unconstrained. It uses reference counting to deal with inefficiency bug of legacy reduce_uncstr. It decomposes theory plugins into expr_inverter.

reduce_invertible is a tactic used in most built-in scenarios. It is useful for removing subterms that can be eliminated using "cheap" quantifier elimination. Specifically variables that occur only once can be removed in many cases by computing an expression that represents the effect computing a value for the eliminated occurrence.

The theory plugins for variable elimination are very partial and should be augmented by extensions, esp. for the case of bit-vectors where the invertibility conditions are thoroughly documented by Niemetz and Preiner.
This commit is contained in:
Nikolaj Bjorner 2022-11-12 17:56:45 -08:00
parent 689af3b4df
commit efbe0a6554
20 changed files with 1334 additions and 621 deletions

View file

@ -200,9 +200,15 @@ public:
};
class subterms_postorder {
bool m_include_bound;
expr_ref_vector m_es;
subterms_postorder(expr_ref_vector const& es, bool include_bound);
subterms_postorder(expr_ref const& e, bool include_bound);
public:
class iterator {
bool m_include_bound = false;
expr_ref_vector m_es;
expr_mark m_visited, m_seen;
void next();
@ -214,8 +220,10 @@ public:
bool operator==(iterator const& other) const;
bool operator!=(iterator const& other) const;
};
subterms_postorder(expr_ref_vector const& es);
subterms_postorder(expr_ref const& e);
static subterms_postorder all(expr_ref_vector const& es) { return subterms_postorder(es, true); }
static subterms_postorder ground(expr_ref_vector const& es) { return subterms_postorder(es, false); }
static subterms_postorder all(expr_ref const& e) { return subterms_postorder(e, true); }
static subterms_postorder ground(expr_ref const& e) { return subterms_postorder(e, false); }
iterator begin();
iterator end();
};