SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
qe.cpp
Go to the documentation of this file.
1 #include "qe.h"
2 #include "FMplexQE.h"
3 #include "FMplexQEStatistics.h"
4 
5 namespace smtrat::qe::fmplex {
6 
7 std::optional<FormulaT> qe(const FormulaT& f) {
9  // TODO: make sure more general inputs can be handled
10  if (f.type() != carl::FormulaType::EXISTS) return std::nullopt;
11  if (!f.quantified_formula().is_real_constraint_conjunction()
12  && f.quantified_formula().type() != carl::FormulaType::CONSTRAINT) return std::nullopt;
13 
14  // TODO: get rid of QEQuery
15  QEQuery q = {{QuantifierType::EXISTS, f.quantified_variables()}};
16  FMplexQE elim(f.quantified_formula(), q);
18  SMTRAT_TIME_FINISH(FMplexQEStatistics::get_instance().timer(), t);
19  SMTRAT_VALIDATION_ADD("smtrat.qe.fmplex","output", result, true);
21  FMplexQEStatistics::get_instance().output(result.is_nary() ? result.subformulas().size() : 1)
22  );
23  return result;
24 }
25 
26 }
#define SMTRAT_VALIDATION_ADD(channel, name, formula, consistent)
Definition: Validation.h:26
FormulaT eliminate_quantifiers()
Definition: FMplexQE.cpp:17
std::optional< FormulaT > qe(const FormulaT &f)
Definition: qe.cpp:7
std::vector< std::pair< QuantifierType, std::vector< carl::Variable > >> QEQuery
Definition: QEQuery.h:17
carl::Formula< Poly > FormulaT
Definition: types.h:37
#define SMTRAT_STATISTICS_CALL(function)
Definition: Statistics.h:23
#define SMTRAT_TIME_START(variable)
Definition: Statistics.h:24
#define SMTRAT_TIME_FINISH(timer, start)
Definition: Statistics.h:25