SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
LVEModule.h
Go to the documentation of this file.
1 /**
2  *
3  * Supports optimization.
4  *
5  * @file LVEModule.h
6  * @author YOUR NAME <YOUR EMAIL ADDRESS>
7  *
8  * @version 2019-02-20
9  * Created on 2019-02-20.
10  */
11 
12 #pragma once
13 
14 #include <smtrat-solver/PModule.h>
15 #include "LVESettings.h"
16 #include "LVEStatistics.h"
17 
18 namespace smtrat
19 {
20  template<typename Settings>
21  class LVEModule : public PModule
22  {
23  private:
24 #ifdef SMTRAT_DEVOPTION_Statistics
25  LVEStatistics& mStatistics = statistics_get<LVEStatistics>("lve");
26 #endif
28 
29  void count_variables(std::map<carl::Variable, std::size_t>& count, const ConstraintT& c) const;
30  std::map<carl::Variable, std::size_t> get_variable_counts() const;
31  std::vector<carl::Variable> get_lone_variables() const;
32 
33  std::optional<FormulaT> eliminate_variable(carl::Variable v, const ConstraintT& c);
34 
35  FormulaT eliminate_from_separated_weak_inequality(carl::Variable v, const Poly& with, const Poly& without, carl::Relation rel);
36  FormulaT eliminate_from_separated_disequality(carl::Variable v, const Poly& with, const Poly& without);
37  FormulaT eliminate_from_separated_strict_inequality(carl::Variable v, const Poly& with, const Poly& without, carl::Relation rel);
38  std::optional<FormulaT> eliminate_from_separated_factors(carl::Variable v, const Poly& with, const Poly& without, carl::Relation rel);
39  std::optional<FormulaT> eliminate_from_factors(carl::Variable v, const ConstraintT& c);
40 
41  std::optional<FormulaT> eliminate_linear(carl::Variable v, const ConstraintT& c);
42  public:
44  std::string moduleName() const {
45  return SettingsType::moduleName;
46  }
47  LVEModule(const ModuleInput* _formula, Conditionals& _conditionals, Manager* _manager = nullptr);
48 
50 
51  /**
52  * Updates the current assignment into the model.
53  * Note, that this is a unique but possibly symbolic assignment maybe containing newly introduced variables.
54  */
55  void updateModel() const;
56 
57  /**
58  * Checks the received formula for consistency.
59  * @return True, if the received formula is satisfiable;
60  * False, if the received formula is not satisfiable;
61  * Unknown, otherwise.
62  */
64  };
65 }
All preprocessing modules shall derive from this module, that is modules, which simplify their receiv...
std::optional< FormulaT > eliminate_linear(carl::Variable v, const ConstraintT &c)
std::optional< FormulaT > eliminate_variable(carl::Variable v, const ConstraintT &c)
std::optional< FormulaT > eliminate_from_separated_factors(carl::Variable v, const Poly &with, const Poly &without, carl::Relation rel)
void count_variables(std::map< carl::Variable, std::size_t > &count, const ConstraintT &c) const
LVEModule(const ModuleInput *_formula, Conditionals &_conditionals, Manager *_manager=nullptr)
FormulaT eliminate_from_separated_disequality(carl::Variable v, const Poly &with, const Poly &without)
void updateModel() const
Updates the current assignment into the model.
Settings SettingsType
Definition: LVEModule.h:43
Answer checkCore()
Checks the received formula for consistency.
std::optional< FormulaT > eliminate_from_factors(carl::Variable v, const ConstraintT &c)
FormulaT eliminate_from_separated_weak_inequality(carl::Variable v, const Poly &with, const Poly &without, carl::Relation rel)
std::string moduleName() const
Definition: LVEModule.h:44
std::vector< carl::Variable > get_lone_variables() const
std::map< carl::Variable, std::size_t > get_variable_counts() const
FormulaT eliminate_from_separated_strict_inequality(carl::Variable v, const Poly &with, const Poly &without, carl::Relation rel)
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
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
carl::MultivariatePolynomial< Rational > Poly
Definition: types.h:25
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
carl::Constraint< Poly > ConstraintT
Definition: types.h:29