SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
NRAILModule.h
Go to the documentation of this file.
1 /**
2  * @file AbstractModule.h
3  * @author YOUR NAME <YOUR EMAIL ADDRESS>
4  *
5  * @version 2018-07-12
6  * Created on 2018-07-12.
7  */
8 
9 #pragma once
10 
11 #include <smtrat-solver/Module.h>
12 #include "NRAILSettings.h"
13 
14 namespace smtrat
15 {
16  template<typename Settings>
17  class NRAILModule : public Module
18  {
19  private:
20  // Members.
24 
25  public:
27  std::string moduleName() const {
28  return SettingsType::moduleName;
29  }
30  NRAILModule(const ModuleInput* _formula, Conditionals& _conditionals, Manager* _manager = nullptr);
31 
33 
34  // Main interfaces.
35  /**
36  * Informs the module about the given constraint. It should be tried to inform this
37  * module about any constraint it could receive eventually before assertSubformula
38  * is called (preferably for the first time, but at least before adding a formula
39  * containing that constraint).
40  * @param _constraint The constraint to inform about.
41  * @return false, if it can be easily decided whether the given constraint is inconsistent;
42  * true, otherwise.
43  */
44  bool informCore( const FormulaT& _constraint );
45 
46  /**
47  * Informs all backends about the so far encountered constraints, which have not yet been communicated.
48  * This method must not and will not be called more than once and only before the first runBackends call.
49  */
50  void init();
51 
52  /**
53  * The module has to take the given sub-formula of the received formula into account.
54  *
55  * @param _subformula The sub-formula to take additionally into account.
56  * @return false, if it can be easily decided that this sub-formula causes a conflict with
57  * the already considered sub-formulas;
58  * true, otherwise.
59  */
60  bool addCore( ModuleInput::const_iterator _subformula );
61 
62  /**
63  * Removes the subformula of the received formula at the given position to the considered ones of this module.
64  * Note that this includes every stored calculation which depended on this subformula, but should keep the other
65  * stored calculation, if possible, untouched.
66  *
67  * @param _subformula The position of the subformula to remove.
68  */
70 
71  /**
72  * Updates the current assignment into the model.
73  * Note, that this is a unique but possibly symbolic assignment maybe containing newly introduced variables.
74  */
75  void updateModel() const;
76 
77  /**
78  * Checks the received formula for consistency.
79  * @return True, if the received formula is satisfiable;
80  * False, if the received formula is not satisfiable;
81  * Unknown, otherwise.
82  */
84  };
85 }
Base class for solvers.
Definition: Manager.h:34
The input formula a module has to consider for it's satisfiability check.
Definition: ModuleInput.h:131
super::const_iterator const_iterator
Passing through the list::const_iterator.
Definition: ModuleInput.h:146
A base class for all kind of theory solving methods.
Definition: Module.h:70
void updateModel() const
Updates the current assignment into the model.
void removeCore(ModuleInput::const_iterator _subformula)
Removes the subformula of the received formula at the given position to the considered ones of this m...
std::function< FormulaT(FormulaT)> linearizeSubformulaFunction
Definition: NRAILModule.h:23
ModuleInput * mLRAFormula
Definition: NRAILModule.h:21
FormulaT linearizeSubformula(const FormulaT &formula)
Answer checkCore()
Checks the received formula for consistency.
std::string moduleName() const
Definition: NRAILModule.h:27
bool informCore(const FormulaT &_constraint)
Informs the module about the given constraint.
bool addCore(ModuleInput::const_iterator _subformula)
The module has to take the given sub-formula of the received formula into account.
Settings SettingsType
Definition: NRAILModule.h:26
NRAILModule(const ModuleInput *_formula, Conditionals &_conditionals, Manager *_manager=nullptr)
void init()
Informs all backends about the so far encountered constraints, which have not yet been communicated.
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
Definition: types.h:37
const settings::Settings & Settings()
Definition: Settings.h:96
Answer
An enum with the possible answers a Module can give.
Definition: types.h:57
std::vector< std::atomic_bool * > Conditionals
A vector of atomic bool pointers.
Definition: types.h:17