44 in.unsetf(std::ios::skipws);
50 if (qi::phrase_parse(begin, end,
parser, skipper)) {
54 SMTRAT_LOG_WARN(
"smtrat.parser",
"Remaining to parse: \"" << std::string(begin, end) <<
"\"");
60 SMTRAT_LOG_DEBUG(
"smtrat.parser",
"Adding " << t <<
" as " << (isSoftFormula ?
"soft" :
"hard") <<
" constraint.");
65 SMTRAT_LOG_ERROR(
"smtrat.parser",
"assert requires it's argument to be a formula, but it is \"" << t <<
"\".");
73 if (!additional.empty()) {
74 additional.push_back(f);
94 void declareFun(
const std::string& name,
const std::vector<carl::Sort>& args,
const carl::Sort&
sort) {
96 if (args.size() == 0) {
104 if (!carl::SortManager::getInstance().declare(name, carl::to_int<carl::uint>(arity))) {
105 SMTRAT_LOG_ERROR(
"smtrat.parser",
"A sort \"" << name <<
"\" with arity " << arity <<
" has already been declared.");
108 void echo(
const std::string& s) {
118 this->mInputStream->setstate(std::ios::eofbit);
157 void getValue([[maybe_unused]]
const std::vector<types::TermType>&
vars) {
166 SMTRAT_LOG_ERROR(
"smtrat.parser",
"objectives are required to be arithmetic, but it is \"" << t <<
"\".");
173 auto nint = carl::to_int<carl::uint>(n);
210 template<
typename Function,
typename... Args>
void setOption(const Attribute &option)
virtual void add(const FormulaT &f)=0
void getOption(const std::string &key)
void getInfo(const std::string &key)
virtual void addSoft(const FormulaT &f, Rational weight, const std::string &id)=0
virtual void resetAssertions()=0
void setArtificialVariables(std::vector< smtrat::ModelVariable > &&vars)
void setInfo(const Attribute &attr)
virtual void echo(const std::string &s)
void addInstruction(std::function< void()> bind)
virtual void getObjectives()=0
virtual void setLogic(const carl::Logic &)=0
virtual void getUnsatCore()=0
virtual void getAssignment()=0
virtual void pop(std::size_t)=0
virtual void getAssertions()=0
virtual void getAllModels()=0
virtual void push(std::size_t)=0
bool printInstruction() const
virtual void getProof()=0
virtual void addObjective(const Poly &p, OptimizationType ot)=0
virtual void getModel()=0
void getValue([[maybe_unused]] const std::vector< types::TermType > &vars)
void setOption(const Attribute &option)
std::istream * mInputStream
void declareFun(const std::string &name, const std::vector< carl::Sort > &args, const carl::Sort &sort)
void echo(const std::string &s)
void declareConst(const std::string &name, const carl::Sort &sort)
ScriptParser< SMTLIBParser > parser
void add(const types::TermType &t, bool isSoftFormula=false, Rational weight=Rational(1), const std::string id=std::string())
void getInfo(const std::string &key)
void push(const Integer &n)
void addObjective(const types::TermType &t, OptimizationType ot)
void callHandler(const Function &f, const Args &... args)
void setInfo(const Attribute &attribute)
void setLogic(const carl::Logic &name)
SMTLIBParser(InstructionHandler &handler, bool queueInstructions)
void pop(const Integer &n)
bool parse(std::istream &in)
InstructionHandler & handler
void getOption(const std::string &key)
void declareSort(const std::string &name, Integer arity)
void sort(T *array, int size, LessThan lt)
carl::mpl_variant_of< TermTypes >::type TermType
Variant type for all terms.
boost::spirit::istream_iterator BaseIteratorType
PositionIteratorType Iterator
std::vector< carl::Variable > vars(const std::pair< QuantifierType, std::vector< carl::Variable >> &p)
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
carl::MultivariatePolynomial< Rational > Poly
carl::Formulas< Poly > FormulasT
carl::IntegralType< Rational >::type Integer
#define SMTRAT_LOG_WARN(channel, msg)
#define SMTRAT_LOG_INFO(channel, msg)
#define SMTRAT_LOG_ERROR(channel, msg)
#define SMTRAT_LOG_DEBUG(channel, msg)
std::size_t script_scope_size() const
std::vector< smtrat::ModelVariable > artificialVariables
The Theories class combines all implemented theories and provides a single interface to interact with...
void addGlobalFormulas(FormulasT &formulas)
void declareVariable(const std::string &name, const carl::Sort &sort)
void pushScriptScope(std::size_t n)
void popScriptScope(std::size_t n)
void declareFunction(const std::string &name, const std::vector< carl::Sort > &args, const carl::Sort &sort)
Converts variants to some type using the Converter class.