SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Uninterpreted.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 /**
11  * Implements the theory of equalities and uninterpreted functions.
12  */
14  std::map<types::TermType, carl::UTerm> mInstantiatedArguments;
15  carl::Sort mBoolSort;
16  carl::UVariable mTrue;
17  carl::UVariable mFalse;
18 
20 
21  FormulaT coupleBooleanVariables(carl::Variable v, carl::UVariable uv) {
23  FormulaT(carl::FormulaType::IFF, {FormulaT(v), FormulaT(carl::UEquality(uv, mTrue, false))}),
24  FormulaT(carl::FormulaType::IFF, {!FormulaT(v), FormulaT(carl::UEquality(uv, mFalse, false))})
25  });
26  }
27 
28  bool declareVariable(const std::string& name, const carl::Sort& sort, types::VariableType& result, TheoryError& errors);
29 
30  bool handleITE(const FormulaT& ifterm, const types::TermType& thenterm, const types::TermType& elseterm, types::TermType& result, TheoryError& errors);
31  bool handleFunctionInstantiation(const carl::UninterpretedFunction& f, const std::vector<types::TermType>& arguments, types::TermType& result, TheoryError& errors);
32 
33  bool handleDistinct(const std::vector<types::TermType>&, types::TermType&, TheoryError& errors);
34 
35  bool functionCall(const Identifier& identifier, const std::vector<types::TermType>& arguments, types::TermType& result, TheoryError& errors);
36 };
37 
38 }
39 }
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 theory of equalities and uninterpreted functions.
Definition: Uninterpreted.h:13
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.
bool handleDistinct(const std::vector< types::TermType > &, types::TermType &, TheoryError &errors)
Resolve a distinct operator.
bool handleFunctionInstantiation(const carl::UninterpretedFunction &f, const std::vector< types::TermType > &arguments, types::TermType &result, TheoryError &errors)
UninterpretedTheory(ParserState *state)
bool functionCall(const Identifier &identifier, const std::vector< types::TermType > &arguments, types::TermType &result, TheoryError &errors)
Resolve another unknown function call.
std::map< types::TermType, carl::UTerm > mInstantiatedArguments
Definition: Uninterpreted.h:14
bool handleITE(const FormulaT &ifterm, const types::TermType &thenterm, const types::TermType &elseterm, types::TermType &result, TheoryError &errors)
Resolve an if-then-else operator.
FormulaT coupleBooleanVariables(carl::Variable v, carl::UVariable uv)
Definition: Uninterpreted.h:21