cprover
Loading...
Searching...
No Matches
convert_expr_to_smt.cpp File Reference
Include dependency graph for convert_expr_to_smt.cpp:

Go to the source code of this file.

Classes

struct  sort_based_cast_to_bit_vector_convertert
struct  sort_based_literal_convertert
struct  at_scope_exitt< functiont >

Typedefs

using sub_expression_mapt = std::unordered_map<exprt, smt_termt, irep_hash>
 Post order visitation is used in order to construct the the smt terms bottom upwards without using recursion to traverse the input exprt.

Functions

template<typename factoryt>
static smt_termt convert_multiary_operator_to_terms (const multi_ary_exprt &expr, const sub_expression_mapt &converted, const factoryt &factory)
 Converts operator expressions with 2 or more operands to terms expressed as binary operator application.
template<typename target_typet>
static bool operands_are_of_type (const exprt &expr)
 Ensures that all operands of the argument expression have related types.
static smt_sortt convert_type_to_smt_sort (const bool_typet &type)
static smt_sortt convert_type_to_smt_sort (const bitvector_typet &type)
static smt_sortt convert_type_to_smt_sort (const array_typet &type)
static smt_sortt convert_type_to_smt_sort (const floatbv_typet &type)
smt_sortt convert_type_to_smt_sort (const typet &type)
 Converts the type to an smt encoding of the same expression stored as sort ast (abstract syntax tree).
static smt_termt convert_expr_to_smt (const symbol_exprt &symbol_expr)
static smt_termt convert_expr_to_smt (const nondet_symbol_exprt &nondet_symbol, const sub_expression_mapt &converted)
static smt_termt make_not_zero (const smt_termt &input, const typet &source_type)
 Makes a term which is true if input is not 0 / false.
static smt_termt convert_c_bool_cast (const smt_termt &from_term, const typet &from_type, const bitvector_typet &to_type)
 Returns a cast to C bool expressed in smt terms.
static std::function< std::function< smt_termt(smt_termt)>(std::size_t)> extension_for_type (const typet &type)
static smt_termt make_bitvector_resize_cast (const smt_termt &from_term, const bitvector_typet &from_type, const bitvector_typet &to_type)
static smt_termt convert_bit_vector_cast (const smt_termt &from_term, const typet &from_type, const bitvector_typet &to_type)
static smt_termt convert_expr_to_smt (const typecast_exprt &cast, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const floatbv_typecast_exprt &float_cast, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const struct_exprt &struct_construction, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const union_exprt &union_construction, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const constant_exprt &constant_literal)
static smt_termt convert_expr_to_smt (const concatenation_exprt &concatenation, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const bitand_exprt &bitwise_and_expr, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const bitor_exprt &bitwise_or_expr, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const bitxor_exprt &bitwise_xor, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const bitnot_exprt &bitwise_not, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const unary_minus_exprt &unary_minus, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const unary_plus_exprt &unary_plus, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const sign_exprt &is_negative, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const if_exprt &if_expression, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const and_exprt &and_expression, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const or_exprt &or_expression, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const xor_exprt &xor_expression, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const implies_exprt &implies, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const not_exprt &logical_not, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const equal_exprt &equal, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const notequal_exprt &not_equal, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const ieee_float_equal_exprt &float_equal, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const ieee_float_notequal_exprt &float_not_equal, const sub_expression_mapt &converted)
template<typename unsigned_factory_typet, typename signed_factory_typet>
static smt_termt convert_relational_to_smt (const binary_relation_exprt &binary_relation, const unsigned_factory_typet &unsigned_factory, const signed_factory_typet &signed_factory, const sub_expression_mapt &converted)
static std::optional< smt_termttry_relational_conversion (const exprt &expr, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const plus_exprt &plus, const sub_expression_mapt &converted, const type_size_mapt &pointer_sizes)
static smt_termt convert_expr_to_smt (const minus_exprt &minus, const sub_expression_mapt &converted, const type_size_mapt &pointer_sizes)
static smt_termt convert_expr_to_smt (const div_exprt &divide, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const ieee_float_op_exprt &float_operation, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const mod_exprt &truncation_modulo, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const euclidean_mod_exprt &euclidean_modulo, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const mult_exprt &multiply, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const address_of_exprt &address_of, const sub_expression_mapt &converted, const smt_object_mapt &object_map)
static smt_termt convert_expr_to_smt (const array_of_exprt &array_of, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const array_comprehension_exprt &array_comprehension, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const index_exprt &index_of, const sub_expression_mapt &converted)
template<typename factoryt, typename shiftt>
static smt_termt convert_to_smt_shift (const factoryt &factory, const shiftt &shift, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const shift_exprt &shift, const sub_expression_mapt &converted)
static smt_termt convert_array_update_to_smt (const with_exprt &with, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const with_exprt &with, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const update_exprt &update, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const member_exprt &member_extraction, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const is_dynamic_object_exprt &is_dynamic_object, const sub_expression_mapt &converted, const smt_is_dynamic_objectt::make_applicationt &apply_is_dynamic_object)
static smt_termt convert_expr_to_smt (const is_invalid_pointer_exprt &is_invalid_pointer, const smt_object_mapt &object_map, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const string_constantt &string_constant, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const extractbit_exprt &extract_bit, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const extractbits_exprt &extract_bits, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const replication_exprt &replication, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const byte_extract_exprt &byte_extraction, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const byte_update_exprt &byte_update, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const abs_exprt &absolute_value_of, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const isnan_exprt &is_nan_expr, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const isfinite_exprt &is_finite_expr, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const isinf_exprt &is_infinite_expr, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const isnormal_exprt &is_normal_expr, const sub_expression_mapt &converted)
static smt_termt most_significant_bit_is_set (const smt_termt &input)
 Constructs a term which is true if the most significant bit of input is set.
static smt_termt convert_expr_to_smt (const plus_overflow_exprt &plus_overflow, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const minus_overflow_exprt &minus_overflow, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const mult_overflow_exprt &mult_overflow, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const pointer_object_exprt &pointer_object, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const pointer_offset_exprt &pointer_offset, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const shl_overflow_exprt &shl_overflow, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const array_exprt &array_construction, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const literal_exprt &literal, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const forall_exprt &for_all, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const exists_exprt &exists, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const vector_exprt &vector, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const object_size_exprt &object_size, const sub_expression_mapt &converted, const smt_object_sizet::make_applicationt &call_object_size)
static smt_termt convert_expr_to_smt (const let_exprt &let, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const bswap_exprt &byte_swap, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const popcount_exprt &population_count, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const count_leading_zeros_exprt &count_leading_zeros, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const count_trailing_zeros_exprt &count_trailing_zeros, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const zero_extend_exprt &zero_extend, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const prophecy_r_or_w_ok_exprt &prophecy_r_or_w_ok, const sub_expression_mapt &converted)
static smt_termt convert_expr_to_smt (const prophecy_pointer_in_range_exprt &prophecy_pointer_in_range, const sub_expression_mapt &converted)
static smt_termt dispatch_expr_to_smt_conversion (const exprt &expr, const sub_expression_mapt &converted, const smt_object_mapt &object_map, const type_size_mapt &pointer_sizes, const smt_object_sizet::make_applicationt &call_object_size, const smt_is_dynamic_objectt::make_applicationt &apply_is_dynamic_object)
template<typename functiont>
at_scope_exitt< functiontat_scope_exit (functiont exit_function)
exprt lower_address_of_array_index (exprt expr)
 Lower the address_of(array[idx]) sub expressions in expr to idx + address_of(array), so that it can be fed to convert_expr_to_smt.
void filtered_visit_post (const exprt &_expr, std::function< bool(const exprt &)> filter, std::function< void(const exprt &)> visitor)
 Post order traversal where the children of a node are only visited if applying the filter function to that node returns true.
smt_termt convert_expr_to_smt (const exprt &expr, const smt_object_mapt &object_map, const type_size_mapt &pointer_sizes, const smt_object_sizet::make_applicationt &object_size, const smt_is_dynamic_objectt::make_applicationt &is_dynamic_object)
 Converts the expression to an smt encoding of the same expression stored as term ast (abstract syntax tree).

Typedef Documentation

◆ sub_expression_mapt

using sub_expression_mapt = std::unordered_map<exprt, smt_termt, irep_hash>

Post order visitation is used in order to construct the the smt terms bottom upwards without using recursion to traverse the input exprt.

Therefore the convert_expr_to_smt overload for any given type of exprt, will be passed a sub_expression_map which already contains the result of converting that expressions operands to smt terms. This has the advantages of -

  • avoiding the deeply nested call stacks associated with recursion.
  • supporting wider scope for the conversion of specific types of exprt, without inflating the parameter list / scope for all conversions.

Definition at line 37 of file convert_expr_to_smt.cpp.

Function Documentation

◆ at_scope_exit()

template<typename functiont>
at_scope_exitt< functiont > at_scope_exit ( functiont exit_function)

Definition at line 1881 of file convert_expr_to_smt.cpp.

◆ convert_array_update_to_smt()

smt_termt convert_array_update_to_smt ( const with_exprt & with,
const sub_expression_mapt & converted )
static

Definition at line 1019 of file convert_expr_to_smt.cpp.

◆ convert_bit_vector_cast()

smt_termt convert_bit_vector_cast ( const smt_termt & from_term,
const typet & from_type,
const bitvector_typet & to_type )
static

Definition at line 252 of file convert_expr_to_smt.cpp.

◆ convert_c_bool_cast()

smt_termt convert_c_bool_cast ( const smt_termt & from_term,
const typet & from_type,
const bitvector_typet & to_type )
static

Returns a cast to C bool expressed in smt terms.

Definition at line 162 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [1/74]

smt_termt convert_expr_to_smt ( const abs_exprt & absolute_value_of,
const sub_expression_mapt & converted )
static

Definition at line 1164 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [2/74]

smt_termt convert_expr_to_smt ( const address_of_exprt & address_of,
const sub_expression_mapt & converted,
const smt_object_mapt & object_map )
static

This conversion constructs a bit vector representation of the memory address. This address is composed of 2 concatenated bit vector components. The first part is the base object's unique identifier. The second is the offset into that object. For address of symbols the offset will be 0. The offset may be non-zero for cases such as the address of a member field of a struct or a the address of a non-zero index into an array.

Definition at line 881 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [3/74]

smt_termt convert_expr_to_smt ( const and_exprt & and_expression,
const sub_expression_mapt & converted )
static

Definition at line 492 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [4/74]

smt_termt convert_expr_to_smt ( const array_comprehension_exprt & array_comprehension,
const sub_expression_mapt & converted )
static

Definition at line 932 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [5/74]

smt_termt convert_expr_to_smt ( const array_exprt & array_construction,
const sub_expression_mapt & converted )
static

Definition at line 1386 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [6/74]

smt_termt convert_expr_to_smt ( const array_of_exprt & array_of,
const sub_expression_mapt & converted )
static

Definition at line 922 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [7/74]

smt_termt convert_expr_to_smt ( const bitand_exprt & bitwise_and_expr,
const sub_expression_mapt & converted )
static

Definition at line 382 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [8/74]

smt_termt convert_expr_to_smt ( const bitnot_exprt & bitwise_not,
const sub_expression_mapt & converted )
static

Definition at line 433 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [9/74]

smt_termt convert_expr_to_smt ( const bitor_exprt & bitwise_or_expr,
const sub_expression_mapt & converted )
static

Definition at line 399 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [10/74]

smt_termt convert_expr_to_smt ( const bitxor_exprt & bitwise_xor,
const sub_expression_mapt & converted )
static

Definition at line 416 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [11/74]

smt_termt convert_expr_to_smt ( const bswap_exprt & byte_swap,
const sub_expression_mapt & converted )
static

Definition at line 1451 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [12/74]

smt_termt convert_expr_to_smt ( const byte_extract_exprt & byte_extraction,
const sub_expression_mapt & converted )
static

Definition at line 1146 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [13/74]

smt_termt convert_expr_to_smt ( const byte_update_exprt & byte_update,
const sub_expression_mapt & converted )
static

Definition at line 1155 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [14/74]

smt_termt convert_expr_to_smt ( const concatenation_exprt & concatenation,
const sub_expression_mapt & converted )
static

Definition at line 368 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [15/74]

smt_termt convert_expr_to_smt ( const constant_exprt & constant_literal)
static

Definition at line 342 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [16/74]

smt_termt convert_expr_to_smt ( const count_leading_zeros_exprt & count_leading_zeros,
const sub_expression_mapt & converted )
static

Definition at line 1469 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [17/74]

smt_termt convert_expr_to_smt ( const count_trailing_zeros_exprt & count_trailing_zeros,
const sub_expression_mapt & converted )
static

Definition at line 1478 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [18/74]

smt_termt convert_expr_to_smt ( const div_exprt & divide,
const sub_expression_mapt & converted )
static

Definition at line 764 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [19/74]

smt_termt convert_expr_to_smt ( const equal_exprt & equal,
const sub_expression_mapt & converted )
static

Definition at line 531 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [20/74]

smt_termt convert_expr_to_smt ( const euclidean_mod_exprt & euclidean_modulo,
const sub_expression_mapt & converted )
static

Definition at line 843 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [21/74]

smt_termt convert_expr_to_smt ( const exists_exprt & exists,
const sub_expression_mapt & converted )
static

Definition at line 1412 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [22/74]

smt_termt convert_expr_to_smt ( const exprt & expr,
const smt_object_mapt & object_map,
const type_size_mapt & pointer_sizes,
const smt_object_sizet::make_applicationt & object_size,
const smt_is_dynamic_objectt::make_applicationt & is_dynamic_object )

Converts the expression to an smt encoding of the same expression stored as term ast (abstract syntax tree).

Definition at line 1946 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [23/74]

smt_termt convert_expr_to_smt ( const extractbit_exprt & extract_bit,
const sub_expression_mapt & converted )
static

Definition at line 1110 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [24/74]

smt_termt convert_expr_to_smt ( const extractbits_exprt & extract_bits,
const sub_expression_mapt & converted )
static

Definition at line 1119 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [25/74]

smt_termt convert_expr_to_smt ( const floatbv_typecast_exprt & float_cast,
const sub_expression_mapt & converted )
static

Definition at line 281 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [26/74]

smt_termt convert_expr_to_smt ( const forall_exprt & for_all,
const sub_expression_mapt & converted )
static

Definition at line 1404 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [27/74]

smt_termt convert_expr_to_smt ( const ieee_float_equal_exprt & float_equal,
const sub_expression_mapt & converted )
static

Definition at line 547 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [28/74]

smt_termt convert_expr_to_smt ( const ieee_float_notequal_exprt & float_not_equal,
const sub_expression_mapt & converted )
static

Definition at line 557 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [29/74]

smt_termt convert_expr_to_smt ( const ieee_float_op_exprt & float_operation,
const sub_expression_mapt & converted )
static

Definition at line 797 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [30/74]

smt_termt convert_expr_to_smt ( const if_exprt & if_expression,
const sub_expression_mapt & converted )
static

Definition at line 482 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [31/74]

smt_termt convert_expr_to_smt ( const implies_exprt & implies,
const sub_expression_mapt & converted )
static

Definition at line 516 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [32/74]

smt_termt convert_expr_to_smt ( const index_exprt & index_of,
const sub_expression_mapt & converted )
static

Definition at line 941 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [33/74]

smt_termt convert_expr_to_smt ( const is_dynamic_object_exprt & is_dynamic_object,
const sub_expression_mapt & converted,
const smt_is_dynamic_objectt::make_applicationt & apply_is_dynamic_object )
static

Definition at line 1059 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [34/74]

smt_termt convert_expr_to_smt ( const is_invalid_pointer_exprt & is_invalid_pointer,
const smt_object_mapt & object_map,
const sub_expression_mapt & converted )
static

Definition at line 1075 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [35/74]

smt_termt convert_expr_to_smt ( const isfinite_exprt & is_finite_expr,
const sub_expression_mapt & converted )
static

Definition at line 1183 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [36/74]

smt_termt convert_expr_to_smt ( const isinf_exprt & is_infinite_expr,
const sub_expression_mapt & converted )
static

Definition at line 1193 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [37/74]

smt_termt convert_expr_to_smt ( const isnan_exprt & is_nan_expr,
const sub_expression_mapt & converted )
static

Definition at line 1173 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [38/74]

smt_termt convert_expr_to_smt ( const isnormal_exprt & is_normal_expr,
const sub_expression_mapt & converted )
static

Definition at line 1203 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [39/74]

smt_termt convert_expr_to_smt ( const let_exprt & let,
const sub_expression_mapt & converted )
static

Definition at line 1445 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [40/74]

smt_termt convert_expr_to_smt ( const literal_exprt & literal,
const sub_expression_mapt & converted )
static

Definition at line 1396 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [41/74]

smt_termt convert_expr_to_smt ( const member_exprt & member_extraction,
const sub_expression_mapt & converted )
static

Definition at line 1050 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [42/74]

smt_termt convert_expr_to_smt ( const minus_exprt & minus,
const sub_expression_mapt & converted,
const type_size_mapt & pointer_sizes )
static

Definition at line 708 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [43/74]

smt_termt convert_expr_to_smt ( const minus_overflow_exprt & minus_overflow,
const sub_expression_mapt & converted )
static

Definition at line 1258 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [44/74]

smt_termt convert_expr_to_smt ( const mod_exprt & truncation_modulo,
const sub_expression_mapt & converted )
static

Definition at line 809 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [45/74]

smt_termt convert_expr_to_smt ( const mult_exprt & multiply,
const sub_expression_mapt & converted )
static

Definition at line 852 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [46/74]

smt_termt convert_expr_to_smt ( const mult_overflow_exprt & mult_overflow,
const sub_expression_mapt & converted )
static

Definition at line 1290 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [47/74]

smt_termt convert_expr_to_smt ( const nondet_symbol_exprt & nondet_symbol,
const sub_expression_mapt & converted )
static

Definition at line 137 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [48/74]

smt_termt convert_expr_to_smt ( const not_exprt & logical_not,
const sub_expression_mapt & converted )
static

Definition at line 524 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [49/74]

smt_termt convert_expr_to_smt ( const notequal_exprt & not_equal,
const sub_expression_mapt & converted )
static

Definition at line 539 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [50/74]

smt_termt convert_expr_to_smt ( const object_size_exprt & object_size,
const sub_expression_mapt & converted,
const smt_object_sizet::make_applicationt & call_object_size )
static

Definition at line 1428 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [51/74]

smt_termt convert_expr_to_smt ( const or_exprt & or_expression,
const sub_expression_mapt & converted )
static

Definition at line 500 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [52/74]

smt_termt convert_expr_to_smt ( const plus_exprt & plus,
const sub_expression_mapt & converted,
const type_size_mapt & pointer_sizes )
static

Definition at line 651 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [53/74]

smt_termt convert_expr_to_smt ( const plus_overflow_exprt & plus_overflow,
const sub_expression_mapt & converted )
static

Definition at line 1229 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [54/74]

smt_termt convert_expr_to_smt ( const pointer_object_exprt & pointer_object,
const sub_expression_mapt & converted )
static

Definition at line 1333 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [55/74]

smt_termt convert_expr_to_smt ( const pointer_offset_exprt & pointer_offset,
const sub_expression_mapt & converted )
static

Definition at line 1356 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [56/74]

smt_termt convert_expr_to_smt ( const popcount_exprt & population_count,
const sub_expression_mapt & converted )
static

Definition at line 1460 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [57/74]

smt_termt convert_expr_to_smt ( const prophecy_pointer_in_range_exprt & prophecy_pointer_in_range,
const sub_expression_mapt & converted )
static

Definition at line 1505 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [58/74]

smt_termt convert_expr_to_smt ( const prophecy_r_or_w_ok_exprt & prophecy_r_or_w_ok,
const sub_expression_mapt & converted )
static

Definition at line 1496 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [59/74]

smt_termt convert_expr_to_smt ( const replication_exprt & replication,
const sub_expression_mapt & converted )
static

Definition at line 1137 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [60/74]

smt_termt convert_expr_to_smt ( const shift_exprt & shift,
const sub_expression_mapt & converted )
static

Definition at line 991 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [61/74]

smt_termt convert_expr_to_smt ( const shl_overflow_exprt & shl_overflow,
const sub_expression_mapt & converted )
static

Definition at line 1377 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [62/74]

smt_termt convert_expr_to_smt ( const sign_exprt & is_negative,
const sub_expression_mapt & converted )
static

Definition at line 473 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [63/74]

smt_termt convert_expr_to_smt ( const string_constantt & string_constant,
const sub_expression_mapt & converted )
static

Definition at line 1101 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [64/74]

smt_termt convert_expr_to_smt ( const struct_exprt & struct_construction,
const sub_expression_mapt & converted )
static

Definition at line 293 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [65/74]

smt_termt convert_expr_to_smt ( const symbol_exprt & symbol_expr)
static

Definition at line 131 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [66/74]

smt_termt convert_expr_to_smt ( const typecast_exprt & cast,
const sub_expression_mapt & converted )
static

Definition at line 264 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [67/74]

smt_termt convert_expr_to_smt ( const unary_minus_exprt & unary_minus,
const sub_expression_mapt & converted )
static

Definition at line 448 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [68/74]

smt_termt convert_expr_to_smt ( const unary_plus_exprt & unary_plus,
const sub_expression_mapt & converted )
static

Definition at line 464 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [69/74]

smt_termt convert_expr_to_smt ( const union_exprt & union_construction,
const sub_expression_mapt & converted )
static

Definition at line 302 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [70/74]

smt_termt convert_expr_to_smt ( const update_exprt & update,
const sub_expression_mapt & converted )
static

Definition at line 1042 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [71/74]

smt_termt convert_expr_to_smt ( const vector_exprt & vector,
const sub_expression_mapt & converted )
static

Definition at line 1420 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [72/74]

smt_termt convert_expr_to_smt ( const with_exprt & with,
const sub_expression_mapt & converted )
static

Definition at line 1030 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [73/74]

smt_termt convert_expr_to_smt ( const xor_exprt & xor_expression,
const sub_expression_mapt & converted )
static

Definition at line 508 of file convert_expr_to_smt.cpp.

◆ convert_expr_to_smt() [74/74]

smt_termt convert_expr_to_smt ( const zero_extend_exprt & zero_extend,
const sub_expression_mapt & converted )
static

Definition at line 1487 of file convert_expr_to_smt.cpp.

◆ convert_multiary_operator_to_terms()

template<typename factoryt>
smt_termt convert_multiary_operator_to_terms ( const multi_ary_exprt & expr,
const sub_expression_mapt & converted,
const factoryt & factory )
static

Converts operator expressions with 2 or more operands to terms expressed as binary operator application.

Parameters
exprThe expression to convert.
convertedMap for looking up previously converted sub expressions.
factoryThe factory function which makes applications of the relevant smt term, when applied to the term operands.

The conversion used is left associative for instances with 3 or more operands. The SMT standard / core theory version 2.6 actually supports applying the and, or and xor to 3 or more operands. However our internal smt_core_theoryt does not support this currently and converting to binary application has the advantage of making the order of evaluation explicit.

Definition at line 52 of file convert_expr_to_smt.cpp.

◆ convert_relational_to_smt()

template<typename unsigned_factory_typet, typename signed_factory_typet>
smt_termt convert_relational_to_smt ( const binary_relation_exprt & binary_relation,
const unsigned_factory_typet & unsigned_factory,
const signed_factory_typet & signed_factory,
const sub_expression_mapt & converted )
static

Definition at line 568 of file convert_expr_to_smt.cpp.

◆ convert_to_smt_shift()

template<typename factoryt, typename shiftt>
smt_termt convert_to_smt_shift ( const factoryt & factory,
const shiftt & shift,
const sub_expression_mapt & converted )
static

Definition at line 951 of file convert_expr_to_smt.cpp.

◆ convert_type_to_smt_sort() [1/5]

smt_sortt convert_type_to_smt_sort ( const array_typet & type)
static

Definition at line 92 of file convert_expr_to_smt.cpp.

◆ convert_type_to_smt_sort() [2/5]

smt_sortt convert_type_to_smt_sort ( const bitvector_typet & type)
static

Definition at line 87 of file convert_expr_to_smt.cpp.

◆ convert_type_to_smt_sort() [3/5]

smt_sortt convert_type_to_smt_sort ( const bool_typet & type)
static

Definition at line 82 of file convert_expr_to_smt.cpp.

◆ convert_type_to_smt_sort() [4/5]

smt_sortt convert_type_to_smt_sort ( const floatbv_typet & type)
static

Definition at line 99 of file convert_expr_to_smt.cpp.

◆ convert_type_to_smt_sort() [5/5]

smt_sortt convert_type_to_smt_sort ( const typet & type)

Converts the type to an smt encoding of the same expression stored as sort ast (abstract syntax tree).

Definition at line 105 of file convert_expr_to_smt.cpp.

◆ dispatch_expr_to_smt_conversion()

smt_termt dispatch_expr_to_smt_conversion ( const exprt & expr,
const sub_expression_mapt & converted,
const smt_object_mapt & object_map,
const type_size_mapt & pointer_sizes,
const smt_object_sizet::make_applicationt & call_object_size,
const smt_is_dynamic_objectt::make_applicationt & apply_is_dynamic_object )
static

Definition at line 1514 of file convert_expr_to_smt.cpp.

◆ extension_for_type()

std::function< std::function< smt_termt(smt_termt)>(std::size_t)> extension_for_type ( const typet & type)
static

Definition at line 175 of file convert_expr_to_smt.cpp.

◆ filtered_visit_post()

void filtered_visit_post ( const exprt & _expr,
std::function< bool(const exprt &)> filter,
std::function< void(const exprt &)> visitor )

Post order traversal where the children of a node are only visited if applying the filter function to that node returns true.

Note that this function is based on the visit_post_template function.

Definition at line 1909 of file convert_expr_to_smt.cpp.

◆ lower_address_of_array_index()

exprt lower_address_of_array_index ( exprt expr)

Lower the address_of(array[idx]) sub expressions in expr to idx + address_of(array), so that it can be fed to convert_expr_to_smt.

Definition at line 1887 of file convert_expr_to_smt.cpp.

◆ make_bitvector_resize_cast()

smt_termt make_bitvector_resize_cast ( const smt_termt & from_term,
const bitvector_typet & from_type,
const bitvector_typet & to_type )
static

Definition at line 188 of file convert_expr_to_smt.cpp.

◆ make_not_zero()

smt_termt make_not_zero ( const smt_termt & input,
const typet & source_type )
static

Makes a term which is true if input is not 0 / false.

Definition at line 149 of file convert_expr_to_smt.cpp.

◆ most_significant_bit_is_set()

smt_termt most_significant_bit_is_set ( const smt_termt & input)
static

Constructs a term which is true if the most significant bit of input is set.

Definition at line 1216 of file convert_expr_to_smt.cpp.

◆ operands_are_of_type()

template<typename target_typet>
bool operands_are_of_type ( const exprt & expr)
static

Ensures that all operands of the argument expression have related types.

Parameters
exprThe expression of which the operands we evaluate for type equality.

Definition at line 74 of file convert_expr_to_smt.cpp.

◆ try_relational_conversion()

std::optional< smt_termt > try_relational_conversion ( const exprt & expr,
const sub_expression_mapt & converted )
static

Definition at line 608 of file convert_expr_to_smt.cpp.