Go to the documentation of this file.
10 #ifndef CPROVER_SOLVERS_SMT2_SMT2_CONV_H
11 #define CPROVER_SOLVERS_SMT2_SMT2_CONV_H
53 const std::string &_benchmark,
54 const std::string &_notes,
55 const std::string &_logic,
70 void set_to(
const exprt &expr,
bool value)
override;
79 void push(
const std::vector<exprt> &_assumptions)
override;
178 std::unordered_map<int64_t, exprt> *operands_map,
193 {
set(ID_identifier, _identifier); }
197 return get(ID_identifier);
270 #endif // CPROVER_SOLVERS_SMT2_SMT2_CONV_H
Operator to update elements in structs and arrays.
void set_to(const exprt &expr, bool value) override
For a Boolean expression expr, add the constraint 'expr' if value is true, otherwise add 'not expr'.
void convert_typecast(const typecast_exprt &expr)
void convert_euclidean_mod(const euclidean_mod_exprt &expr)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void walk_array_tree(std::unordered_map< int64_t, exprt > *operands_map, const irept &src, const array_typet &type)
This function walks the SMT output and populates a map with index/value pairs for the array.
void print_assignment(std::ostream &out) const override
Print satisfying assignment to out.
Introduce LET for common subexpressions.
std::size_t get_number_of_solver_calls() const override
Return the number of incremental solver calls.
void convert_type(const typet &)
The type of an expression, extends irept.
void pop() override
Currently, only implements a single stack element (no nested contexts)
datatype_mapt datatype_map
exprt parse_array(const irept &s, const array_typet &type)
This function is for parsing array output from SMT solvers when "(get-value |???|)" returns an array ...
bool use_array_theory(const exprt &)
void convert_floatbv(const exprt &expr)
literalt convert(const exprt &expr)
smt2_symbolt(const irep_idt &_identifier, const typet &_type)
void convert_update(const exprt &expr)
Union constructor from single element.
void convert_plus(const plus_exprt &expr)
The plus expression Associativity is not specified.
void convert_floatbv_plus(const ieee_float_op_exprt &expr)
Base class for all expressions.
Generic base class for unary expressions.
void convert_expr(const exprt &)
A base class for binary expressions.
std::unordered_map< irep_idt, identifiert > identifier_mapt
void convert_constant(const constant_exprt &expr)
void convert_literal(const literalt)
exprt handle(const exprt &expr) override
Generate a handle, which is an expression that has the same value as the argument in any model that i...
~smt2_convt() override=default
Expression for finding the size (in bytes) of the object a pointer points to.
std::string type2id(const typet &) const
void flatten_array(const exprt &)
produce a flat bit-vector for a given array of fixed size
void convert_is_dynamic_object(const unary_exprt &)
void convert_index(const index_exprt &expr)
const irep_idt & get(const irep_idt &name) const
Boute's Euclidean definition of Modulo – to match SMT-LIB2.
void convert_rounding_mode_FPA(const exprt &expr)
Converting a constant or symbolic rounding mode to SMT-LIB.
Struct constructor from list of elements.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
An expression without operands.
const smt2_symbolt & to_smt2_symbol(const exprt &expr)
std::size_t number_of_solver_calls
void convert_mult(const mult_exprt &expr)
static std::string convert_identifier(const irep_idt &identifier)
void convert_floatbv_div(const ieee_float_op_exprt &expr)
exprt prepare_for_convert_expr(const exprt &expr)
Perform steps necessary before an expression is passed to convert_expr.
void push() override
Unimplemented.
std::unordered_map< irep_idt, bool > set_values
The values which boolean identifiers have been smt2_convt::set_to or in other words those which are a...
constant_exprt parse_literal(const irept &, const typet &type)
bool has_operands() const
Return true if there is at least one operand.
void write_footer()
Writes the end of the SMT file to the smt_convt::out stream.
void convert_relation(const binary_relation_exprt &)
Semantic type conversion from/to floating-point formats.
identifier_mapt identifier_map
void set(const irep_idt &name, const irep_idt &value)
void convert_mod(const mod_exprt &expr)
const irep_idt & get_identifier() const
void convert_floatbv_mult(const ieee_float_op_exprt &expr)
bool use_check_sat_assuming
Binary multiplication Associativity is not specified.
void convert_struct(const struct_exprt &expr)
void define_object_size(const irep_idt &id, const object_size_exprt &expr)
bool use_lambda_for_array
const irep_idt & id() const
std::set< irep_idt > bvfp_set
void convert_div(const div_exprt &expr)
std::map< typet, std::string > datatype_mapt
void convert_minus(const minus_exprt &expr)
resultt
Result of running the decision procedure.
boolbv_widtht boolbv_width
void find_symbols_rec(const typet &type, std::set< irep_idt > &recstack)
void convert_with(const with_exprt &expr)
Extract member of struct or union.
Structure type, corresponds to C style structs.
std::map< exprt, irep_idt > defined_expressionst
exprt parse_rec(const irept &s, const typet &type)
resultt dec_solve() override
Run the decision procedure to solve the problem.
std::string floatbv_suffix(const exprt &) const
smt2_convt(const namespacet &_ns, const std::string &_benchmark, const std::string &_notes, const std::string &_logic, solvert _solver, std::ostream &_out)
std::vector< exprt > assumptions
exprt lower_byte_operators(const exprt &expr)
Lower byte_update and byte_extract operations within expr.
A base class for relations, i.e., binary predicates whose two operands have the same type.
void convert_floatbv_rem(const binary_exprt &expr)
struct_exprt parse_struct(const irept &s, const struct_typet &type)
std::size_t no_boolean_variables
void convert_union(const union_exprt &expr)
pointer_logict pointer_logic
void convert_address_of_rec(const exprt &expr, const pointer_typet &result_type)
exprt get(const exprt &expr) const override
Return expr with variables replaced by values from satisfying assignment if available.
IEEE floating-point operations These have two data operands (op0 and op1) and one rounding mode (op2)...
There are a large number of kinds of tree structured or tree-like data in CPROVER.
tvt l_get(literalt l) const
std::set< std::string > smt2_identifierst
void find_symbols(const exprt &expr)
std::vector< bool > boolean_assignment
Semantic type conversion.
The pointer type These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (they ...
std::map< object_size_exprt, irep_idt > object_sizes
A constant literal expression.
void unflatten(wheret, const typet &, unsigned nesting=0)
exprt parse_union(const irept &s, const union_typet &type)
void convert_floatbv_minus(const ieee_float_op_exprt &expr)
void flatten2bv(const exprt &)
smt2_identifierst smt2_identifiers
void convert_floatbv_typecast(const floatbv_typecast_exprt &expr)
Modulo defined as lhs-(rhs * truncate(lhs/rhs)).
std::string decision_procedure_text() const override
Return a textual description of the decision procedure.
void convert_member(const member_exprt &expr)
defined_expressionst defined_expressions