3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-05 23:05:46 +00:00

Polysat: conflict resolution wip (#5529)

* conflict_core doesn't need gc() anymore

* update comments, ensure_bvar for new constraints

* Make sure constraints can only be created through constraint_manager

* fix constraint::display if no boolean variable is assigned

* Move clause into separate file

* Add conflict_core binary resolution

* conflict_core additions

* reactivate conflict resolution outer loop

* wip

* seems commented includes break CI build
This commit is contained in:
Jakob Rath 2021-09-01 18:10:10 +02:00 committed by GitHub
parent 8b374c3745
commit dc547510db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 423 additions and 335 deletions

View file

@ -29,7 +29,7 @@ namespace polysat {
virtual bool perform(conflict_explainer& ce) = 0;
};
class inf_polynomial_superposition : public inference_engine {
class inf_polynomial_superposition final : public inference_engine {
public:
bool perform(conflict_explainer& ce) override;
};
@ -40,14 +40,35 @@ namespace polysat {
// clause_ref by_ugt_z();
// clause_ref y_ule_ax_and_x_ule_z();
class core_saturation final {
scoped_ptr_vector<inference_engine> inference_engines;
public:
/// Derive new constraints from constraints containing the variable v (i.e., at least one premise must contain v)
bool saturate(pvar v, conflict_core& core) { NOT_IMPLEMENTED_YET(); return false; }
};
#if 0
class conflict_explainer {
solver& m_solver;
conflict_core m_conflict;
// conflict_core m_conflict;
vector<constraint> m_new_assertions; // to be inserted into Gamma (conclusions from saturation)
scoped_ptr_vector<inference_engine> inference_engines;
bool push_omega_mul(clause_builder& clause, unsigned level, unsigned p, pdd const& x, pdd const& y);
// Gamma
// search_state& search() { return m_solver.m_search; }
// Core
// conflict_core& conflict() { return m_solver.m_conflict; }
public:
/** Create empty conflict */
conflict_explainer(solver& s);
@ -58,7 +79,7 @@ namespace polysat {
bool saturate();
/** resolve conflict state against assignment to v */
void resolve(pvar v, ptr_vector<constraint> const& cjust_v);
void resolve(pvar v, ptr_vector<constraint> const& cjust_v); // TODO: try variable elimination of 'v', if not possible, core saturation and core reduction. (actually reduction could be one specific VE method).
void resolve(sat::literal lit);
// TODO: move conflict resolution from solver into this class.
@ -68,4 +89,5 @@ namespace polysat {
/** conflict resolution until first (relevant) decision */
void resolve();
};
#endif
}