SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Bitvector.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 bitvectors.
12  */
14  carl::Sort bvSort;
17  using OperatorType = carl::BVTermType;
18  static void addSimpleSorts(qi::symbols<char, carl::Sort>& sorts);
19 
21 
22  bool declareVariable(const std::string& name, const carl::Sort& sort, types::VariableType& result, TheoryError& errors);
23 
24  bool resolveSymbol(const Identifier& identifier, types::TermType& result, TheoryError& errors);
25 
26  bool handleITE(const FormulaT& ifterm, const types::TermType& thenterm, const types::TermType& elseterm, types::TermType& result, TheoryError& errors);
27  bool handleDistinct(const std::vector<types::TermType>& arguments, types::TermType& result, TheoryError& errors);
28 
29  bool instantiate(const types::VariableType& var, const types::TermType& replacement, types::TermType& subject, TheoryError& errors);
31  bool functionCall(const Identifier& identifier, const std::vector<types::TermType>& arguments, types::TermType& result, TheoryError& errors);
32 };
33 
34 }
35 }
void sort(T *array, int size, LessThan lt)
Definition: Sort.h:67
int var(Lit p)
Definition: SolverTypes.h:64
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 bitvectors.
Definition: Bitvector.h:13
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: Bitvector.cpp:198
bool resolveSymbol(const Identifier &identifier, types::TermType &result, TheoryError &errors)
Resolve a symbol that was not declared within the ParserState.
Definition: Bitvector.cpp:178
bool handleDistinct(const std::vector< types::TermType > &arguments, types::TermType &result, TheoryError &errors)
Resolve a distinct operator.
Definition: Bitvector.cpp:230
conversion::VectorVariantConverter< types::BVTerm > vectorConverter
Definition: Bitvector.h:15
BitvectorTheory(ParserState *state)
Definition: Bitvector.cpp:102
bool refreshVariable(const types::VariableType &var, types::VariableType &subject, TheoryError &errors)
Definition: Bitvector.cpp:254
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: Bitvector.cpp:149
conversion::VariantConverter< types::BVTerm > termConverter
Definition: Bitvector.h:16
bool instantiate(const types::VariableType &var, const types::TermType &replacement, types::TermType &subject, TheoryError &errors)
Instantiate a variable within a term.
Definition: Bitvector.cpp:239
static void addSimpleSorts(qi::symbols< char, carl::Sort > &sorts)
Definition: Bitvector.cpp:97
carl::BVTermType OperatorType
Definition: Bitvector.h:17
bool functionCall(const Identifier &identifier, const std::vector< types::TermType > &arguments, types::TermType &result, TheoryError &errors)
Resolve another unknown function call.
Definition: Bitvector.cpp:265