3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 19:05:51 +00:00

use explanation.h for conflict explanations everywhere

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2018-08-17 12:27:54 +08:00
parent fd0f6bcbf9
commit 0911fc2bda
10 changed files with 43 additions and 42 deletions

View file

@ -19,14 +19,18 @@ Revision History:
--*/
#pragma once
namespace lp {
struct explanation {
void clear() { m_explanation.clear(); }
class explanation {
vector<std::pair<mpq, constraint_index>> m_explanation;
public:
void clear() { m_explanation.clear(); }
vector<std::pair<mpq, constraint_index>>::const_iterator begin() const { return m_explanation.begin(); }
vector<std::pair<mpq, constraint_index>>::const_iterator end() const { return m_explanation.end(); }
void push_justification(constraint_index j, const mpq& v) {
m_explanation.push_back(std::make_pair(v, j));
}
void push_justification(constraint_index j) {
m_explanation.push_back(std::make_pair(one_of_type<mpq>(), j));
}
void reset() { m_explanation.reset(); }
};
}