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

Polysat: conflict explanation prototype (#5353)

* display constraint's extra info in one place

* Add stub for conflict explainer

* Add helper functions to check whether constraint is active at base level

* Add helper class tmp_assign

* Add clause_builder; it skips unnecessary literals during clause creation

* some fixes

* Use clause_builder for forbidden intervals

* remove old comments

* fixes/comments in solver

* print redundant clauses

* First pass at conflict_explainer

* remove unused model class

* Choose value for k

* also print min/max k
This commit is contained in:
Jakob Rath 2021-06-17 17:35:32 +02:00 committed by GitHub
parent 1fe7dc40fe
commit 3e1cfcd538
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 449 additions and 60 deletions

View file

@ -0,0 +1,43 @@
/*++
Copyright (c) 2021 Microsoft Corporation
Module Name:
Conflict explanation / resolution
Author:
Nikolaj Bjorner (nbjorner) 2021-03-19
Jakob Rath 2021-04-6
--*/
#pragma once
#include "math/polysat/constraint.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 conflict_explainer {
solver& m_solver;
constraints_and_clauses m_conflict;
pvar m_var = null_var;
ptr_vector<constraint> m_cjust_v;
clause_ref by_polynomial_superposition();
clause_ref by_ugt_x();
clause_ref by_ugt_y();
clause_ref by_ugt_z();
p_dependency_ref null_dep() const { return m_solver.mk_dep_ref(null_dependency); }
void 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);
clause_ref resolve(pvar v, ptr_vector<constraint> const& cjust_v);
};
}