ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
expr_kinds.inc
Go to the documentation of this file.
1// Single source of truth for irep2 expression kinds.
2//
3// Includers must `#define IREP2_EXPR(kind, pretty_name)` before
4// including this file and `#undef IREP2_EXPR` after. The macro is
5// invoked once per kind in declaration order; the order matches the
6// `expr2t::expr_ids` enum exactly. Adding a new expression kind is
7// a single line here.
8//
9// Arguments:
10// kind — bare identifier (e.g. `add`). The generators
11// derive `<kind>2t`, `<kind>_id`, `is_<kind>2t`,
12// `to_<kind>2t`, `try_to_<kind>2t` from it.
13// pretty_name — string literal printed by pretty() / used by
14// irep2_bad_expr_cast for diagnostics. Most match
15// `#kind` exactly, but a few are intentionally
16// reshaped (e.g. `null_object` prints as
17// "NULL-object", `code_cpp_*` print without the
18// `code_` prefix).
19
20IREP2_EXPR(constant_int, "constant_int")
21IREP2_EXPR(constant_fixedbv, "constant_fixedbv")
22IREP2_EXPR(constant_floatbv, "constant_floatbv")
23IREP2_EXPR(constant_bool, "constant_bool")
24IREP2_EXPR(constant_string, "constant_string")
25IREP2_EXPR(constant_struct, "constant_struct")
26IREP2_EXPR(constant_union, "constant_union")
27IREP2_EXPR(constant_array, "constant_array")
28IREP2_EXPR(constant_vector, "constant_vector")
29IREP2_EXPR(constant_array_of, "constant_array_of")
30IREP2_EXPR(symbol, "symbol")
31IREP2_EXPR(typecast, "typecast")
32IREP2_EXPR(bitcast, "bitcast")
33IREP2_EXPR(nearbyint, "nearbyint")
34IREP2_EXPR(if, "if")
35IREP2_EXPR(equality, "equality")
36IREP2_EXPR(notequal, "notequal")
37IREP2_EXPR(lessthan, "lessthan")
38IREP2_EXPR(greaterthan, "greaterthan")
39IREP2_EXPR(lessthanequal, "lessthanequal")
40IREP2_EXPR(greaterthanequal, "greaterthanequal")
41IREP2_EXPR(cmp_three_way, "cmp_three_way")
42IREP2_EXPR(not, "not")
43IREP2_EXPR(and, "and")
44IREP2_EXPR(or, "or")
45IREP2_EXPR(xor, "xor")
46IREP2_EXPR(implies, "implies")
47IREP2_EXPR(bitand, "bitand")
48IREP2_EXPR(bitor, "bitor")
49IREP2_EXPR(bitxor, "bitxor")
50IREP2_EXPR(bitnot, "bitnot")
51IREP2_EXPR(lshr, "lshr")
52IREP2_EXPR(neg, "neg")
53IREP2_EXPR(abs, "abs")
54IREP2_EXPR(add, "add")
55IREP2_EXPR(sub, "sub")
56IREP2_EXPR(mul, "mul")
57IREP2_EXPR(div, "div")
58IREP2_EXPR(ieee_add, "ieee_add")
59IREP2_EXPR(ieee_sub, "ieee_sub")
60IREP2_EXPR(ieee_mul, "ieee_mul")
61IREP2_EXPR(ieee_div, "ieee_div")
62IREP2_EXPR(ieee_fma, "ieee_fma")
63IREP2_EXPR(ieee_sqrt, "ieee_sqrt")
64IREP2_EXPR(popcount, "popcount")
65IREP2_EXPR(bswap, "bswap")
66IREP2_EXPR(modulus, "modulus")
67IREP2_EXPR(shl, "shl")
68IREP2_EXPR(ashr, "ashr")
69IREP2_EXPR(dynamic_object, "dynamic_object")
70IREP2_EXPR(same_object, "same_object")
71IREP2_EXPR(pointer_offset, "pointer_offset")
72IREP2_EXPR(pointer_object, "pointer_object")
73IREP2_EXPR(pointer_capability, "pointer_capability")
74IREP2_EXPR(address_of, "address_of")
75IREP2_EXPR(byte_extract, "byte_extract")
76IREP2_EXPR(byte_update, "byte_update")
77IREP2_EXPR(with, "with")
78IREP2_EXPR(member, "member")
79IREP2_EXPR(member_ref, "member_ref")
80IREP2_EXPR(ptr_mem, "ptr_mem")
81IREP2_EXPR(index, "index")
82IREP2_EXPR(isnan, "isnan")
83IREP2_EXPR(overflow, "overflow")
84IREP2_EXPR(overflow_cast, "overflow_cast")
85IREP2_EXPR(overflow_neg, "overflow_neg")
86IREP2_EXPR(unknown, "unknown")
87IREP2_EXPR(invalid, "invalid")
88IREP2_EXPR(null_object, "NULL-object")
89IREP2_EXPR(dereference, "dereference")
90IREP2_EXPR(valid_object, "valid_object")
91IREP2_EXPR(races_check, "races_check")
92IREP2_EXPR(deallocated_obj, "deallocated_obj")
93IREP2_EXPR(dynamic_size, "dynamic_size")
94IREP2_EXPR(sideeffect, "sideeffect")
95IREP2_EXPR(code_block, "code_block")
96IREP2_EXPR(code_assign, "code_assign")
97IREP2_EXPR(code_decl, "code_decl")
98IREP2_EXPR(code_dead, "code_dead")
99IREP2_EXPR(code_printf, "code_printf")
100IREP2_EXPR(code_expression, "code_expression")
101IREP2_EXPR(code_return, "code_return")
102IREP2_EXPR(code_skip, "code_skip")
103IREP2_EXPR(code_free, "code_free")
104IREP2_EXPR(code_goto, "code_goto")
105IREP2_EXPR(object_descriptor, "object_descriptor")
106IREP2_EXPR(code_function_call, "code_function_call")
107IREP2_EXPR(code_comma, "code_comma_id")
108IREP2_EXPR(invalid_pointer, "invalid_pointer")
109IREP2_EXPR(code_asm, "code_asm")
110IREP2_EXPR(code_cpp_del_array, "cpp_del_array")
111IREP2_EXPR(code_cpp_delete, "cpp_delete")
112IREP2_EXPR(code_cpp_catch, "cpp_catch")
113IREP2_EXPR(code_cpp_throw, "cpp_throw")
114IREP2_EXPR(isinf, "isinf")
115IREP2_EXPR(isnormal, "isnormal")
116IREP2_EXPR(isfinite, "isfinite")
117IREP2_EXPR(signbit, "signbit")
118IREP2_EXPR(concat, "concat")
119IREP2_EXPR(extract, "extract")
120IREP2_EXPR(capability_base, "capability_base")
121IREP2_EXPR(capability_top, "capability_top")
122IREP2_EXPR(forall, "forall")
123IREP2_EXPR(exists, "exists")
124IREP2_EXPR(isinstance, "isinstance")
125IREP2_EXPR(hasattr, "hasattr")
126IREP2_EXPR(isnone, "isnone")
127// V.4 structured control-flow code kinds (esbmc/esbmc#4715). Appended at the
128// end so existing expr_id enum values are not renumbered.
129IREP2_EXPR(code_ifthenelse, "code_ifthenelse")
130IREP2_EXPR(code_while, "code_while")
131IREP2_EXPR(code_dowhile, "code_dowhile")
132IREP2_EXPR(code_for, "code_for")
133IREP2_EXPR(code_switch, "code_switch")
134IREP2_EXPR(code_break, "code_break")
135IREP2_EXPR(code_continue, "code_continue")
136IREP2_EXPR(code_label, "code_label")
137IREP2_EXPR(code_switch_case, "code_switch_case")
138IREP2_EXPR(code_assert, "code_assert")
139IREP2_EXPR(code_assume, "code_assume")
140// Assignment side-effects (sideeffect("assign"), "assign+", etc.) used in the
141// C frontend as expression-level assignments and compound-assignment operators.
142// Encoded as a single IREP2 kind carrying the operator string so that every
143// variant round-trips exactly without requiring one enum entry per operator.
144IREP2_EXPR(sideeffect_assign, "sideeffect_assign")
145// C++ constructor "this" placeholder: exprt("new_object") in the legacy IR.
146// Appears in temporary_object initializers; replaced by replace_new_object
147// before goto_convert processes the body.
148IREP2_EXPR(new_object, "new_object")
149// sizeof(T) carrying the measured type T as a first-class reflected field,
150// replacing the legacy sizeof-type irep attribute side channel
151// (esbmc/esbmc#5337). Folds lazily to the byte size of T via do_simplify().
152IREP2_EXPR(sizeof, "sizeof")
153// Uninterpreted-function application. Created during symbolic execution to
154// model a call to a "__ESBMC_uninterpreted_*" / "__CPROVER_uninterpreted_*"
155// function, and consumed only at SMT conversion time, where the solver's
156// native uninterpreted-function support enforces functional congruence.
157IREP2_EXPR(uninterpreted_func, "uninterpreted_func")
158
159// IEEE 754 remainder (SMT-LIB fp.rem). Appended rather than grouped with the
160// other ieee_* kinds, for the same reason as the V.4 kinds above: enum
161// position is expr2t::expr_id, so inserting mid-list renumbers every later
162// kind.
163IREP2_EXPR(ieee_rem, "ieee_rem")
@ nearbyint
Definition builtin_names.h:36
@ unknown
Definition config.h:14
static bool same_object(const expr2tc &a, const expr2tc &b)
Definition gcse.cpp:330
void dereference(goto_programt::const_targett target, expr2tc &expr, const namespacet &ns, value_setst &value_sets)
Definition goto_program_dereference.cpp:239
#define IREP2_EXPR(kind, pretty)
Definition irep2.h:734
literalt neg(literalt a)
Definition literal.h:126
div_t div(int numerator, int denominator)
int abs(int n)
void add(int64_t *A, int64_t *B, int64_t *C, int64_t a_rows, int64_t a_cols, int64_t b_rows, int64_t b_cols)
Definition umath.c:23