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

Polysat: use constraint_literal and begin move to core-based conflict representation (#5489)

* Rename solver_scope for fixplex tests

(otherwise the wrong constructor is called for polysat's solver_scope)

* Update conflict_core

* simplify

* Be clearer about constraint_literal lifetime

* remove old comment

* Remove status (positive/negative) from constraint

* Use constraint_literal in the solver

* Fix build (constraint -> get_constraint)
This commit is contained in:
Jakob Rath 2021-08-18 20:02:46 +02:00 committed by GitHub
parent 30e9f24fa3
commit ebaea2159e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 933 additions and 1004 deletions

View file

@ -3,7 +3,7 @@ Copyright (c) 2021 Microsoft Corporation
Module Name:
Conflict explanation / resolution
Conflict explanation
Author:
@ -15,33 +15,41 @@ Author:
#include "math/polysat/constraint.h"
#include "math/polysat/clause_builder.h"
#include "math/polysat/interval.h"
#include "math/polysat/solver.h"
namespace polysat {
// TODO: later, we probably want to update this class incrementally (adding/removing constraints as we go back through the trail)
// TODO: indexing of constraints/clauses?
class solver;
class conflict_explainer {
solver& m_solver;
constraints_and_clauses m_conflict;
ptr_vector<constraint> m_conflict_units;
pvar m_var = null_var;
ptr_vector<constraint> m_cjust_v;
// TODO: instead of listing methods, create an abstract class for explanation methods, register them in a vector and call them in turn
/* Conflict explanation methods */
clause_ref by_polynomial_superposition();
clause_ref by_ugt_x();
clause_ref by_ugt_y();
clause_ref by_ugt_z();
clause_ref y_ule_ax_and_x_ule_z();
p_dependency_ref null_dep() const { return m_solver.mk_dep_ref(null_dependency); }
p_dependency_ref null_dep();
// p_dependency_ref null_dep() const { return m_solver.mk_dep_ref(null_dependency); }
bool push_omega_mul(clause_builder& clause, unsigned level, unsigned p, pdd const& x, pdd const& y);
public:
conflict_explainer(solver& s, constraints_and_clauses const& conflict);
public:
/** Create empty conflict */
conflict_explainer(solver& s);
/** resolve conflict state against assignment to v */
clause_ref resolve(pvar v, ptr_vector<constraint> const& cjust_v);
// TODO: move conflict resolution from solver into this class.
// we have a single public method as entry point to conflict resolution.
// what do we need to return?
/** conflict resolution */
void resolve();
};
}