9 #ifndef CPROVER_SOLVERS_SMT2_SMT2_PARSER_H
10 #define CPROVER_SOLVERS_SMT2_SMT2_PARSER_H
13 #include <unordered_map>
38 using kindt =
enum { VARIABLE, BINDING, PARAMETER };
112 const std::vector<irep_idt> &_parameters)
116 (_type.
id() == ID_mathematical_function &&
118 _parameters.size()) ||
119 (_type.
id() != ID_mathematical_function && _parameters.
empty()));
129 std::vector<std::pair<irep_idt, typet>> result;
132 for(std::size_t i = 0; i <
parameters.size(); i++)
133 result.emplace_back(
parameters[i], domain[i]);
143 result.emplace_back(pair.first, pair.second);
186 std::unordered_map<std::string, std::function<
typet()>>
sorts;
190 std::unordered_map<std::string, std::function<void()>>
commands;
193 void command(
const std::string &);
std::vector< symbol_exprt > variablest
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
std::vector< exprt > operandst
const irep_idt & id() const
exprt function_application_ieee_float_op(const irep_idt &, const exprt::operandst &)
std::size_t parenthesis_level
void command(const std::string &)
std::map< irep_idt, named_termt > named_termst
exprt::operandst operands()
exprt bv_mod(const exprt::operandst &, bool is_signed)
exprt binary(irep_idt, const exprt::operandst &)
exprt bv_division(const exprt::operandst &, bool is_signed)
void skip_to_end_of_list()
This skips tokens until all bracketed expressions are closed.
std::unordered_map< std::string, std::function< exprt()> > expressions
smt2_parsert(std::istream &_in)
exprt lambda_expression()
typet function_signature_declaration()
std::unordered_map< std::string, std::function< void()> > commands
smt2_tokenizert::smt2_errort error(const std::string &message) const
exprt function_application()
void add_unique_id(irep_idt, exprt)
exprt cast_bv_to_unsigned(const exprt &)
Apply typecast to unsignedbv to given expression.
exprt::operandst cast_bv_to_signed(const exprt::operandst &)
Apply typecast to signedbv to expressions in vector.
exprt multi_ary(irep_idt, const exprt::operandst &)
std::map< irep_idt, idt > id_mapt
exprt quantifier_expression(irep_idt)
std::pair< binding_exprt::variablest, exprt > binding(irep_idt)
exprt function_application_ieee_float_eq(const exprt::operandst &)
void check_matching_operand_types(const exprt::operandst &) const
signature_with_parameter_idst function_signature_definition()
exprt function_application_fp(const exprt::operandst &)
smt2_tokenizert::smt2_errort error() const
exprt binary_predicate(irep_idt, const exprt::operandst &)
smt2_tokenizert::tokent next_token()
std::unordered_map< std::string, std::function< typet()> > sorts
smt2_tokenizert smt2_tokenizer
exprt unary(irep_idt, const exprt::operandst &)
enum { NONE, END_OF_FILE, STRING_LITERAL, NUMERAL, SYMBOL, KEYWORD, OPEN, CLOSE } tokent
smt2_errort error(const std::string &message) const
generate an error exception, pre-filled with a message
Expression to hold a symbol (variable)
The type of an expression, extends irept.
const mathematical_function_typet & to_mathematical_function_type(const typet &type)
Cast a typet to a mathematical_function_typet.
#define PRECONDITION(CONDITION)
API to expression classes.
idt(kindt _kind, typet __type)
idt(kindt _kind, const exprt &expr)
enum { VARIABLE, BINDING, PARAMETER } kindt
named_termt(const exprt &_term, const symbol_exprt &_name)
Default-constructing a symbol_exprt is deprecated, thus make sure we always construct a named_termt f...
std::vector< std::pair< irep_idt, typet > > ids_and_types() const
binding_exprt::variablest binding_variables() const
signature_with_parameter_idst(const typet &_type, const std::vector< irep_idt > &_parameters)
signature_with_parameter_idst(const typet &_type)
std::vector< irep_idt > parameters
bool is_signed(const typet &t)
Convenience function – is the type signed?