SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
FPPModule.h
Go to the documentation of this file.
1 /**
2  * @file FPPModule.h
3  *
4  * @version 2015-09-10
5  * Created on 2015-09-10.
6  */
7 
8 #pragma once
9 
10 #include <smtrat-solver/PModule.h>
11 #include "FPPStatistics.h"
12 #include "FPPSettings.h"
13 
14 namespace smtrat
15 {
16  template<typename Settings>
17  class FPPModule : public PModule
18  {
19  private:
20 #ifdef SMTRAT_DEVOPTION_Statistics
21  FPPStatistics& mStatistics = statistics_get<FPPStatistics>(Settings::moduleName);
22 #endif
23  FormulaT mFormulaAfterPreprocessing = FormulaT(carl::FormulaType::TRUE);
25  ///
26  typename Settings::Preprocessor mPreprocessor;
27  public:
29  FPPModule( const ModuleInput* _formula, Conditionals& _conditionals, Manager* _manager = NULL );
30 
32 
33  // Main interfaces.
34 
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 SAT, if the received formula is satisfiable;
80  * UNSAT, if the received formula is not satisfiable;
81  * Unknown, otherwise.
82  */
84 
85  };
86 }
All preprocessing modules shall derive from this module, that is modules, which simplify their receiv...
bool addCore(ModuleInput::const_iterator _subformula)
The module has to take the given sub-formula of the received formula into account.
Settings::Preprocessor mPreprocessor
Definition: FPPModule.h:26
FormulaT mFormulaAfterPreprocessing
Definition: FPPModule.h:23
Model mPartialModel
Definition: FPPModule.h:24
void updateModel() const
Updates the current assignment into the model.
bool informCore(const FormulaT &_constraint)
Informs the module about the given constraint.
FPPModule(const ModuleInput *_formula, Conditionals &_conditionals, Manager *_manager=NULL)
Settings SettingsType
Definition: FPPModule.h:28
Answer checkCore()
Checks the received formula for consistency.
void init()
Informs all backends about the so far encountered constraints, which have not yet been communicated.
void removeCore(ModuleInput::const_iterator _subformula)
Removes the subformula of the received formula at the given position to the considered ones of this m...
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
ModuleStatistics & mStatistics
Definition: Module.h:192
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
Definition: types.h:37
const settings::Settings & Settings()
Definition: Settings.h:96
carl::Model< Rational, Poly > Model
Definition: model.h:13
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