SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
QEQuery.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace smtrat {
6 namespace qe {
7 
8 enum class QuantifierType { EXISTS, FORALL };
9 inline std::ostream& operator<<(std::ostream& os, QuantifierType qt) {
10  switch (qt) {
11  case QuantifierType::EXISTS: return os << "exists";
12  case QuantifierType::FORALL: return os << "forall";
13  }
14  return os;
15 }
16 
17 using QEQuery = std::vector<std::pair<QuantifierType,std::vector<carl::Variable>>>;
18 
19 inline std::ostream& operator<<(std::ostream& os, const QEQuery& q) {
20  os << "QE";
21  for (const auto& qlvl: q) {
22  os << "(" << qlvl.first;
23  for (const auto& v: qlvl.second) os << " " << v;
24  os << ")";
25  }
26  return os;
27 }
28 
29 inline std::vector<std::pair<QuantifierType,carl::Variable>> flattenQEQuery(const QEQuery& query) {
30  std::vector<std::pair<QuantifierType,carl::Variable>> res;
31  for (const auto& q: query) {
32  for (auto v: q.second) {
33  res.emplace_back(q.first, v);
34  }
35  }
36  return res;
37 }
38 
39 inline QuantifierType type(const std::pair<QuantifierType,std::vector<carl::Variable>>& p) {
40  return p.first;
41 }
42 
43 inline std::vector<carl::Variable> vars(const std::pair<QuantifierType,std::vector<carl::Variable>>& p) {
44  return p.second;
45 }
46 
47 }
48 }
std::optional< FormulaT > qe(const FormulaT &input)
Definition: qe.cpp:14
QuantifierType type(const std::pair< QuantifierType, std::vector< carl::Variable >> &p)
Definition: QEQuery.h:39
std::vector< std::pair< QuantifierType, carl::Variable > > flattenQEQuery(const QEQuery &query)
Definition: QEQuery.h:29
std::ostream & operator<<(std::ostream &os, QuantifierType qt)
Definition: QEQuery.h:9
std::vector< std::pair< QuantifierType, std::vector< carl::Variable > >> QEQuery
Definition: QEQuery.h:17
std::vector< carl::Variable > vars(const std::pair< QuantifierType, std::vector< carl::Variable >> &p)
Definition: QEQuery.h:43
QuantifierType
Definition: QEQuery.h:8
Class to create the formulas for axioms.