11 #include "../InstructionHandler.h"
22 std::map<std::string, types::TermType>
bindings;
29 state.
bindings = std::move(this->bindings);
36 std::map<std::string, types::VariableType>
variables;
52 state.
constants = std::move(this->constants);
53 state.
variables = std::move(this->variables);
64 std::map<std::string, types::TermType>
bindings;
66 std::map<std::string, types::VariableType>
variables;
127 std::cerr <<
"Parser error: " << msg << std::endl;
130 std::stringstream out;
131 if (name ==
"true" || name ==
"false") out <<
"\"" << name <<
"\" is a reserved keyword.";
132 else if (
variables.find(name) !=
variables.end()) out <<
"\"" << name <<
"\" has already been defined as a variable.";
133 else if (
bindings.find(name) !=
bindings.end()) out <<
"\"" << name <<
"\" has already been defined as a binding to \"" <<
bindings[name] <<
"\".";
134 else if (
constants.find(name) !=
constants.end()) out <<
"\"" << name <<
"\" has already been defined as a constant.";
144 template<
typename Res,
typename T>
146 auto it = map.find(name);
147 if (it == map.end())
return false;
165 SMTRAT_LOG_ERROR(
"smtrat.parser",
"Failed to register function \"" << name <<
"\", name is already used.");
172 SMTRAT_LOG_ERROR(
"smtrat.parser",
"Failed to register indexed function \"" << name <<
"\", name is already used.");
179 SMTRAT_LOG_ERROR(
"smtrat.parser",
"Failed to register user function \"" << name <<
"\", name is already used.");
carl::mpl_variant_of< TermTypes >::type TermType
Variant type for all terms.
carl::mpl_variant_of< VariableTypes >::type VariableType
Variant type for all variables.
Class to create the formulas for axioms.
carl::Formulas< Poly > FormulasT
#define SMTRAT_LOG_ERROR(channel, msg)
ExpressionScope(const ParserState &state)
std::map< std::string, types::TermType > bindings
void discharge(ParserState &state)
std::map< std::string, const IndexedFunctionInstantiator * > defined_indexed_functions
std::map< std::string, types::VariableType > variables
std::map< std::string, const UserFunctionInstantiator * > defined_user_functions
std::map< std::string, types::TermType > constants
void discharge(ParserState &state)
std::map< std::string, const FunctionInstantiator * > defined_functions
ScriptScope(const ParserState &state)
std::map< std::string, carl::UninterpretedFunction > declared_functions
std::size_t script_scope_size() const
void registerFunction(const std::string &name, const FunctionInstantiator *fi)
FormulasT global_formulas
std::map< std::string, const FunctionInstantiator * > defined_functions
void registerFunction(const std::string &name, const IndexedFunctionInstantiator *fi)
std::map< std::string, types::TermType > constants
bool resolveSymbol(const std::string &name, types::TermType &r) const
void errorMessage(const std::string &msg)
bool isSymbolFree(const std::string &name, bool output=true)
std::map< std::string, const IndexedFunctionInstantiator * > defined_indexed_functions
std::map< std::string, types::VariableType > variables
std::set< types::VariableType > auxiliary_variables
void pushExpressionScope()
bool resolveSymbol(const std::string &name, types::VariableType &r) const
std::map< std::string, types::TermType > bindings
void popExpressionScope()
void registerFunction(const std::string &name, const UserFunctionInstantiator *fi)
bool resolveSymbol(const std::string &name, const std::map< std::string, T > &map, Res &result) const
InstructionHandler & handler
std::stack< ScriptScope > scriptScopes
std::map< std::string, const UserFunctionInstantiator * > defined_user_functions
std::vector< smtrat::ModelVariable > artificialVariables
std::stack< ExpressionScope > expressionScopes
ParserState(InstructionHandler &ih)
std::map< std::string, carl::UninterpretedFunction > declared_functions