3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-21 02:30:23 +00:00

add get_lstring per #2286

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-05-22 10:16:15 +04:00
parent 112e13eeea
commit b2845d888e
11 changed files with 64 additions and 10 deletions

View file

@ -258,6 +258,7 @@ void asserted_formulas::reduce() {
if (!invoke(m_max_bv_sharing_fn)) return;
if (!invoke(m_elim_bvs_from_quantifiers)) return;
if (!invoke(m_reduce_asserted_formulas)) return;
// if (!invoke(m_propagate_values)) return;
IF_VERBOSE(10, verbose_stream() << "(smt.simplifier-done)\n";);
TRACE("after_reduce", display(tout););
@ -431,11 +432,15 @@ void asserted_formulas::commit() {
}
void asserted_formulas::commit(unsigned new_qhead) {
TRACE("asserted_formulas", tout << "commit " << new_qhead << "\n";);
m_macro_manager.mark_forbidden(new_qhead - m_qhead, m_formulas.c_ptr() + m_qhead);
m_expr2depth.reset();
bool new_sub = false;
for (unsigned i = m_qhead; i < new_qhead; ++i) {
justified_expr const& j = m_formulas[i];
update_substitution(j.get_fml(), j.get_proof());
if (update_substitution(j.get_fml(), j.get_proof())) {
new_sub = true;
}
}
m_qhead = new_qhead;
}
@ -473,6 +478,7 @@ void asserted_formulas::propagate_values() {
}
num_prop = prop;
}
TRACE("asserted_formulas", tout << num_prop << "\n";);
if (num_prop > 0)
m_reduce_asserted_formulas();
}
@ -496,7 +502,7 @@ unsigned asserted_formulas::propagate_values(unsigned i) {
return n != new_n ? 1 : 0;
}
void asserted_formulas::update_substitution(expr* n, proof* pr) {
bool asserted_formulas::update_substitution(expr* n, proof* pr) {
expr* lhs, *rhs, *n1;
proof_ref pr1(m);
if (is_ground(n) && m.is_eq(n, lhs, rhs)) {
@ -505,13 +511,13 @@ void asserted_formulas::update_substitution(expr* n, proof* pr) {
if (is_gt(lhs, rhs)) {
TRACE("propagate_values", tout << "insert " << mk_pp(lhs, m) << " -> " << mk_pp(rhs, m) << "\n";);
m_scoped_substitution.insert(lhs, rhs, pr);
return;
return true;
}
if (is_gt(rhs, lhs)) {
TRACE("propagate_values", tout << "insert " << mk_pp(rhs, m) << " -> " << mk_pp(lhs, m) << "\n";);
pr1 = m.proofs_enabled() ? m.mk_symmetry(pr) : nullptr;
m_scoped_substitution.insert(rhs, lhs, pr1);
return;
return true;
}
TRACE("propagate_values", tout << "incompatible " << mk_pp(n, m) << "\n";);
}
@ -523,6 +529,7 @@ void asserted_formulas::update_substitution(expr* n, proof* pr) {
pr1 = m.proofs_enabled() ? m.mk_iff_true(pr) : nullptr;
m_scoped_substitution.insert(n, m.mk_true(), pr1);
}
return false;
}

View file

@ -213,7 +213,7 @@ class asserted_formulas {
void set_eliminate_and(bool flag);
void propagate_values();
unsigned propagate_values(unsigned i);
void update_substitution(expr* n, proof* p);
bool update_substitution(expr* n, proof* p);
bool is_gt(expr* lhs, expr* rhs);
void compute_depth(expr* e);
unsigned depth(expr* e) { return m_expr2depth[e]; }

View file

@ -766,7 +766,7 @@ namespace smt {
bits.swap(new_bits); \
} \
init_bits(e, bits); \
TRACE("bv", tout << arg_bits << " " << bits << " " << new_bits << "\n";); \
TRACE("bv_verbose", tout << arg_bits << " " << bits << " " << new_bits << "\n";); \
}