ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
irep2_expr.h File Reference
Include dependency graph for irep2_expr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  exists2t
class  forall2t
class  constant_int2t
 Constant integer class. More...
class  constant_fixedbv2t
 Constant fixedbv class. More...
class  constant_floatbv2t
 Constant floatbv class. More...
class  constant_bool2t
 Constant boolean value. More...
class  constant_string2t
 Constant class for string constants. More...
class  constant_struct2t
 Constant structure. More...
class  constant_union2t
 Constant union expression. More...
class  constant_array2t
 Constant array. More...
class  constant_vector2t
 Constant vector. More...
class  constant_array_of2t
 Constant array of one particular value. More...
class  symbol2t
 Symbol type. More...
class  nearbyint2t
 Nearbyint expression. More...
class  typecast2t
 Typecast expression. More...
class  bitcast2t
 Bitcast expression. More...
class  if2t
 If-then-else expression. More...
class  code_decl2t
 code_decl2t — variable declaration, with optional initializer. More...
class  cmp_three_way2t
 C++20 three-way comparison a <=> b. More...
class  not2t
 Not operation. More...
class  ieee_fma2t
 IEEE fused multiply-add operation. More...
class  ieee_sqrt2t
 IEEE sqrt operation. More...
class  same_object2t
 Same-object operation. More...
class  pointer_offset2t
 Extract pointer offset. More...
class  address_of2t
 Address of operation. More...
class  byte_extract2t
 Extract byte from data. More...
class  byte_update2t
 Update byte. More...
class  with2t
 With operation. More...
class  member2t
 Member operation. More...
class  member_ref2t
 Member reference. More...
class  ptr_mem2t
 Member pointer. More...
class  index2t
 Array index operation. More...
class  overflow2t
 Check whether operand overflows. More...
class  overflow_cast2t
 Test if a cast overflows. More...
class  overflow_neg2t
 Test for negation overflows. More...
class  dynamic_object2t
 Record a dynamicly allocated object. More...
class  dereference2t
 Dereference operation. More...
class  sideeffect2t
 Irep for various side effects. More...
class  code_block2t
class  code_assign2t
class  code_printf2t
class  code_skip2t
class  new_object2t
 C++ constructor "this" placeholder (exprt("new_object")). More...
class  uninterpreted_func2t
 Uninterpreted-function application. More...
class  code_goto2t
class  object_descriptor2t
class  code_function_call2t
class  code_ifthenelse2t
class  code_while2t
class  code_dowhile2t
class  code_for2t
class  code_switch2t
class  code_break2t
class  code_continue2t
class  code_label2t
class  code_switch_case2t
 V.4.2: one case/default arm of a switch body. More...
class  code_assert2t
 V.4.3: code_assert / code_assume — single-guard code kinds emitted by the Python / C++ frontends for assert and __ESBMC_assume. More...
class  code_assume2t
class  sideeffect_assign2t
 V.4.2: wraps C-frontend sideeffect assignment nodes — simple = and compound +=, -=, etc. More...
class  code_comma2t
class  invalid_pointer2t
class  code_asm2t
class  code_cpp_catch2t
class  code_cpp_throw2t
class  concat2t
 Bit concatenation of two operands. More...
class  extract2t
class  sizeof2t
 sizeof(T) expression. More...

Macros

#define IREP2_EXPR(kind, pretty)
#define irep_typedefs(basename)
#define ESBMC_DEFINE_RELATION2T(name)
 Defines one of the six binary boolean relation nodes.
#define ESBMC_DEFINE_ARITH_2OP(name)
 Arithmetic two-operand node (add/sub/mul/div/modulus).
#define ESBMC_DEFINE_BIT_2OP(name)
 Bitwise / shift two-operand node (bitand/bitor/bitxor/ shl/ashr/lshr).
#define ESBMC_DEFINE_ARITH_1OP(name)
 Arithmetic one-operand node (neg/abs/bswap/bitnot).
#define ESBMC_DEFINE_POINTER_1OP(name)
 Pointer one-operand node (pointer_object/pointer_capability).
#define ESBMC_DEFINE_LOGIC_2OP(name)
 Logical two-operand boolean-result node.
#define ESBMC_DEFINE_FP_PREDICATE_1OP(name)
 FP classification single-operand predicate (isnan/isinf/ isnormal/isfinite).
#define ESBMC_DEFINE_OBJECT_PREDICATE_1OP(name)
 Pointer-object boolean predicate (valid_object/races_check/ deallocated_obj).
#define ESBMC_DEFINE_OBJECT_SIZE_1OP(name)
 Pointer-object size-returning op (capability_base/capability_top/ dynamic_size).
#define ESBMC_DEFINE_OVERFLOW_INT32_1OP(name)
 Single-operand overflow-family op returning int32 (signbit/ popcount).
#define ESBMC_DEFINE_TYPE_ONLY(name)
 Marker node holding only a type (no operands).
#define ESBMC_DEFINE_CODE_EXPRESSION_1OP(name)
 code_* statement with empty type and a single expr2tc operand (code_expression/code_return/code_free/code_cpp_del_array/ code_cpp_delete).
#define ESBMC_DEFINE_CODE_DECL(name)
 code_* declaration carrying (type, irep_idt name).
#define ESBMC_DEFINE_IEEE_ARITH_2OP(name)
 Defines an IEEE two-operand floating-point arithmetic node (add/sub/mul/div).
#define expr_macros(name)
#define IREP2_EXPR(kind, pretty)

Enumerations

enum class  constant_string_kindt { DEFAULT , WIDE , UNICODE }
enum class  symbol_renaming_level {
  level0 , level1 , level2 , level1_global ,
  level2_global
}
 Symex renaming level for symbol2t. More...
enum class  sideeffect_allockind {
  malloc , realloc , alloca , cpp_new ,
  cpp_new_arr , nondet , va_arg , printf2 ,
  function_call , preincrement , postincrement , predecrement ,
  postdecrement , old_snapshot , assigns_target , statement_expression ,
  temporary_object , gcc_conditional_expression , cpp_delete , cpp_delete_array
}
 Enumeration identifying each particular kind of side effect. More...
enum class  printf_kindt {
  PRINTF , FPRINTF , DPRINTF , SPRINTF ,
  VFPRINTF , SNPRINTF , VPRINTF , VSPRINTF ,
  VSNPRINTF , ASPRINTF , VASPRINTF
}
 Which member of the printf family a code_printf2t represents. More...

Functions

void assert_arith_2ops_consistency (const type2tc &t, expr2t::expr_ids id, const expr2tc &v1, const expr2tc &v2)
 Debug-only consistency check for arith_2ops operands and result type.
printf_kindt printf_kind_from_name (const irep_idt &name)
 Maps the textual base_name of a printf-family symbol (e.g.
 irep_typedefs (constant_int)
 irep_typedefs (constant_fixedbv)
 irep_typedefs (constant_floatbv)
 irep_typedefs (constant_struct)
 irep_typedefs (constant_union)
 irep_typedefs (constant_array)
 irep_typedefs (constant_vector)
 irep_typedefs (constant_bool)
 irep_typedefs (constant_array_of)
 irep_typedefs (constant_string)
 irep_typedefs (symbol)
 irep_typedefs (nearbyint)
 irep_typedefs (typecast)
 irep_typedefs (bitcast)
 irep_typedefs (if)
 irep_typedefs (equality)
 irep_typedefs (notequal)
 irep_typedefs (lessthan)
 irep_typedefs (greaterthan)
 irep_typedefs (lessthanequal)
 irep_typedefs (greaterthanequal)
 irep_typedefs (cmp_three_way)
 irep_typedefs (not)
 irep_typedefs (and)
 irep_typedefs (or)
 irep_typedefs (xor)
 irep_typedefs (implies)
 irep_typedefs (bitand)
 irep_typedefs (bitor)
 irep_typedefs (bitxor)
 irep_typedefs (lshr)
 irep_typedefs (bitnot)
 irep_typedefs (neg)
 irep_typedefs (abs)
 irep_typedefs (add)
 irep_typedefs (sub)
 irep_typedefs (mul)
 irep_typedefs (div)
 irep_typedefs (ieee_add)
 irep_typedefs (ieee_sub)
 irep_typedefs (ieee_mul)
 irep_typedefs (ieee_div)
 irep_typedefs (ieee_rem)
 irep_typedefs (ieee_fma)
 irep_typedefs (ieee_sqrt)
 irep_typedefs (modulus)
 irep_typedefs (shl)
 irep_typedefs (ashr)
 irep_typedefs (same_object)
 irep_typedefs (pointer_offset)
 irep_typedefs (pointer_object)
 irep_typedefs (pointer_capability)
 irep_typedefs (address_of)
 irep_typedefs (byte_extract)
 irep_typedefs (byte_update)
 irep_typedefs (with)
 irep_typedefs (member)
 irep_typedefs (member_ref)
 irep_typedefs (ptr_mem)
 irep_typedefs (index)
 irep_typedefs (isnan)
 irep_typedefs (overflow)
 irep_typedefs (overflow_cast)
 irep_typedefs (overflow_neg)
 irep_typedefs (unknown)
 irep_typedefs (invalid)
 irep_typedefs (null_object)
 irep_typedefs (dynamic_object)
 irep_typedefs (dereference)
 irep_typedefs (valid_object)
 irep_typedefs (races_check)
 irep_typedefs (deallocated_obj)
 irep_typedefs (dynamic_size)
 irep_typedefs (sideeffect)
 irep_typedefs (code_block)
 irep_typedefs (code_assign)
 irep_typedefs (code_decl)
 irep_typedefs (code_dead)
 irep_typedefs (code_printf)
 irep_typedefs (code_expression)
 irep_typedefs (code_return)
 irep_typedefs (code_skip)
 irep_typedefs (code_free)
 irep_typedefs (code_goto)
 irep_typedefs (object_descriptor)
 irep_typedefs (code_function_call)
 irep_typedefs (code_ifthenelse)
 irep_typedefs (code_while)
 irep_typedefs (code_dowhile)
 irep_typedefs (code_for)
 irep_typedefs (code_switch)
 irep_typedefs (code_break)
 irep_typedefs (code_continue)
 irep_typedefs (code_label)
 irep_typedefs (code_switch_case)
 irep_typedefs (code_assert)
 irep_typedefs (code_assume)
 irep_typedefs (sideeffect_assign)
 irep_typedefs (code_comma)
 irep_typedefs (invalid_pointer)
 irep_typedefs (code_asm)
 irep_typedefs (code_cpp_del_array)
 irep_typedefs (code_cpp_delete)
 irep_typedefs (code_cpp_catch)
 irep_typedefs (code_cpp_throw)
 irep_typedefs (isinf)
 irep_typedefs (isnormal)
 irep_typedefs (isfinite)
 irep_typedefs (signbit)
 irep_typedefs (popcount)
 irep_typedefs (bswap)
 irep_typedefs (concat)
 irep_typedefs (extract)
 irep_typedefs (capability_base)
 irep_typedefs (capability_top)
 irep_typedefs (forall)
 irep_typedefs (exists)
 irep_typedefs (isinstance)
 irep_typedefs (hasattr)
 irep_typedefs (isnone)
 irep_typedefs (new_object)
 irep_typedefs (sizeof)
 irep_typedefs (uninterpreted_func)
 ESBMC_DEFINE_RELATION2T (equality)
 ESBMC_DEFINE_RELATION2T (notequal)
 ESBMC_DEFINE_RELATION2T (lessthan)
 ESBMC_DEFINE_RELATION2T (greaterthan)
 ESBMC_DEFINE_RELATION2T (lessthanequal)
 ESBMC_DEFINE_RELATION2T (greaterthanequal)
 ESBMC_DEFINE_ARITH_2OP (add)
 ESBMC_DEFINE_ARITH_2OP (sub)
 ESBMC_DEFINE_ARITH_2OP (mul)
 ESBMC_DEFINE_ARITH_2OP (div)
 ESBMC_DEFINE_ARITH_2OP (modulus)
 ESBMC_DEFINE_BIT_2OP (bitand)
 ESBMC_DEFINE_BIT_2OP (bitor)
 ESBMC_DEFINE_BIT_2OP (bitxor)
 ESBMC_DEFINE_BIT_2OP (lshr)
 ESBMC_DEFINE_BIT_2OP (shl)
 ESBMC_DEFINE_BIT_2OP (ashr)
 ESBMC_DEFINE_ARITH_1OP (neg)
 ESBMC_DEFINE_ARITH_1OP (abs)
 ESBMC_DEFINE_ARITH_1OP (bitnot)
 ESBMC_DEFINE_ARITH_1OP (bswap)
 ESBMC_DEFINE_POINTER_1OP (pointer_object)
 ESBMC_DEFINE_POINTER_1OP (pointer_capability)
 ESBMC_DEFINE_LOGIC_2OP (and)
 ESBMC_DEFINE_LOGIC_2OP (or)
 ESBMC_DEFINE_LOGIC_2OP (xor)
 ESBMC_DEFINE_LOGIC_2OP (implies)
 ESBMC_DEFINE_LOGIC_2OP (isinstance)
 ESBMC_DEFINE_LOGIC_2OP (hasattr)
 ESBMC_DEFINE_LOGIC_2OP (isnone)
 ESBMC_DEFINE_FP_PREDICATE_1OP (isnan)
 ESBMC_DEFINE_FP_PREDICATE_1OP (isinf)
 ESBMC_DEFINE_FP_PREDICATE_1OP (isnormal)
 ESBMC_DEFINE_FP_PREDICATE_1OP (isfinite)
 ESBMC_DEFINE_OBJECT_PREDICATE_1OP (valid_object)
 ESBMC_DEFINE_OBJECT_PREDICATE_1OP (races_check)
 ESBMC_DEFINE_OBJECT_PREDICATE_1OP (deallocated_obj)
 ESBMC_DEFINE_OBJECT_SIZE_1OP (dynamic_size)
 ESBMC_DEFINE_OBJECT_SIZE_1OP (capability_base)
 ESBMC_DEFINE_OBJECT_SIZE_1OP (capability_top)
 ESBMC_DEFINE_OVERFLOW_INT32_1OP (signbit)
 ESBMC_DEFINE_OVERFLOW_INT32_1OP (popcount)
 ESBMC_DEFINE_TYPE_ONLY (unknown)
 ESBMC_DEFINE_TYPE_ONLY (invalid)
 ESBMC_DEFINE_TYPE_ONLY (null_object)
 ESBMC_DEFINE_CODE_EXPRESSION_1OP (code_expression)
 ESBMC_DEFINE_CODE_EXPRESSION_1OP (code_return)
 ESBMC_DEFINE_CODE_EXPRESSION_1OP (code_free)
 ESBMC_DEFINE_CODE_EXPRESSION_1OP (code_cpp_del_array)
 ESBMC_DEFINE_CODE_EXPRESSION_1OP (code_cpp_delete)
 ESBMC_DEFINE_CODE_DECL (code_dead)
 ESBMC_DEFINE_IEEE_ARITH_2OP (ieee_add)
 ESBMC_DEFINE_IEEE_ARITH_2OP (ieee_sub)
 ESBMC_DEFINE_IEEE_ARITH_2OP (ieee_mul)
 ESBMC_DEFINE_IEEE_ARITH_2OP (ieee_div)
 ESBMC_DEFINE_IEEE_ARITH_2OP (ieee_rem)
 IEEE 754 remainder (SMT-LIB fp.rem, C's remainder()): x - n*y with n = rne(x/y).

Macro Definition Documentation

◆ ESBMC_DEFINE_ARITH_1OP

#define ESBMC_DEFINE_ARITH_1OP ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
name##2t(const type2tc &type, const expr2tc &v) \
: expr2t(type, name##_id), value(v) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = \
std::make_tuple(&expr2t::type, &name##2t ::value); \
static std::string field_names[esbmct::num_type_fields]; \
}
Base class for all expressions.
Definition irep2.h:725
expr2t(const type2tc &type, expr_ids id)
Primary constructor.
Definition irep2_expr.cpp:49
const type2tc type
Type of this expr.
Definition irep2.h:910
Definition toml.hpp:1531
irep_container< type2t > type2tc
Definition irep2.h:430
irep_container< expr2t > expr2tc
Definition irep2.h:431
const unsigned int num_type_fields
Maximum number of fields to support in expr2t subclasses.
Definition irep2.h:998
void * value
Definition solidity_mapping.c:2

Arithmetic one-operand node (neg/abs/bswap/bitnot).

◆ ESBMC_DEFINE_ARITH_2OP

#define ESBMC_DEFINE_ARITH_2OP ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
expr2tc side_1, side_2; \
name##2t(const type2tc &type, const expr2tc &v1, const expr2tc &v2) \
: expr2t(type, name##_id), side_1(v1), side_2(v2) \
{ \
assert_arith_2ops_consistency(type, name##_id, v1, v2); \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = \
std::make_tuple(&expr2t::type, &name##2t ::side_1, &name##2t ::side_2); \
static std::string field_names[esbmct::num_type_fields]; \
}

Arithmetic two-operand node (add/sub/mul/div/modulus).

◆ ESBMC_DEFINE_BIT_2OP

#define ESBMC_DEFINE_BIT_2OP ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
expr2tc side_1, side_2; \
name##2t(const type2tc &type, const expr2tc &v1, const expr2tc &v2) \
: expr2t(type, name##_id), side_1(v1), side_2(v2) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = \
std::make_tuple(&expr2t::type, &name##2t ::side_1, &name##2t ::side_2); \
static std::string field_names[esbmct::num_type_fields]; \
}

Bitwise / shift two-operand node (bitand/bitor/bitxor/ shl/ashr/lshr).

◆ ESBMC_DEFINE_CODE_DECL

#define ESBMC_DEFINE_CODE_DECL ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
locationt location; /* not reflected: source loc travels with the stmt */ \
static constexpr std::size_t excluded_field_bytes = sizeof(locationt); \
name##2t( \
const type2tc &type, \
const irep_idt &n, \
const locationt &loc = locationt()) \
: expr2t(type, name##_id), value(n), location(loc) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = \
std::make_tuple(&expr2t::type, &name##2t ::value); \
static std::string field_names[esbmct::num_type_fields]; \
}
Definition irep_idt.h:12
Definition location.h:7

code_* declaration carrying (type, irep_idt name).

Used for code_dead. (code_decl2t is defined separately below because it also carries an initializer.)

◆ ESBMC_DEFINE_CODE_EXPRESSION_1OP

#define ESBMC_DEFINE_CODE_EXPRESSION_1OP ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
expr2tc operand; \
locationt location; /* not reflected: source loc travels with the stmt */ \
static constexpr std::size_t excluded_field_bytes = sizeof(locationt); \
name##2t(const expr2tc &op, const locationt &loc = locationt()) \
: expr2t(get_empty_type(), name##_id), operand(op), location(loc) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = std::make_tuple(&name##2t ::operand); \
static std::string field_names[esbmct::num_type_fields]; \
}
type2tc get_empty_type()
Definition c_types.cpp:424

code_* statement with empty type and a single expr2tc operand (code_expression/code_return/code_free/code_cpp_del_array/ code_cpp_delete).

◆ ESBMC_DEFINE_FP_PREDICATE_1OP

#define ESBMC_DEFINE_FP_PREDICATE_1OP ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
name##2t(const expr2tc &operand) \
: expr2t(get_bool_type(), name##_id), value(operand) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = std::make_tuple(&name##2t ::value); \
static std::string field_names[esbmct::num_type_fields]; \
}
type2tc get_bool_type()
Definition c_types.cpp:418

FP classification single-operand predicate (isnan/isinf/ isnormal/isfinite).

Implicit get_bool_type() result.

◆ ESBMC_DEFINE_IEEE_ARITH_2OP

#define ESBMC_DEFINE_IEEE_ARITH_2OP ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
expr2tc rounding_mode, side_1, side_2; \
name##2t( \
const type2tc &type, \
const expr2tc &v1, \
const expr2tc &v2, \
const expr2tc &rm) \
: expr2t(type, name##_id), rounding_mode(rm), side_1(v1), side_2(v2) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = std::make_tuple( \
&name##2t ::rounding_mode, \
&name##2t ::side_1, \
&name##2t ::side_2); \
static std::string field_names[esbmct::num_type_fields]; \
}

Defines an IEEE two-operand floating-point arithmetic node (add/sub/mul/div).

Each takes two operands and a rounding mode, has matching floatbv operand/result types, and provides an out-of-line do_simplify override in src/util/expr_simplifier.cpp.

◆ ESBMC_DEFINE_LOGIC_2OP

#define ESBMC_DEFINE_LOGIC_2OP ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
expr2tc side_1, side_2; \
name##2t(const expr2tc &s1, const expr2tc &s2) \
: expr2t(get_bool_type(), name##_id), side_1(s1), side_2(s2) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = \
std::make_tuple(&expr2t::type, &name##2t ::side_1, &name##2t ::side_2); \
static std::string field_names[esbmct::num_type_fields]; \
}

Logical two-operand boolean-result node.

Used for and/or/xor/ implies and the Python runtime predicates isinstance/hasattr/ isnone. Implicit get_bool_type() result.

◆ ESBMC_DEFINE_OBJECT_PREDICATE_1OP

#define ESBMC_DEFINE_OBJECT_PREDICATE_1OP ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
name##2t(const expr2tc &operand) \
: expr2t(get_bool_type(), name##_id), value(operand) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = std::make_tuple(&name##2t ::value); \
static std::string field_names[esbmct::num_type_fields]; \
}

Pointer-object boolean predicate (valid_object/races_check/ deallocated_obj).

Implicit get_bool_type() result.

◆ ESBMC_DEFINE_OBJECT_SIZE_1OP

#define ESBMC_DEFINE_OBJECT_SIZE_1OP ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
name##2t(const expr2tc &operand) \
: expr2t(size_type2(), name##_id), value(operand) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = std::make_tuple(&name##2t ::value); \
static std::string field_names[esbmct::num_type_fields]; \
}
type2tc size_type2()
Definition c_types.cpp:273

Pointer-object size-returning op (capability_base/capability_top/ dynamic_size).

Implicit size_type2() result.

◆ ESBMC_DEFINE_OVERFLOW_INT32_1OP

#define ESBMC_DEFINE_OVERFLOW_INT32_1OP ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
expr2tc operand; \
name##2t(const expr2tc &op) \
: expr2t(get_int32_type(), name##_id), operand(op) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = \
std::make_tuple(&expr2t::type, &name##2t ::operand); \
static std::string field_names[esbmct::num_type_fields]; \
}
type2tc get_int32_type()
Definition c_types.cpp:372

Single-operand overflow-family op returning int32 (signbit/ popcount).

◆ ESBMC_DEFINE_POINTER_1OP

#define ESBMC_DEFINE_POINTER_1OP ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
expr2tc ptr_obj; \
name##2t(const type2tc &type, const expr2tc &v) \
: expr2t(type, name##_id), ptr_obj(v) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = \
std::make_tuple(&expr2t::type, &name##2t ::ptr_obj); \
static std::string field_names[esbmct::num_type_fields]; \
}

Pointer one-operand node (pointer_object/pointer_capability).

◆ ESBMC_DEFINE_RELATION2T

#define ESBMC_DEFINE_RELATION2T ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
expr2tc side_1, side_2; \
name##2t(const expr2tc &v1, const expr2tc &v2) \
: expr2t(get_bool_type(), name##_id), side_1(v1), side_2(v2) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = \
std::make_tuple(&expr2t::type, &name##2t ::side_1, &name##2t ::side_2); \
static std::string field_names[esbmct::num_type_fields]; \
}

Defines one of the six binary boolean relation nodes.

Each takes two operands of any matching scalar/pointer type, has boolean result type, and provides an out-of-line do_simplify override in src/util/expr_simplifier.cpp.

◆ ESBMC_DEFINE_TYPE_ONLY

#define ESBMC_DEFINE_TYPE_ONLY ( name)
Value:
class name##2t : public expr2t \
{ \
public: \
name##2t(const type2tc &type) : expr2t(type, name##_id) \
{ \
} \
name##2t(const name##2t & ref) = default; \
expr2tc do_simplify() const override; \
static constexpr auto fields = std::make_tuple(&expr2t::type); \
static std::string field_names[esbmct::num_type_fields]; \
}

Marker node holding only a type (no operands).

Used for unknown/invalid/null_object.

◆ expr_macros

#define expr_macros ( name)
Value:
inline bool is_##name##2t(const expr2tc &t) \
{ \
return t->expr_id == expr2t::name##_id; \
} \
inline const name##2t & to_##name##2t(const expr2tc &t) \
{ \
*t, expr2t::name##_id, #name); \
} \
inline name##2t & to_##name##2t(expr2tc & t) \
{ \
*t.get(), expr2t::name##_id, #name); \
} \
inline const name##2t * try_to_##name##2t(const expr2tc &t) \
{ \
return is_##name##2t(t) ? &to_##name##2t(t) : nullptr; \
}
Derived & irep2_checked_expr_cast(expr2t &e, expr2t::expr_ids expected, const char *target_name)
Definition irep2.h:1224
name
Definition transform.py:21

◆ IREP2_EXPR [1/2]

#define IREP2_EXPR ( kind,
pretty )
Value:
#define expr_macros(name)
Definition irep2_expr.h:2778

◆ IREP2_EXPR [2/2]

#define IREP2_EXPR ( kind,
pretty )
Value:
class kind##2t;

◆ irep_typedefs

#define irep_typedefs ( basename)
Value:
template <typename... Args> \
inline expr2tc basename##2tc(Args && ...args) \
{ \
return make_irep<basename##2t>(std::forward<Args>(args)...); \
}
irep_container< typename T::base_type > make_irep(Args &&...args)
Allocate a fresh irep2 node and adopt it into an irep_container.
Definition irep2.h:451

Enumeration Type Documentation

◆ constant_string_kindt

Enumerator
DEFAULT 
WIDE 
UNICODE 

◆ printf_kindt

enum class printf_kindt
strong

Which member of the printf family a code_printf2t represents.

Enumerator
PRINTF 
FPRINTF 
DPRINTF 
SPRINTF 
VFPRINTF 
SNPRINTF 
VPRINTF 
VSPRINTF 
VSNPRINTF 
ASPRINTF 
VASPRINTF 

◆ sideeffect_allockind

enum class sideeffect_allockind
strong

Enumeration identifying each particular kind of side effect.

Enumerator
malloc 
realloc 
alloca 
cpp_new 
cpp_new_arr 
nondet 
va_arg 
printf2 
function_call 
preincrement 
postincrement 
predecrement 
postdecrement 
old_snapshot 
assigns_target 
statement_expression 
temporary_object 
gcc_conditional_expression 
cpp_delete 
cpp_delete_array 

◆ symbol_renaming_level

Symex renaming level for symbol2t.

Symbolic execution rewrites a symbol into successively more specific variants as it threads constraints through the SSA program:

  • level0 — the raw symbol straight from the frontend, no activation/SSA decoration applied yet.
  • level1 — annotated with the function activation record (level1_num) and owning thread (thread_num); the symbol refers to a particular per-thread, per-call instance of a local.
  • level2 — additionally annotated with an SSA assignment counter (level2_num, node_num); the symbol refers to a specific value version of that local.
  • level1_global — like level1, but for a globally-scoped symbol (no activation record applies; it is shared across functions).
  • level2_global — like level2, but for a globally-scoped symbol.

See src/goto-symex/state/renaming.cpp for the exact transitions.

Enumerator
level0 
level1 
level2 
level1_global 
level2_global 

Function Documentation

◆ assert_arith_2ops_consistency()

void assert_arith_2ops_consistency ( const type2tc & t,
expr2t::expr_ids id,
const expr2tc & v1,
const expr2tc & v2 )

Debug-only consistency check for arith_2ops operands and result type.

Called from add2t/sub2t/mul2t/div2t/modulus2t constructors; no-op in Release.

◆ ESBMC_DEFINE_ARITH_1OP() [1/4]

ESBMC_DEFINE_ARITH_1OP ( abs )

◆ ESBMC_DEFINE_ARITH_1OP() [2/4]

ESBMC_DEFINE_ARITH_1OP ( bitnot )

◆ ESBMC_DEFINE_ARITH_1OP() [3/4]

ESBMC_DEFINE_ARITH_1OP ( bswap )

◆ ESBMC_DEFINE_ARITH_1OP() [4/4]

ESBMC_DEFINE_ARITH_1OP ( neg )

◆ ESBMC_DEFINE_ARITH_2OP() [1/5]

ESBMC_DEFINE_ARITH_2OP ( add )

◆ ESBMC_DEFINE_ARITH_2OP() [2/5]

ESBMC_DEFINE_ARITH_2OP ( div )

◆ ESBMC_DEFINE_ARITH_2OP() [3/5]

ESBMC_DEFINE_ARITH_2OP ( modulus )

◆ ESBMC_DEFINE_ARITH_2OP() [4/5]

ESBMC_DEFINE_ARITH_2OP ( mul )

◆ ESBMC_DEFINE_ARITH_2OP() [5/5]

ESBMC_DEFINE_ARITH_2OP ( sub )

◆ ESBMC_DEFINE_BIT_2OP() [1/6]

ESBMC_DEFINE_BIT_2OP ( ashr )

◆ ESBMC_DEFINE_BIT_2OP() [2/6]

ESBMC_DEFINE_BIT_2OP ( bitand )

◆ ESBMC_DEFINE_BIT_2OP() [3/6]

ESBMC_DEFINE_BIT_2OP ( bitor )

◆ ESBMC_DEFINE_BIT_2OP() [4/6]

ESBMC_DEFINE_BIT_2OP ( bitxor )

◆ ESBMC_DEFINE_BIT_2OP() [5/6]

ESBMC_DEFINE_BIT_2OP ( lshr )

◆ ESBMC_DEFINE_BIT_2OP() [6/6]

ESBMC_DEFINE_BIT_2OP ( shl )

◆ ESBMC_DEFINE_CODE_DECL()

ESBMC_DEFINE_CODE_DECL ( code_dead )

◆ ESBMC_DEFINE_CODE_EXPRESSION_1OP() [1/5]

ESBMC_DEFINE_CODE_EXPRESSION_1OP ( code_cpp_del_array )

◆ ESBMC_DEFINE_CODE_EXPRESSION_1OP() [2/5]

ESBMC_DEFINE_CODE_EXPRESSION_1OP ( code_cpp_delete )

◆ ESBMC_DEFINE_CODE_EXPRESSION_1OP() [3/5]

ESBMC_DEFINE_CODE_EXPRESSION_1OP ( code_expression )

◆ ESBMC_DEFINE_CODE_EXPRESSION_1OP() [4/5]

ESBMC_DEFINE_CODE_EXPRESSION_1OP ( code_free )

◆ ESBMC_DEFINE_CODE_EXPRESSION_1OP() [5/5]

ESBMC_DEFINE_CODE_EXPRESSION_1OP ( code_return )

◆ ESBMC_DEFINE_FP_PREDICATE_1OP() [1/4]

ESBMC_DEFINE_FP_PREDICATE_1OP ( isfinite )

◆ ESBMC_DEFINE_FP_PREDICATE_1OP() [2/4]

ESBMC_DEFINE_FP_PREDICATE_1OP ( isinf )

◆ ESBMC_DEFINE_FP_PREDICATE_1OP() [3/4]

ESBMC_DEFINE_FP_PREDICATE_1OP ( isnan )

◆ ESBMC_DEFINE_FP_PREDICATE_1OP() [4/4]

ESBMC_DEFINE_FP_PREDICATE_1OP ( isnormal )

◆ ESBMC_DEFINE_IEEE_ARITH_2OP() [1/5]

ESBMC_DEFINE_IEEE_ARITH_2OP ( ieee_add )

◆ ESBMC_DEFINE_IEEE_ARITH_2OP() [2/5]

ESBMC_DEFINE_IEEE_ARITH_2OP ( ieee_div )

◆ ESBMC_DEFINE_IEEE_ARITH_2OP() [3/5]

ESBMC_DEFINE_IEEE_ARITH_2OP ( ieee_mul )

◆ ESBMC_DEFINE_IEEE_ARITH_2OP() [4/5]

ESBMC_DEFINE_IEEE_ARITH_2OP ( ieee_rem )

IEEE 754 remainder (SMT-LIB fp.rem, C's remainder()): x - n*y with n = rne(x/y).

Exact for every input, so the rounding mode the macro carries is ignored; it exists only to share the 2-op plumbing.

◆ ESBMC_DEFINE_IEEE_ARITH_2OP() [5/5]

ESBMC_DEFINE_IEEE_ARITH_2OP ( ieee_sub )

◆ ESBMC_DEFINE_LOGIC_2OP() [1/7]

ESBMC_DEFINE_LOGIC_2OP ( and )

◆ ESBMC_DEFINE_LOGIC_2OP() [2/7]

ESBMC_DEFINE_LOGIC_2OP ( hasattr )

◆ ESBMC_DEFINE_LOGIC_2OP() [3/7]

ESBMC_DEFINE_LOGIC_2OP ( implies )

◆ ESBMC_DEFINE_LOGIC_2OP() [4/7]

ESBMC_DEFINE_LOGIC_2OP ( isinstance )

◆ ESBMC_DEFINE_LOGIC_2OP() [5/7]

ESBMC_DEFINE_LOGIC_2OP ( isnone )

◆ ESBMC_DEFINE_LOGIC_2OP() [6/7]

ESBMC_DEFINE_LOGIC_2OP ( or )

◆ ESBMC_DEFINE_LOGIC_2OP() [7/7]

ESBMC_DEFINE_LOGIC_2OP ( xor )

◆ ESBMC_DEFINE_OBJECT_PREDICATE_1OP() [1/3]

ESBMC_DEFINE_OBJECT_PREDICATE_1OP ( deallocated_obj )

◆ ESBMC_DEFINE_OBJECT_PREDICATE_1OP() [2/3]

ESBMC_DEFINE_OBJECT_PREDICATE_1OP ( races_check )

◆ ESBMC_DEFINE_OBJECT_PREDICATE_1OP() [3/3]

ESBMC_DEFINE_OBJECT_PREDICATE_1OP ( valid_object )

◆ ESBMC_DEFINE_OBJECT_SIZE_1OP() [1/3]

ESBMC_DEFINE_OBJECT_SIZE_1OP ( capability_base )

◆ ESBMC_DEFINE_OBJECT_SIZE_1OP() [2/3]

ESBMC_DEFINE_OBJECT_SIZE_1OP ( capability_top )

◆ ESBMC_DEFINE_OBJECT_SIZE_1OP() [3/3]

ESBMC_DEFINE_OBJECT_SIZE_1OP ( dynamic_size )

◆ ESBMC_DEFINE_OVERFLOW_INT32_1OP() [1/2]

ESBMC_DEFINE_OVERFLOW_INT32_1OP ( popcount )

◆ ESBMC_DEFINE_OVERFLOW_INT32_1OP() [2/2]

ESBMC_DEFINE_OVERFLOW_INT32_1OP ( signbit )

◆ ESBMC_DEFINE_POINTER_1OP() [1/2]

ESBMC_DEFINE_POINTER_1OP ( pointer_capability )

◆ ESBMC_DEFINE_POINTER_1OP() [2/2]

ESBMC_DEFINE_POINTER_1OP ( pointer_object )

◆ ESBMC_DEFINE_RELATION2T() [1/6]

ESBMC_DEFINE_RELATION2T ( equality )

◆ ESBMC_DEFINE_RELATION2T() [2/6]

ESBMC_DEFINE_RELATION2T ( greaterthan )

◆ ESBMC_DEFINE_RELATION2T() [3/6]

ESBMC_DEFINE_RELATION2T ( greaterthanequal )

◆ ESBMC_DEFINE_RELATION2T() [4/6]

ESBMC_DEFINE_RELATION2T ( lessthan )

◆ ESBMC_DEFINE_RELATION2T() [5/6]

ESBMC_DEFINE_RELATION2T ( lessthanequal )

◆ ESBMC_DEFINE_RELATION2T() [6/6]

ESBMC_DEFINE_RELATION2T ( notequal )

◆ ESBMC_DEFINE_TYPE_ONLY() [1/3]

ESBMC_DEFINE_TYPE_ONLY ( invalid )

◆ ESBMC_DEFINE_TYPE_ONLY() [2/3]

ESBMC_DEFINE_TYPE_ONLY ( null_object )

◆ ESBMC_DEFINE_TYPE_ONLY() [3/3]

ESBMC_DEFINE_TYPE_ONLY ( unknown )

◆ irep_typedefs() [1/123]

irep_typedefs ( abs )

◆ irep_typedefs() [2/123]

irep_typedefs ( add )

◆ irep_typedefs() [3/123]

irep_typedefs ( address_of )

◆ irep_typedefs() [4/123]

irep_typedefs ( and )

◆ irep_typedefs() [5/123]

irep_typedefs ( ashr )

◆ irep_typedefs() [6/123]

irep_typedefs ( bitand )

◆ irep_typedefs() [7/123]

irep_typedefs ( bitcast )

◆ irep_typedefs() [8/123]

irep_typedefs ( bitnot )

◆ irep_typedefs() [9/123]

irep_typedefs ( bitor )

◆ irep_typedefs() [10/123]

irep_typedefs ( bitxor )

◆ irep_typedefs() [11/123]

irep_typedefs ( bswap )

◆ irep_typedefs() [12/123]

irep_typedefs ( byte_extract )

◆ irep_typedefs() [13/123]

irep_typedefs ( byte_update )

◆ irep_typedefs() [14/123]

irep_typedefs ( capability_base )

◆ irep_typedefs() [15/123]

irep_typedefs ( capability_top )

◆ irep_typedefs() [16/123]

irep_typedefs ( cmp_three_way )

◆ irep_typedefs() [17/123]

irep_typedefs ( code_asm )

◆ irep_typedefs() [18/123]

irep_typedefs ( code_assert )

◆ irep_typedefs() [19/123]

irep_typedefs ( code_assign )

◆ irep_typedefs() [20/123]

irep_typedefs ( code_assume )

◆ irep_typedefs() [21/123]

irep_typedefs ( code_block )

◆ irep_typedefs() [22/123]

irep_typedefs ( code_break )

◆ irep_typedefs() [23/123]

irep_typedefs ( code_comma )

◆ irep_typedefs() [24/123]

irep_typedefs ( code_continue )

◆ irep_typedefs() [25/123]

irep_typedefs ( code_cpp_catch )

◆ irep_typedefs() [26/123]

irep_typedefs ( code_cpp_del_array )

◆ irep_typedefs() [27/123]

irep_typedefs ( code_cpp_delete )

◆ irep_typedefs() [28/123]

irep_typedefs ( code_cpp_throw )

◆ irep_typedefs() [29/123]

irep_typedefs ( code_dead )

◆ irep_typedefs() [30/123]

irep_typedefs ( code_decl )

◆ irep_typedefs() [31/123]

irep_typedefs ( code_dowhile )

◆ irep_typedefs() [32/123]

irep_typedefs ( code_expression )

◆ irep_typedefs() [33/123]

irep_typedefs ( code_for )

◆ irep_typedefs() [34/123]

irep_typedefs ( code_free )

◆ irep_typedefs() [35/123]

irep_typedefs ( code_function_call )

◆ irep_typedefs() [36/123]

irep_typedefs ( code_goto )

◆ irep_typedefs() [37/123]

irep_typedefs ( code_ifthenelse )

◆ irep_typedefs() [38/123]

irep_typedefs ( code_label )

◆ irep_typedefs() [39/123]

irep_typedefs ( code_printf )

◆ irep_typedefs() [40/123]

irep_typedefs ( code_return )

◆ irep_typedefs() [41/123]

irep_typedefs ( code_skip )

◆ irep_typedefs() [42/123]

irep_typedefs ( code_switch )

◆ irep_typedefs() [43/123]

irep_typedefs ( code_switch_case )

◆ irep_typedefs() [44/123]

irep_typedefs ( code_while )

◆ irep_typedefs() [45/123]

irep_typedefs ( concat )

◆ irep_typedefs() [46/123]

irep_typedefs ( constant_array )

◆ irep_typedefs() [47/123]

irep_typedefs ( constant_array_of )

◆ irep_typedefs() [48/123]

irep_typedefs ( constant_bool )

◆ irep_typedefs() [49/123]

irep_typedefs ( constant_fixedbv )

◆ irep_typedefs() [50/123]

irep_typedefs ( constant_floatbv )

◆ irep_typedefs() [51/123]

irep_typedefs ( constant_int )

◆ irep_typedefs() [52/123]

irep_typedefs ( constant_string )

◆ irep_typedefs() [53/123]

irep_typedefs ( constant_struct )

◆ irep_typedefs() [54/123]

irep_typedefs ( constant_union )

◆ irep_typedefs() [55/123]

irep_typedefs ( constant_vector )

◆ irep_typedefs() [56/123]

irep_typedefs ( deallocated_obj )

◆ irep_typedefs() [57/123]

irep_typedefs ( dereference )

◆ irep_typedefs() [58/123]

irep_typedefs ( div )

◆ irep_typedefs() [59/123]

irep_typedefs ( dynamic_object )

◆ irep_typedefs() [60/123]

irep_typedefs ( dynamic_size )

◆ irep_typedefs() [61/123]

irep_typedefs ( equality )

◆ irep_typedefs() [62/123]

irep_typedefs ( exists )

◆ irep_typedefs() [63/123]

irep_typedefs ( extract )

◆ irep_typedefs() [64/123]

irep_typedefs ( forall )

◆ irep_typedefs() [65/123]

irep_typedefs ( greaterthan )

◆ irep_typedefs() [66/123]

irep_typedefs ( greaterthanequal )

◆ irep_typedefs() [67/123]

irep_typedefs ( hasattr )

◆ irep_typedefs() [68/123]

irep_typedefs ( ieee_add )

◆ irep_typedefs() [69/123]

irep_typedefs ( ieee_div )

◆ irep_typedefs() [70/123]

irep_typedefs ( ieee_fma )

◆ irep_typedefs() [71/123]

irep_typedefs ( ieee_mul )

◆ irep_typedefs() [72/123]

irep_typedefs ( ieee_rem )

◆ irep_typedefs() [73/123]

irep_typedefs ( ieee_sqrt )

◆ irep_typedefs() [74/123]

irep_typedefs ( ieee_sub )

◆ irep_typedefs() [75/123]

irep_typedefs ( if )

◆ irep_typedefs() [76/123]

irep_typedefs ( implies )

◆ irep_typedefs() [77/123]

irep_typedefs ( index )

◆ irep_typedefs() [78/123]

irep_typedefs ( invalid )

◆ irep_typedefs() [79/123]

irep_typedefs ( invalid_pointer )

◆ irep_typedefs() [80/123]

irep_typedefs ( isfinite )

◆ irep_typedefs() [81/123]

irep_typedefs ( isinf )

◆ irep_typedefs() [82/123]

irep_typedefs ( isinstance )

◆ irep_typedefs() [83/123]

irep_typedefs ( isnan )

◆ irep_typedefs() [84/123]

irep_typedefs ( isnone )

◆ irep_typedefs() [85/123]

irep_typedefs ( isnormal )

◆ irep_typedefs() [86/123]

irep_typedefs ( lessthan )

◆ irep_typedefs() [87/123]

irep_typedefs ( lessthanequal )

◆ irep_typedefs() [88/123]

irep_typedefs ( lshr )

◆ irep_typedefs() [89/123]

irep_typedefs ( member )

◆ irep_typedefs() [90/123]

irep_typedefs ( member_ref )

◆ irep_typedefs() [91/123]

irep_typedefs ( modulus )

◆ irep_typedefs() [92/123]

irep_typedefs ( mul )

◆ irep_typedefs() [93/123]

irep_typedefs ( nearbyint )

◆ irep_typedefs() [94/123]

irep_typedefs ( neg )

◆ irep_typedefs() [95/123]

irep_typedefs ( new_object )

◆ irep_typedefs() [96/123]

irep_typedefs ( not )

◆ irep_typedefs() [97/123]

irep_typedefs ( notequal )

◆ irep_typedefs() [98/123]

irep_typedefs ( null_object )

◆ irep_typedefs() [99/123]

irep_typedefs ( object_descriptor )

◆ irep_typedefs() [100/123]

irep_typedefs ( or )

◆ irep_typedefs() [101/123]

irep_typedefs ( overflow )

◆ irep_typedefs() [102/123]

irep_typedefs ( overflow_cast )

◆ irep_typedefs() [103/123]

irep_typedefs ( overflow_neg )

◆ irep_typedefs() [104/123]

irep_typedefs ( pointer_capability )

◆ irep_typedefs() [105/123]

irep_typedefs ( pointer_object )

◆ irep_typedefs() [106/123]

irep_typedefs ( pointer_offset )

◆ irep_typedefs() [107/123]

irep_typedefs ( popcount )

◆ irep_typedefs() [108/123]

irep_typedefs ( ptr_mem )

◆ irep_typedefs() [109/123]

irep_typedefs ( races_check )

◆ irep_typedefs() [110/123]

irep_typedefs ( same_object )

◆ irep_typedefs() [111/123]

irep_typedefs ( shl )

◆ irep_typedefs() [112/123]

irep_typedefs ( sideeffect )

◆ irep_typedefs() [113/123]

irep_typedefs ( sideeffect_assign )

◆ irep_typedefs() [114/123]

irep_typedefs ( signbit )

◆ irep_typedefs() [115/123]

irep_typedefs ( sizeof )

◆ irep_typedefs() [116/123]

irep_typedefs ( sub )

◆ irep_typedefs() [117/123]

irep_typedefs ( symbol )

◆ irep_typedefs() [118/123]

irep_typedefs ( typecast )

◆ irep_typedefs() [119/123]

irep_typedefs ( uninterpreted_func )

◆ irep_typedefs() [120/123]

irep_typedefs ( unknown )

◆ irep_typedefs() [121/123]

irep_typedefs ( valid_object )

◆ irep_typedefs() [122/123]

irep_typedefs ( with )

◆ irep_typedefs() [123/123]

irep_typedefs ( xor )

◆ printf_kind_from_name()

printf_kindt printf_kind_from_name ( const irep_idt & name)

Maps the textual base_name of a printf-family symbol (e.g.

"printf", "snprintf") onto a printf_kindt. Aborts on an unknown name.