SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
SequentialExplanation.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../utils/Bookkeeping.h"
4 
6 
7 namespace smtrat {
8 namespace mcsat {
9 
10 template<typename... Backends>
12 private:
13  using B = std::tuple<Backends...>;
15  template<std::size_t N = 0, carl::EnableIfBool<N == std::tuple_size<B>::value> = carl::dummy>
16  std::optional<Explanation> explain(const mcsat::Bookkeeping&, carl::Variable, const FormulasT&, bool) const {
17  SMTRAT_LOG_ERROR("smtrat.mcsat.explanation", "No explanation left.");
18  return std::nullopt;
19  }
20  template<std::size_t N = 0, carl::EnableIfBool<N < std::tuple_size<B>::value> = carl::dummy>
21  std::optional<Explanation> explain(const mcsat::Bookkeeping& data, carl::Variable var, const FormulasT& reason, bool force_use_core) const {
22  auto res = std::get<N>(mBackends)(data, var, reason, force_use_core);
23  if (res) return res;
24  return explain<N+1>(data, var, reason, force_use_core);
25  }
26 public:
27  std::optional<Explanation> operator()(const mcsat::Bookkeeping& data, carl::Variable var, const FormulasT& reason, bool force_use_core) const {
28  return explain<0>(data, var, reason, force_use_core);
29  }
30 };
31 
32 } // namespace mcsat
33 } // namespace smtrat
Represent the trail, i.e.
Definition: Bookkeeping.h:19
int var(Lit p)
Definition: SolverTypes.h:64
Class to create the formulas for axioms.
carl::Formulas< Poly > FormulasT
Definition: types.h:39
#define SMTRAT_LOG_ERROR(channel, msg)
Definition: logging.h:32
std::optional< Explanation > explain(const mcsat::Bookkeeping &, carl::Variable, const FormulasT &, bool) const