SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
types.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <carl-arith/poly/umvpoly/MultivariatePolynomial.h>
4 #include <carl-arith/core/Variable.h>
5 #include <carl-arith/poly/VarInfo.h>
6 #include <carl-formula/formula/Formula.h>
7 #include <carl-formula/formula/Logic.h>
8 #include <carl-common/util/streamingOperators.h>
9 #include <carl-common/util/enum_util.h>
10 
11 #include <atomic>
12 
13 namespace smtrat {
14 
15 using carl::operator<<;
16 
17 using Conditionals = std::vector<std::atomic_bool*>;
18 
19 using Rational = mpq_class;
20 
22 
23 using TermT = carl::Term<Rational>;
24 
25 using Poly = carl::MultivariatePolynomial<Rational>;
26 
27 using Factorization = std::map<Poly, carl::uint>;
28 
29 using ConstraintT = carl::Constraint<Poly>;
30 
31 using ConstraintsT = carl::Constraints<Poly>;
32 
33 using VariableAssignmentT = carl::VariableAssignment<Poly>;
34 
35 using VariableComparisonT = carl::VariableComparison<Poly>;
36 
37 using FormulaT = carl::Formula<Poly>;
38 
39 using FormulasT = carl::Formulas<Poly>;
40 
41 using FormulaSetT = carl::FormulaSet<Poly>;
42 
43 using FormulasMultiT = std::multiset<FormulaT>;
44 
45 using RationalAssignment = carl::Assignment<Rational>;
46 
47 using RAN = carl::IntRepRealAlgebraicNumber<Rational>;
48 
49 // Pair of priority and module id (within the respective strategy graph)
50 using thread_priority = std::pair<std::size_t, std::size_t>;
51 
52 // An enum with the levels for lemma generation
53 enum LemmaLevel { NONE = 0, NORMAL = 1, ADVANCED = 2 };
54 
55 
56 ///An enum with the possible answers a Module can give
57 enum Answer { SAT = 0, UNSAT = 1, UNKNOWN = 2, ABORTED = 3, OPTIMAL = 4 };
58 inline bool is_sat(Answer a) { return a == SAT || a == OPTIMAL; }
59 inline std::ostream& operator<<(std::ostream& os, Answer a) {
60  switch (a) {
61  case Answer::SAT: return os << "SAT";
62  case Answer::UNSAT: return os << "UNSAT";
63  case Answer::UNKNOWN: return os << "UNKNOWN";
64  case Answer::ABORTED: return os << "ABORTED";
65  case Answer::OPTIMAL: return os << "OPTIMAL";
66  default:
67  assert(false && "Invalid enum value for Answer");
68  return os << "Answer(" << carl::underlying_enum_value(a) << ")";
69  }
70 }
71 
72 }
Polynomial::RootType RAN
Definition: common.h:24
QuantifierType type(const std::pair< QuantifierType, std::vector< carl::Variable >> &p)
Definition: QEQuery.h:39
Class to create the formulas for axioms.
LemmaLevel
Definition: types.h:53
@ NORMAL
Definition: types.h:53
@ ADVANCED
Definition: types.h:53
@ NONE
Definition: types.h:53
carl::Constraints< Poly > ConstraintsT
Definition: types.h:31
std::map< Poly, carl::uint > Factorization
Definition: types.h:27
carl::FormulaSet< Poly > FormulaSetT
Definition: types.h:41
bool is_sat(Answer a)
Definition: types.h:58
std::multiset< FormulaT > FormulasMultiT
Definition: types.h:43
carl::Term< Rational > TermT
Definition: types.h:23
carl::Formula< Poly > FormulaT
Definition: types.h:37
carl::Assignment< Rational > RationalAssignment
Definition: types.h:45
carl::VariableAssignment< Poly > VariableAssignmentT
Definition: types.h:33
carl::MultivariatePolynomial< Rational > Poly
Definition: types.h:25
Answer
An enum with the possible answers a Module can give.
Definition: types.h:57
@ SAT
Definition: types.h:57
@ UNSAT
Definition: types.h:57
@ OPTIMAL
Definition: types.h:57
@ UNKNOWN
Definition: types.h:57
@ ABORTED
Definition: types.h:57
std::vector< std::atomic_bool * > Conditionals
A vector of atomic bool pointers.
Definition: types.h:17
std::ostream & operator<<(std::ostream &os, CMakeOptionPrinter cmop)
carl::Constraint< Poly > ConstraintT
Definition: types.h:29
carl::Formulas< Poly > FormulasT
Definition: types.h:39
mpq_class Rational
Definition: types.h:19
std::pair< std::size_t, std::size_t > thread_priority
Definition: types.h:50
carl::VariableComparison< Poly > VariableComparisonT
Definition: types.h:35
carl::IntegralType< Rational >::type Integer
Definition: types.h:21