SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
AssignmentFinder_SMT.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <boost/logic/tribool.hpp>
4 
6 
7 #include <variant>
8 
9 namespace smtrat {
10 namespace mcsat {
11 namespace smtaf {
12 
13 using VariablePos = std::vector<carl::Variable>::const_iterator;
14 using VariableRange = std::pair<VariablePos,VariablePos>;
15 
17 
20  std::map<VariablePos,FormulasT> mConstraints;
21  std::map<VariablePos,carl::Variables> mFreeConstraintVars;
22  std::unordered_map<FormulaT,FormulaT> mEvaluatedConstraints;
23 
24 private:
25 
26  ModelValues modelToAssignment(const Model& model) const;
27 
28  /**
29  * @return A VariablePos, if the level is in the current range. true, if the level is higher, false, if the level is lower
30  */
31  std::variant<VariablePos,bool> level(const FormulaT& constraint) const;
32 
33 public:
34 
35  AssignmentFinder_SMT(VariableRange variables, const Model& model) : mVariables(variables), mModel(model) {
36  for (auto iter = mVariables.first; iter != mVariables.second; iter++) {
37  mConstraints.emplace(iter,FormulasT());
38  mFreeConstraintVars.emplace(iter,carl::Variables());
39  }
40  }
41 
42  boost::tribool addConstraint(const FormulaT& f);
43 
44  boost::tribool addMVBound(const FormulaT& f);
45 
46  std::optional<AssignmentOrConflict> findAssignment(const VariablePos excludeVar) const;
47 
48  std::optional<AssignmentOrConflict> findAssignment() const;
49 };
50 
51 }
52 }
53 }
boost::tribool addConstraint(const FormulaT &f)
AssignmentFinder_SMT(VariableRange variables, const Model &model)
std::optional< AssignmentOrConflict > findAssignment() const
std::variant< VariablePos, bool > level(const FormulaT &constraint) const
std::map< VariablePos, FormulasT > mConstraints
std::unordered_map< FormulaT, FormulaT > mEvaluatedConstraints
boost::tribool addMVBound(const FormulaT &f)
std::map< VariablePos, carl::Variables > mFreeConstraintVars
ModelValues modelToAssignment(const Model &model) const
std::vector< carl::Variable >::const_iterator VariablePos
std::pair< VariablePos, VariablePos > VariableRange
std::vector< std::pair< carl::Variable, ModelValue > > ModelValues
Definition: smtrat-mcsat.h:12
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
Definition: types.h:37
carl::Model< Rational, Poly > Model
Definition: model.h:13
carl::Formulas< Poly > FormulasT
Definition: types.h:39