15 add(
"QF_BV", carl::Logic::QF_BV);
16 add(
"QF_IDL", carl::Logic::QF_IDL);
17 add(
"QF_LIA", carl::Logic::QF_LIA);
18 add(
"QF_LIRA", carl::Logic::QF_LIA);
19 add(
"QF_LRA", carl::Logic::QF_LRA);
20 add(
"QF_NIA", carl::Logic::QF_NIA);
21 add(
"QF_NIRA", carl::Logic::QF_NIA);
22 add(
"QF_NRA", carl::Logic::QF_NRA);
23 add(
"QF_PB", carl::Logic::QF_PB);
24 add(
"QF_RDL", carl::Logic::QF_RDL);
25 add(
"QF_UF", carl::Logic::QF_UF);
26 add(
"NRA", carl::Logic::NRA);
27 add(
"LRA", carl::Logic::LRA);
31 template<
typename>
struct result {
typedef qi::error_handler_result
type; };
32 template<
typename T1,
typename T2,
typename T3,
typename T4>
33 qi::error_handler_result
operator()(T1 b, T2 e, T3 where, T4
const& what)
const {
34 auto line_start = spirit::get_line_start(b, where);
35 auto line_end =
std::find(where, e,
'\n');
36 std::string line(++line_start, line_end);
38 SMTRAT_LOG_ERROR(
"smtrat.parser",
"Parsing error at " << spirit::get_line(where) <<
":" << spirit::get_column(line_start, where));
39 SMTRAT_LOG_ERROR(
"smtrat.parser",
"expected" << std::endl <<
"\t" << what.tag <<
": " << what);
40 SMTRAT_LOG_ERROR(
"smtrat.parser",
"but got" << std::endl <<
"\t" << std::string(where, line_end));
41 SMTRAT_LOG_ERROR(
"smtrat.parser",
"in line " << spirit::get_line(where) << std::endl <<
"\t" << line);
46 template<
typename Callee>
64 (qi::lit(
"assert-soft") >>
term >>
")")[px::bind(&Callee::add, px::ref(
callee), qi::_1,
true,
Rational(1), std::string())]
65 | (qi::lit(
"assert-soft") >>
term >> qi::lit(
":weight") >>
decimal >>
")")[px::bind(&Callee::add, px::ref(
callee), qi::_1,
true, qi::_2, std::string())]
66 | (qi::lit(
"assert-soft") >>
term >> qi::lit(
":weight") >>
decimal >> qi::lit(
":id") >>
symbol >>
")")[px::bind(&Callee::add, px::ref(
callee), qi::_1,
true, qi::_2, qi::_3)]
67 | (qi::lit(
"assert-soft") >>
term >> qi::lit(
":id") >>
symbol >> qi::lit(
":weight") >>
decimal >>
")")[px::bind(&Callee::add, px::ref(
callee), qi::_1,
true, qi::_3, qi::_2)]
68 | (qi::lit(
"assert-soft") >>
term >> qi::lit(
":id") >>
symbol >>
")")[px::bind(&Callee::add, px::ref(
callee), qi::_1,
true,
Rational(1), qi::_2)]
69 | (qi::lit(
"assert") >
term >
")")[px::bind(&Callee::add, px::ref(
callee), qi::_1,
false,
Rational(-1), std::string())]
70 | (qi::lit(
"check-sat") >
")")[px::bind(&Callee::check, px::ref(
callee))]
71 | (qi::lit(
"declare-const") >
symbol >
sort >
")")[px::bind(&Callee::declareConst, px::ref(
callee), qi::_1, qi::_2)]
72 | (qi::lit(
"declare-fun") >
symbol >
"(" > *
sort >
")" >
sort >
")")[px::bind(&Callee::declareFun, px::ref(
callee), qi::_1, qi::_2, qi::_3)]
73 | (qi::lit(
"declare-sort") >
symbol >
numeral >
")")[px::bind(&Callee::declareSort, px::ref(
callee), qi::_1, qi::_2)]
76 | (qi::lit(
"echo") >
string >
")")[px::bind(&Callee::echo, px::ref(
callee), qi::_1)]
78 | (qi::lit(
"exit") >
")")[px::bind(&Callee::exit, px::ref(
callee))]
79 | (qi::lit(
"get-all-models") >
")")[px::bind(&Callee::getAllModels, px::ref(
callee))]
80 | (qi::lit(
"get-assertions") >
")")[px::bind(&Callee::getAssertions, px::ref(
callee))]
81 | (qi::lit(
"get-assignment") >
")")[px::bind(&Callee::getAssignment, px::ref(
callee))]
82 | (qi::lit(
"get-info") >
keyword >
")")[px::bind(&Callee::getInfo, px::ref(
callee), qi::_1)]
83 | (qi::lit(
"get-model") >
")")[px::bind(&Callee::getModel, px::ref(
callee))]
84 | (qi::lit(
"get-objectives") >
")")[px::bind(&Callee::getObjectives, px::ref(
callee))]
85 | (qi::lit(
"get-option") >
keyword >
")")[px::bind(&Callee::getOption, px::ref(
callee), qi::_1)]
86 | (qi::lit(
"get-proof") >
")")[px::bind(&Callee::getProof, px::ref(
callee))]
87 | (qi::lit(
"get-unsat-core") >
")")[px::bind(&Callee::getUnsatCore, px::ref(
callee))]
88 | (qi::lit(
"get-value") >
"(" > +
term >
")" >
")")[px::bind(&Callee::getValue, px::ref(
callee), qi::_1)]
93 | (qi::lit(
"reset") >
")")[px::bind(&Callee::reset, px::ref(
callee))]
94 | (qi::lit(
"reset-assertions") >
")")[px::bind(&Callee::resetAssertions, px::ref(
callee))]
95 | (qi::lit(
"set-info") >
attribute >
")")[px::bind(&Callee::setInfo, px::ref(
callee), qi::_1)]
96 | (qi::lit(
"set-logic") >
logic >
")")[px::bind(&Callee::setLogic, px::ref(
callee), qi::_1)]
97 | (qi::lit(
"set-option") >
attribute >
")")[px::bind(&Callee::setOption, px::ref(
callee), qi::_1)]
122 qi::rule<Iterator, Skipper>
main;
static bool find(V &ts, const T &t)
auto get(const It &it, level)
carl::mpl_variant_of< VariableTypes >::type VariableType
Variant type for all variables.
PositionIteratorType Iterator
std::optional< FormulaT > qe(const FormulaT &input)
Class to create the formulas for axioms.
#define SMTRAT_LOG_ERROR(channel, msg)
Parses decimals: numeral.0*numeral
qi::error_handler_result type
qi::error_handler_result operator()(T1 b, T2 e, T3 where, T4 const &what) const
Parses keywords: :simple_symbol
Parses numerals: (0 | [1-9][0-9]*)
std::set< types::VariableType > auxiliary_variables
InstructionHandler & handler
qi::rule< Iterator, types::VariableType(), Skipper > functionDefinitionArg
qi::rule< Iterator, Skipper > functionDefinition
SortedVariableParser sortedvariable
void startFunctionDefinition()
qi::rule< Iterator, Skipper > main
qi::rule< Iterator, Skipper > command
ScriptParser(InstructionHandler &h, Theories &theories, Callee &callee)
AttributeParser attribute
px::function< ErrorHandler > errorHandler
Parses strings: ".+" with escape sequences \\" and \\\\
The Theories class combines all implemented theories and provides a single interface to interact with...
void defineFunction(const std::string &name, const std::vector< types::VariableType > &arguments, const carl::Sort &sort, const types::TermType &definition)
void pushScriptScope(std::size_t n)
void popScriptScope(std::size_t n)
types::VariableType declareFunctionArgument(const std::pair< std::string, carl::Sort > &arg)