mirror of
https://github.com/Z3Prover/z3
synced 2025-06-19 20:33:38 +00:00
theory case split WIP
This commit is contained in:
parent
94762d276d
commit
a04bc9974b
2 changed files with 37 additions and 1 deletions
|
@ -1750,6 +1750,8 @@ namespace smt {
|
||||||
if (inconsistent())
|
if (inconsistent())
|
||||||
return false;
|
return false;
|
||||||
unsigned qhead = m_qhead;
|
unsigned qhead = m_qhead;
|
||||||
|
if (!propagate_th_case_split())
|
||||||
|
return false;
|
||||||
if (!bcp())
|
if (!bcp())
|
||||||
return false;
|
return false;
|
||||||
if (get_cancel_flag())
|
if (get_cancel_flag())
|
||||||
|
@ -2956,8 +2958,30 @@ namespace smt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
NOT_IMPLEMENTED_YET();
|
int_set new_case_split; // TODO is it okay to allocate this on the stack?
|
||||||
|
for (unsigned i = 0; i < num_lits; ++i) {
|
||||||
|
literal l = lits[i];
|
||||||
|
// TODO do we need to enforce this invariant? can we make undo information work without it?
|
||||||
|
SASSERT(!m_all_th_case_split_literals.contains(l.index()));
|
||||||
|
m_all_th_case_split_literals.insert(l.index());
|
||||||
|
// TODO add undo information for this insert
|
||||||
|
new_case_split.insert(l.index());
|
||||||
}
|
}
|
||||||
|
m_th_case_split_sets.push_back(new_case_split);
|
||||||
|
push_trail(push_back_vector<context, vector<int_set> >(m_th_case_split_sets));
|
||||||
|
for (unsigned i = 0; i < num_lits; ++i) {
|
||||||
|
literal l = lits[i];
|
||||||
|
m_literal2casesplitsets[l.index()].push_back(new_case_split);
|
||||||
|
push_trail(push_back_vector<context, vector<int_set> >(m_literal2casesplitsets[l.index()]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool context::propagate_th_case_split() {
|
||||||
|
if (m_all_th_case_split_literals.empty())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
NOT_IMPLEMENTED_YET(); return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool context::reduce_assertions() {
|
bool context::reduce_assertions() {
|
||||||
|
|
|
@ -212,6 +212,16 @@ namespace smt {
|
||||||
literal2assumption m_literal2assumption; // maps an expression associated with a literal to the original assumption
|
literal2assumption m_literal2assumption; // maps an expression associated with a literal to the original assumption
|
||||||
expr_ref_vector m_unsat_core;
|
expr_ref_vector m_unsat_core;
|
||||||
|
|
||||||
|
// -----------------------------------
|
||||||
|
//
|
||||||
|
// Theory case split
|
||||||
|
//
|
||||||
|
// -----------------------------------
|
||||||
|
typedef int_hashtable<int_hash, default_eq<int> > int_set;
|
||||||
|
int_set m_all_th_case_split_literals;
|
||||||
|
vector<int_set> m_th_case_split_sets;
|
||||||
|
u_map< vector<int_set> > m_literal2casesplitsets; // returns the case split literal sets that a literal participates in
|
||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
//
|
//
|
||||||
// Accessors
|
// Accessors
|
||||||
|
@ -814,6 +824,8 @@ namespace smt {
|
||||||
*/
|
*/
|
||||||
void mk_th_case_split(unsigned num_lits, literal * lits);
|
void mk_th_case_split(unsigned num_lits, literal * lits);
|
||||||
|
|
||||||
|
bool propagate_th_case_split();
|
||||||
|
|
||||||
bool_var mk_bool_var(expr * n);
|
bool_var mk_bool_var(expr * n);
|
||||||
|
|
||||||
enode * mk_enode(app * n, bool suppress_args, bool merge_tf, bool cgc_enabled);
|
enode * mk_enode(app * n, bool suppress_args, bool merge_tf, bool cgc_enabled);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue