3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-10 05:00:51 +00:00

Add simplification customization for SMTLIB2

Add the ability to customize incremental pre-processing simplification for the SMTLIB2 front-end. The main new capability is to use pre-processing tactics in incremental mode that were previously not available. The main new capabilities are
- solve-eqs
- reduce-args
- elim-unconstrained
There are several more. Documentation and exposed simplifiers are populated incrementally. The current set of supported simplifiers can be inspected by using z3 with the --simplifiers flag or referring to https://microsoft.github.io/z3guide/docs/strategies/simplifiers

Some pending features are:
- add the ability to update parameters to simplifiers similar to how tactics can be controlled using parameters.
- expose simplification solvers over the binary API.
This commit is contained in:
Nikolaj Bjorner 2023-01-30 22:38:51 -08:00
parent dd0decfe5d
commit 6022c17131
32 changed files with 370 additions and 69 deletions

View file

@ -139,18 +139,15 @@ void model_reconstruction_trail::replay(unsigned qhead, expr_ref_vector& assumpt
*/
model_converter_ref model_reconstruction_trail::get_model_converter() {
generic_model_converter_ref mc = alloc(generic_model_converter, m, "dependent-expr-model");
unsigned i = 0;
append(*mc, i);
append(*mc);
return model_converter_ref(mc.get());
}
/**
* Append model conversions starting at index i
*/
void model_reconstruction_trail::append(generic_model_converter& mc, unsigned& i) {
TRACE("simplifier", display(tout));
for (; i < m_trail.size(); ++i) {
auto* t = m_trail[i];
void model_reconstruction_trail::append(generic_model_converter& mc) {
for (auto* t : m_trail) {
if (!t->m_active)
continue;
else if (t->is_hide())
@ -163,13 +160,10 @@ void model_reconstruction_trail::append(generic_model_converter& mc, unsigned& i
mc.add(v, def);
}
}
TRACE("simplifier", display(tout); mc.display(tout));
}
void model_reconstruction_trail::append(generic_model_converter& mc) {
m_trail_stack.push(value_trail(m_trail_index));
append(mc, m_trail_index);
}
std::ostream& model_reconstruction_trail::display(std::ostream& out) const {
for (auto* t : m_trail) {