SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Explanation.cpp
Go to the documentation of this file.
1 #include "Explanation.h"
2 
3 #include "IntervalPropagation.h"
4 
5 namespace smtrat {
6 namespace mcsat {
7 namespace icp {
8 
9 std::optional<mcsat::Explanation> Explanation::operator()(const mcsat::Bookkeeping& data, carl::Variable /*var*/, const FormulasT& reason, bool force_use_core) const {
10  #ifdef SMTRAT_DEVOPTION_Statistics
11  mStatistics.explanationCalled();
12  #endif
13 
14  const FormulasT& constr = [&]() -> const FormulasT& {
15  if (force_use_core) return reason;
16  else return data.constraints();
17  }();
18  SMTRAT_LOG_DEBUG("smtrat.mcsat.icp", "Explain conflict " << constr);
19 
20  IntervalPropagation ip(std::vector<carl::Variable>(data.variables().begin(), data.variables().end()), constr, data.model());
21  auto res = ip.execute();
22  if (res) {
23  #ifdef SMTRAT_DEVOPTION_Statistics
24  mStatistics.explanationSuccess();
25  #endif
26  SMTRAT_LOG_DEBUG("smtrat.mcsat.icp", "Got conflict " << *res);
27  return mcsat::Explanation(*res);
28  } else {
29  return std::nullopt;
30  }
31 
32 }
33 
34 }
35 }
36 }
Represent the trail, i.e.
Definition: Bookkeeping.h:19
const auto & constraints() const
Definition: Bookkeeping.h:43
const auto & variables() const
Definition: Bookkeeping.h:49
const auto & model() const
Definition: Bookkeeping.h:34
std::variant< FormulaT, ClauseChain > Explanation
Definition: smtrat-mcsat.h:14
Class to create the formulas for axioms.
carl::Formulas< Poly > FormulasT
Definition: types.h:39
#define SMTRAT_LOG_DEBUG(channel, msg)
Definition: logging.h:35
std::optional< mcsat::Explanation > operator()(const mcsat::Bookkeeping &data, carl::Variable var, const FormulasT &reason, bool force_use_core) const
Definition: Explanation.cpp:9