mirror of
https://github.com/Z3Prover/z3
synced 2025-04-16 13:58:45 +00:00
theory case split WIP
This commit is contained in:
parent
94762d276d
commit
a04bc9974b
|
@ -1750,6 +1750,8 @@ namespace smt {
|
|||
if (inconsistent())
|
||||
return false;
|
||||
unsigned qhead = m_qhead;
|
||||
if (!propagate_th_case_split())
|
||||
return false;
|
||||
if (!bcp())
|
||||
return false;
|
||||
if (get_cancel_flag())
|
||||
|
@ -2956,10 +2958,32 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
} 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() {
|
||||
if (!m_asserted_formulas.inconsistent()) {
|
||||
SASSERT(at_base_level());
|
||||
|
|
|
@ -212,6 +212,16 @@ namespace smt {
|
|||
literal2assumption m_literal2assumption; // maps an expression associated with a literal to the original assumption
|
||||
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
|
||||
|
@ -814,6 +824,8 @@ namespace smt {
|
|||
*/
|
||||
void mk_th_case_split(unsigned num_lits, literal * lits);
|
||||
|
||||
bool propagate_th_case_split();
|
||||
|
||||
bool_var mk_bool_var(expr * n);
|
||||
|
||||
enode * mk_enode(app * n, bool suppress_args, bool merge_tf, bool cgc_enabled);
|
||||
|
|
Loading…
Reference in a new issue