SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Core.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Common.h"
4 #include "AbstractTheory.h"
5 #include "ParserState.h"
6 
7 namespace smtrat {
8 namespace parser {
9 
10 struct ParserState;
11 
12 /**
13  * Implements the core theory of the booleans.
14  */
15 struct CoreTheory: public AbstractTheory {
16  using OperatorType = boost::variant<carl::FormulaType>;
17 
18  static void addSimpleSorts(qi::symbols<char, carl::Sort>& sorts);
19  static void addConstants(qi::symbols<char, types::ConstType>& constants);
20 
22 
23  bool declareVariable(const std::string& name, const carl::Sort& sort, types::VariableType& result, TheoryError& errors);
24 
25  bool handleITE(const FormulaT& ifterm, const types::TermType& thenterm, const types::TermType& elseterm, types::TermType& result, TheoryError& errors);
26  bool handleDistinct(const std::vector<types::TermType>& arguments, types::TermType& result, TheoryError& errors);
27 
28  bool functionCall(const Identifier& identifier, const std::vector<types::TermType>& arguments, types::TermType& result, TheoryError& errors);
29 };
30 
31 }
32 }
void sort(T *array, int size, LessThan lt)
Definition: Sort.h:67
carl::mpl_variant_of< TermTypes >::type TermType
Variant type for all terms.
Definition: TheoryTypes.h:160
carl::mpl_variant_of< VariableTypes >::type VariableType
Variant type for all variables.
Definition: TheoryTypes.h:132
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
Definition: types.h:37
Base class for all theories.
Implements the core theory of the booleans.
Definition: Core.h:15
static void addConstants(qi::symbols< char, types::ConstType > &constants)
Definition: Core.cpp:79
bool handleITE(const FormulaT &ifterm, const types::TermType &thenterm, const types::TermType &elseterm, types::TermType &result, TheoryError &errors)
Resolve an if-then-else operator.
Definition: Core.cpp:113
static void addSimpleSorts(qi::symbols< char, carl::Sort > &sorts)
Definition: Core.cpp:75
CoreTheory(ParserState *state)
Definition: Core.cpp:84
bool declareVariable(const std::string &name, const carl::Sort &sort, types::VariableType &result, TheoryError &errors)
Declare a new variable with the given name and the given sort.
Definition: Core.cpp:97
boost::variant< carl::FormulaType > OperatorType
Definition: Core.h:16
bool handleDistinct(const std::vector< types::TermType > &arguments, types::TermType &result, TheoryError &errors)
Resolve a distinct operator.
Definition: Core.cpp:127
bool functionCall(const Identifier &identifier, const std::vector< types::TermType > &arguments, types::TermType &result, TheoryError &errors)
Resolve another unknown function call.
Definition: Core.cpp:136