mirror of
https://github.com/Z3Prover/z3
synced 2025-08-22 11:07:51 +00:00
ensure relevancy isn't increased between calls
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
61371b4abf
commit
5dfe4a4b48
11 changed files with 110 additions and 70 deletions
|
@ -1253,7 +1253,7 @@ namespace smt {
|
|||
|
||||
|
||||
case_split_queue * mk_case_split_queue(context & ctx, smt_params & p) {
|
||||
if (p.m_relevancy_lvl < 2 && (p.m_case_split_strategy == CS_RELEVANCY || p.m_case_split_strategy == CS_RELEVANCY_ACTIVITY ||
|
||||
if (ctx.relevancy_lvl() < 2 && (p.m_case_split_strategy == CS_RELEVANCY || p.m_case_split_strategy == CS_RELEVANCY_ACTIVITY ||
|
||||
p.m_case_split_strategy == CS_RELEVANCY_GOAL)) {
|
||||
warning_msg("relevancy must be enabled to use option CASE_SPLIT=3, 4 or 5");
|
||||
p.m_case_split_strategy = CS_ACTIVITY;
|
||||
|
|
|
@ -46,6 +46,7 @@ namespace smt {
|
|||
m_fparams(p),
|
||||
m_params(_p),
|
||||
m_setup(*this, p),
|
||||
m_relevancy_lvl(2),
|
||||
m_asserted_formulas(m, p, _p),
|
||||
m_rewriter(m),
|
||||
m_qmanager(alloc(quantifier_manager, *this, p, _p)),
|
||||
|
@ -321,7 +322,7 @@ namespace smt {
|
|||
|
||||
TRACE("relevancy",
|
||||
tout << "is_atom: " << d.is_atom() << " is relevant: " << is_relevant_core(l) << "\n";);
|
||||
if (d.is_atom() && (m_fparams.m_relevancy_lvl == 0 || (m_fparams.m_relevancy_lvl == 1 && !d.is_quantifier()) || is_relevant_core(l)))
|
||||
if (d.is_atom() && (m_relevancy_lvl == 0 || (m_relevancy_lvl == 1 && !d.is_quantifier()) || is_relevant_core(l)))
|
||||
m_atom_propagation_queue.push_back(l);
|
||||
|
||||
if (m.has_trace_stream())
|
||||
|
@ -1582,7 +1583,7 @@ namespace smt {
|
|||
SASSERT(relevancy());
|
||||
// Quantifiers are only asserted when marked as relevant.
|
||||
// Other atoms are only asserted when marked as relevant if m_relevancy_lvl >= 2
|
||||
if (d.is_atom() && (d.is_quantifier() || m_fparams.m_relevancy_lvl >= 2)) {
|
||||
if (d.is_atom() && (d.is_quantifier() || m_relevancy_lvl >= 2)) {
|
||||
lbool val = get_assignment(v);
|
||||
if (val != l_undef)
|
||||
m_atom_propagation_queue.push_back(literal(v, val == l_false));
|
||||
|
@ -3391,9 +3392,12 @@ namespace smt {
|
|||
}
|
||||
|
||||
void context::setup_context(bool use_static_features) {
|
||||
if (m_setup.already_configured() || inconsistent())
|
||||
if (m_setup.already_configured() || inconsistent()) {
|
||||
m_relevancy_lvl = std::min(m_fparams.m_relevancy_lvl, m_relevancy_lvl);
|
||||
return;
|
||||
}
|
||||
m_setup(get_config_mode(use_static_features));
|
||||
m_relevancy_lvl = m_fparams.m_relevancy_lvl;
|
||||
setup_components();
|
||||
}
|
||||
|
||||
|
|
|
@ -83,6 +83,7 @@ namespace smt {
|
|||
smt_params & m_fparams;
|
||||
params_ref m_params;
|
||||
setup m_setup;
|
||||
unsigned m_relevancy_lvl;
|
||||
timer m_timer;
|
||||
asserted_formulas m_asserted_formulas;
|
||||
th_rewriter m_rewriter;
|
||||
|
@ -196,8 +197,8 @@ namespace smt {
|
|||
|
||||
literal_vector m_atom_propagation_queue;
|
||||
|
||||
obj_map<expr, unsigned> m_cached_generation;
|
||||
obj_hashtable<expr> m_cache_generation_visited;
|
||||
obj_map<expr, unsigned> m_cached_generation;
|
||||
obj_hashtable<expr> m_cache_generation_visited;
|
||||
dyn_ack_manager m_dyn_ack_manager;
|
||||
|
||||
// -----------------------------------
|
||||
|
@ -280,9 +281,11 @@ namespace smt {
|
|||
}
|
||||
|
||||
bool relevancy() const {
|
||||
return m_fparams.m_relevancy_lvl > 0;
|
||||
return m_relevancy_lvl > 0;
|
||||
}
|
||||
|
||||
unsigned relevancy_lvl() const { return m_relevancy_lvl; }
|
||||
|
||||
enode * get_enode(expr const * n) const {
|
||||
SASSERT(e_internalized(n));
|
||||
return m_app2enode[n->get_id()];
|
||||
|
|
|
@ -1195,7 +1195,7 @@ namespace smt {
|
|||
// Reason: when a learned clause becomes unit, it should mark the
|
||||
// unit literal as relevant. When binary_clause_opt is used,
|
||||
// it is not possible to distinguish between learned and non-learned clauses.
|
||||
if (lemma && m_fparams.m_relevancy_lvl >= 2)
|
||||
if (lemma && m_relevancy_lvl >= 2)
|
||||
return false;
|
||||
if (m_base_lvl > 0)
|
||||
return false;
|
||||
|
|
|
@ -497,7 +497,7 @@ namespace smt {
|
|||
mk_func_interps();
|
||||
finalize_theory_models();
|
||||
register_macros();
|
||||
TRACE("model", model_v2_pp(tout, *m_model, true););
|
||||
TRACE("model", model_v2_pp(tout, *m_model, true););
|
||||
return m_model.get();
|
||||
}
|
||||
|
||||
|
|
|
@ -3684,7 +3684,6 @@ bool theory_seq::internalize_term(app* term) {
|
|||
return true;
|
||||
}
|
||||
for (auto arg : *term) {
|
||||
ensure_enodes(arg);
|
||||
mk_var(ensure_enode(arg));
|
||||
}
|
||||
if (m.is_bool(term)) {
|
||||
|
@ -5135,6 +5134,7 @@ void theory_seq::ensure_enodes(expr* e) {
|
|||
}
|
||||
}
|
||||
}
|
||||
// TBD: std::stable_sort(m_ensure_todo.begin(), m_ensure_todo.end(), compare_depth);
|
||||
for (unsigned i = m_ensure_todo.size(); i-- > 0; ) {
|
||||
ensure_enode(m_ensure_todo[i]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue