Go to the documentation of this file.
10 #ifndef CPROVER_UTIL_STD_EXPR_H
11 #define CPROVER_UTIL_STD_EXPR_H
61 {std::move(_op0), std::move(_op1), std::move(_op2)})
80 "ternary expression must have three operands");
139 set(ID_identifier, identifier);
144 return get(ID_identifier);
176 return get_bool(ID_C_static_lifetime);
181 return set(ID_C_static_lifetime,
true);
186 remove(ID_C_static_lifetime);
196 return set(ID_C_thread_local,
true);
201 remove(ID_C_thread_local);
208 return base.
id() == ID_symbol;
267 set(ID_identifier, identifier);
272 return get(ID_identifier);
279 return base.
id() == ID_nondet_symbol;
389 return base.
id() == ID_abs;
426 :
unary_exprt(ID_unary_minus, std::move(_op), std::move(_type))
439 return base.
id() == ID_unary_minus;
483 return base.
id() == ID_unary_plus;
550 return base.
id() == ID_sign;
591 :
expr_protectedt(_id, std::move(_type), {std::move(_lhs), std::move(_rhs)})
602 "binary expression must have two operands");
699 expr.
type().
id() == ID_bool,
700 "result of binary predicate expression should be of type bool");
734 expr_binary.op0().type() == expr_binary.op1().type(),
735 "lhs and rhs of binary relation expression should have same type");
763 return base.
id() == ID_gt;
784 return base.
id() == ID_ge;
805 return base.
id() == ID_lt;
826 return base.
id() == ID_le;
871 :
expr_protectedt(_id, std::move(_type), {std::move(_lhs), std::move(_rhs)})
972 return base.
id() == ID_plus;
1009 :
binary_exprt(std::move(_lhs), ID_minus, std::move(_rhs))
1017 return base.
id() == ID_minus;
1063 return base.
id() == ID_mult;
1100 :
binary_exprt(std::move(_lhs), ID_div, std::move(_rhs))
1132 return base.
id() == ID_div;
1171 :
binary_exprt(std::move(_lhs), ID_mod, std::move(_rhs))
1203 return base.
id() == ID_mod;
1239 :
binary_exprt(std::move(_lhs), ID_euclidean_mod, std::move(_rhs))
1271 return base.
id() == ID_euclidean_mod;
1333 return base.
id() == ID_equal;
1376 return base.
id() == ID_notequal;
1423 const auto &array_op_type = _array.
type();
1425 array_op_type.id() == ID_array || array_op_type.id() == ID_vector);
1435 const auto &array_op_type =
array().
type();
1437 array_op_type.id() == ID_array || array_op_type.id() == ID_vector);
1464 return base.
id() == ID_index;
1501 :
unary_exprt(ID_array_of, std::move(_what), std::move(_type))
1529 return base.
id() == ID_array_of;
1582 return exprt::with_source_location<array_exprt>(other);
1587 return std::move(*this).exprt::with_source_location<
array_exprt>(other);
1594 return base.
id() == ID_array;
1622 :
multi_ary_exprt(ID_array_list, std::move(_operands), std::move(_type))
1646 return base.
id() == ID_array_list;
1683 return base.
id() == ID_vector;
1711 :
unary_exprt(ID_union, std::move(_value), std::move(_type))
1718 return get(ID_component_name);
1723 set(ID_component_name, component_name);
1733 set_size_t(ID_component_number, component_number);
1740 return base.
id() == ID_union;
1785 return base.
id() == ID_empty_union;
1791 value, 0,
"Empty-union constructor must not have any operand");
1833 return base.
id() == ID_struct;
1893 return base.
id() == ID_complex;
1937 return base.
id() == ID_complex_real;
1943 expr, 1,
"real part retrieval operation must have one operand");
1982 return base.
id() == ID_complex_imag;
1988 expr, 1,
"imaginary part retrieval operation must have one operand");
2037 return base.
id() == ID_typecast;
2081 {std::move(
op0), std::move(
op1), std::move(
op2)},
2089 {std::move(
op0), std::move(
op1), std::move(
op2), std::move(
op3)},
2109 return base.
id() == ID_and;
2121 return static_cast<const and_exprt &
>(expr);
2145 return base.
id() == ID_implies;
2189 {std::move(
op0), std::move(
op1), std::move(
op2)},
2197 {std::move(
op0), std::move(
op1), std::move(
op2), std::move(
op3)},
2217 return base.
id() == ID_or;
2229 return static_cast<const or_exprt &
>(expr);
2236 return static_cast<or_exprt &
>(expr);
2253 return base.
id() == ID_xor;
2265 return static_cast<const xor_exprt &
>(expr);
2289 return base.
id() == ID_not;
2389 return base.
id() == ID_if;
2430 {_old, std::move(_where), std::move(_new_value)})
2468 return base.
id() == ID_with;
2474 value, 3,
"array/structure update must have at least 3 operands",
true);
2477 "array/structure update must have an odd number of operands");
2525 return base.
id() == ID_index_designator;
2562 set(ID_component_name, _component_name);
2567 return get(ID_component_name);
2574 return base.
id() == ID_member_designator;
2614 std::move(_designator),
2615 std::move(_new_value),
2673 return base.
id() == ID_update;
2679 value, 3,
"Array/structure update must have three operands");
2712 const exprt &_array,
2713 const exprt &_index,
2714 const exprt &_new_value):
2715 exprt(ID_array_update, _array.type())
2730 const exprt &array()
const
2740 const exprt &index()
const
2750 const exprt &new_value()
const
2756 template<>
inline bool can_cast_expr<array_update_exprt>(
const exprt &base)
2758 return base.
id()==ID_array_update;
2772 inline const array_update_exprt &to_array_update_expr(
const exprt &expr)
2775 const array_update_exprt &ret =
static_cast<const array_update_exprt &
>(expr);
2781 inline array_update_exprt &to_array_update_expr(
exprt &expr)
2784 array_update_exprt &ret =
static_cast<array_update_exprt &
>(expr);
2801 compound_type_id == ID_struct_tag || compound_type_id == ID_union_tag ||
2802 compound_type_id == ID_struct || compound_type_id == ID_union);
2811 compound_type_id == ID_struct_tag || compound_type_id == ID_union_tag ||
2812 compound_type_id == ID_struct || compound_type_id == ID_union);
2818 return get(ID_component_name);
2823 set(ID_component_name, component_name);
2860 "member expression must have one operand");
2872 return base.
id() == ID_member;
2916 return base.
id() == ID_type;
2952 return get(ID_value);
2957 set(ID_value, value);
2978 return base.
id() == ID_constant;
3037 return base.
id() == ID_nil;
3105 binding_expr, 2,
"Binding expressions must have two operands");
3117 expr.
id() == ID_forall || expr.
id() == ID_exists ||
3118 expr.
id() == ID_lambda || expr.
id() == ID_array_comprehension);
3133 expr.
id() == ID_forall || expr.
id() == ID_exists ||
3134 expr.
id() == ID_lambda || expr.
id() == ID_array_comprehension);
3252 return base.
id() == ID_let;
3310 return base.
id() == ID_cond;
3316 value.
operands().size() % 2 == 0,
"cond must have even number of operands");
3358 ID_array_comprehension,
3403 return base.
id() == ID_array_comprehension;
3468 set(ID_identifier, std::move(
id));
3480 return get(ID_component_name);
3488 return get(ID_C_class);
3495 return get(ID_C_base_name);
3503 return get(ID_identifier);
3512 "class method descriptor must have a mangled method name.");
3514 !value.
class_id().
empty(),
"class method descriptor must have a class id.");
3517 "class method descriptor must have a base method name.");
3521 "class method descriptor must have an identifier in the expected format.");
3543 return base.
id() == ID_virtual_function;
3588 return base.
id() == ID_named_term;
3619 #endif // CPROVER_UTIL_STD_EXPR_H
Operator to update elements in structs and arrays.
const exprt & array() const
const exprt & value() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
if_exprt(exprt cond, const exprt &t, exprt f)
bool can_cast_expr< symbol_exprt >(const exprt &base)
const array_comprehension_exprt & to_array_comprehension_expr(const exprt &expr)
Cast an exprt to a array_comprehension_exprt.
std::size_t get_size_t(const irep_idt &name) const
const vector_exprt & to_vector_expr(const exprt &expr)
Cast an exprt to an vector_exprt.
bool can_cast_expr< union_exprt >(const exprt &base)
const update_exprt & to_update_expr(const exprt &expr)
Cast an exprt to an update_exprt.
static exprt conditional_cast(const exprt &expr, const typet &type)
const exprt & index() const
const unary_exprt & to_unary_expr(const exprt &expr)
Cast an exprt to a unary_exprt.
A base class for multi-ary expressions Associativity is not specified.
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
#define DATA_CHECK(vm, condition, message)
This macro takes a condition which denotes a well-formedness criterion on goto programs,...
let_exprt(symbol_exprt symbol, exprt value, const exprt &where)
convenience constructor for the case of a single binding
bool can_cast_expr< cond_exprt >(const exprt &base)
member_exprt(exprt op, const irep_idt &component_name, typet _type)
bool can_cast_expr< array_list_exprt >(const exprt &base)
bool can_cast_expr< mod_exprt >(const exprt &base)
const exprt & where() const
if_exprt(exprt cond, exprt t, exprt f, typet type)
member_designatort(const irep_idt &_component_name)
const div_exprt & to_div_expr(const exprt &expr)
Cast an exprt to a div_exprt.
static void validate(const exprt &expr, const namespacet &, const validation_modet vm=validation_modet::INVARIANT)
bool can_cast_expr< index_designatort >(const exprt &base)
const ternary_exprt & to_ternary_expr(const exprt &expr)
Cast an exprt to a ternary_exprt.
const irep_idt & mangled_method_name() const
The method name after mangling it by combining it with the descriptor.
and_exprt(exprt op0, exprt op1, exprt op2, exprt op3)
array_list_exprt(operandst _operands, array_typet _type)
bool can_cast_expr< named_term_exprt >(const exprt &base)
const array_exprt & to_array_expr(const exprt &expr)
Cast an exprt to an array_exprt.
Expression to hold a nondeterministic choice.
and_exprt(exprt::operandst _operands)
bool can_cast_expr< complex_imag_exprt >(const exprt &base)
const irep_idt & get_identifier() const
const euclidean_mod_exprt & to_euclidean_mod_expr(const exprt &expr)
Cast an exprt to a euclidean_mod_exprt.
bool can_cast_expr< greater_than_or_equal_exprt >(const exprt &base)
const exprt & rhs() const
const exprt & real() const
unary_minus_exprt(exprt _op, typet _type)
const type_exprt & to_type_expr(const exprt &expr)
Cast an exprt to an type_exprt.
multi_ary_exprt(exprt _lhs, const irep_idt &_id, exprt _rhs, typet _type)
bool can_cast_expr< not_exprt >(const exprt &base)
The type of an expression, extends irept.
static void validate(const exprt &expr, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
An expression with three operands.
mult_exprt(exprt _lhs, exprt _rhs)
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
const if_exprt & to_if_expr(const exprt &expr)
Cast an exprt to an if_exprt.
static void validate(const exprt &expr, const namespacet &, const validation_modet vm=validation_modet::INVARIANT)
const exprt & divisor() const
The divisor of a division is the number the dividend is being divided by.
bool can_cast_expr< sign_exprt >(const exprt &base)
const exprt & divisor() const
The divisor of a division is the number the dividend is being divided by.
bool can_cast_expr< unary_exprt >(const exprt &base)
const exprt & true_case() const
The trinary if-then-else operator.
static symbol_exprt typeless(const irep_idt &id)
Generate a symbol_exprt without a proper type.
div_exprt(exprt _lhs, exprt _rhs)
void validate_operands(const exprt &value, exprt::operandst::size_type number, const char *message, bool allow_more=false)
plus_exprt(exprt _lhs, exprt _rhs)
binary_predicate_exprt(exprt _op0, const irep_idt &_id, exprt _op1)
Real part of the expression describing a complex number.
symbol_exprt & symbol()
convenience accessor for the symbol of a single binding
Union constructor from single element.
exprt disjunction(const exprt::operandst &)
1) generates a disjunction for two or more operands 2) for one operand, returns the operand 3) return...
greater_than_or_equal_exprt(exprt _lhs, exprt _rhs)
const array_of_exprt & to_array_of_expr(const exprt &expr)
Cast an exprt to an array_of_exprt.
const type_with_subtypet & to_type_with_subtype(const typet &type)
The plus expression Associativity is not specified.
less_than_or_equal_exprt(exprt _lhs, exprt _rhs)
bool can_cast_expr< xor_exprt >(const exprt &base)
static void validate(const exprt &expr, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
bool can_cast_expr< unary_minus_exprt >(const exprt &base)
Base class for all expressions.
class_method_descriptor_exprt(typet _type, irep_idt mangled_method_name, irep_idt class_id, irep_idt base_method_name)
const exprt & op1() const =delete
const complex_exprt & to_complex_expr(const exprt &expr)
Cast an exprt to a complex_exprt.
Generic base class for unary expressions.
array_exprt(operandst _operands, array_typet _type)
index_exprt(exprt _array, exprt _index, typet _type)
void clear_static_lifetime()
A base class for binary expressions.
const union_exprt & to_union_expr(const exprt &expr)
Cast an exprt to a union_exprt.
greater_than_exprt(exprt _lhs, exprt _rhs)
irep_idt get_component_name() const
Complex numbers made of pair of given subtype.
or_exprt(exprt op0, exprt op1, exprt op2, exprt op3)
Sign of an expression Predicate is true if _op is negative, false otherwise.
bool can_cast_expr< binary_exprt >(const exprt &base)
const exprt::operandst & designator() const
const array_typet & type() const
predicate_exprt(const irep_idt &_id)
const exprt & old() const
static void validate(const exprt &, validation_modet)
const symbol_exprt & arg() const
cond_exprt(operandst _operands, typet _type)
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
bool can_cast_expr< minus_exprt >(const exprt &base)
const array_list_exprt & to_array_list_expr(const exprt &expr)
index_designatort(exprt _index)
Vector constructor from list of elements.
size_t operator()(const ::symbol_exprt &sym)
index_exprt(const exprt &_array, exprt _index)
Expression that introduces a new symbol that is equal to the operand.
const complex_typet & to_complex_type(const typet &type)
Cast a typet to a complex_typet.
Expression to hold a symbol (variable)
bool can_cast_expr< array_exprt >(const exprt &base)
void validate_expr(const symbol_exprt &value)
empty_union_exprt(typet _type)
bool can_cast_expr< member_exprt >(const exprt &base)
minus_exprt(exprt _lhs, exprt _rhs)
std::size_t get_component_number() const
const array_typet & type() const
const minus_exprt & to_minus_expr(const exprt &expr)
Cast an exprt to a minus_exprt.
exprt & dividend()
The dividend of a division is the number that is being divided.
bool can_cast_expr< equal_exprt >(const exprt &base)
An expression denoting infinity.
void add(exprt index, exprt value)
add an index/value pair
bool can_cast_expr< implies_exprt >(const exprt &base)
const exprt & op3() const =delete
void set_component_name(const irep_idt &component_name)
const irep_idt & get(const irep_idt &name) const
array_exprt && with_source_location(const exprt &other) &&
const exprt & op3() const =delete
const unary_plus_exprt & to_unary_plus_expr(const exprt &expr)
Cast an exprt to a unary_plus_exprt.
const complex_real_exprt & to_complex_real_expr(const exprt &expr)
Cast an exprt to a complex_real_exprt.
const binary_exprt & to_binary_expr(const exprt &expr)
Cast an exprt to a binary_exprt.
Boute's Euclidean definition of Modulo – to match SMT-LIB2.
An expression describing a method on a class.
Struct constructor from list of elements.
const binding_exprt::variablest & variables() const
convenience accessor for binding().variables()
union_exprt(const irep_idt &_component_name, exprt _value, typet _type)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const nondet_symbol_exprt & to_nondet_symbol_expr(const exprt &expr)
Cast an exprt to a nondet_symbol_exprt.
binding_exprt::variablest & variables()
convenience accessor for binding().variables()
const irep_idt & get_identifier() const
A unique identifier of the combination of class and method overload to which this expression refers.
typet & type()
Return the type of the expression.
exprt & value()
convenience accessor for the value of a single binding
or_exprt(exprt::operandst _operands)
An expression without operands.
bool can_cast_expr< let_exprt >(const exprt &base)
bool can_cast_expr< and_exprt >(const exprt &base)
std::size_t get_component_number() const
const array_typet & type() const
const exprt & where() const
plus_exprt(exprt _lhs, exprt _rhs, typet _type)
Binary greater than operator expression.
and_exprt(exprt op0, exprt op1, exprt op2)
const cond_exprt & to_cond_expr(const exprt &expr)
Cast an exprt to a cond_exprt.
with_exprt(const exprt &_old, exprt _where, exprt _new_value)
xor_exprt(exprt _op0, exprt _op1)
notequal_exprt(exprt _lhs, exprt _rhs)
const T & as_const(T &value)
Return a reference to the same object but ensures the type is const.
const exprt & value() const
convenience accessor for the value of a single binding
bool can_cast_expr< abs_exprt >(const exprt &base)
const mod_exprt & to_mod_expr(const exprt &expr)
Cast an exprt to a mod_exprt.
complex_real_exprt(const exprt &op)
update_exprt(const exprt &_old, exprt _designator, exprt _new_value)
and_exprt(exprt op0, exprt op1)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
const irep_idt & base_method_name() const
The name of the method to which this expression is applied as would be seen in the source code.
const mult_exprt & to_mult_expr(const exprt &expr)
Cast an exprt to a mult_exprt.
array_comprehension_exprt(symbol_exprt arg, exprt body, array_typet _type)
const std::string & id2string(const irep_idt &d)
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
void set_static_lifetime()
const irep_idt & get_name() const
symbol_exprt(const irep_idt &identifier, typet type)
const exprt & compound() const
ternary_exprt(const irep_idt &_id, exprt _op0, exprt _op1, exprt _op2, typet _type)
A base class for expressions that are predicates, i.e., Boolean-typed.
const exprt & op1() const
void set(const irep_idt &name, const irep_idt &value)
bool can_cast_expr< plus_exprt >(const exprt &base)
const empty_union_exprt & to_empty_union_expr(const exprt &expr)
Cast an exprt to an empty_union_exprt.
const exprt & new_value() const
const exprt & struct_op() const
const xor_exprt & to_xor_expr(const exprt &expr)
Cast an exprt to a xor_exprt.
A base class for expressions that are predicates, i.e., Boolean-typed, and that take exactly two argu...
#define PRECONDITION(CONDITION)
operandst & operands()=delete
remove all operand methods
bool can_cast_expr< array_of_exprt >(const exprt &base)
const irep_idt & get_identifier() const
Array constructor from single element.
named_term_exprt(symbol_exprt symbol, exprt value)
void set_identifier(const irep_idt &identifier)
const exprt & index() const
exprt conjunction(const exprt::operandst &)
1) generates a conjunction for two or more operands 2) for one operand, returns the operand 3) return...
bool is_thread_local() const
const let_exprt & to_let_expr(const exprt &expr)
Cast an exprt to a let_exprt.
bool can_cast_expr< notequal_exprt >(const exprt &base)
const plus_exprt & to_plus_expr(const exprt &expr)
Cast an exprt to a plus_exprt.
void add_case(const exprt &condition, const exprt &value)
adds a case to a cond expression
bool can_cast_expr< nil_exprt >(const exprt &base)
const exprt & body() const
Binary greater than or equal operator expression.
const notequal_exprt & to_notequal_expr(const exprt &expr)
Cast an exprt to an notequal_exprt.
Binary multiplication Associativity is not specified.
std::vector< symbol_exprt > variablest
const exprt & old() const
const unary_minus_exprt & to_unary_minus_expr(const exprt &expr)
Cast an exprt to a unary_minus_exprt.
bool can_cast_expr< less_than_or_equal_exprt >(const exprt &base)
mod_exprt(exprt _lhs, exprt _rhs)
nondet_symbol_exprt(irep_idt identifier, typet type, source_locationt location)
The unary minus expression.
const exprt & op3() const =delete
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const variablest & variables() const
static void validate(const exprt &expr, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
Check that the member expression has the right number of operands, refers to a component that exists ...
struct_exprt(operandst _operands, typet _type)
const irep_idt & id() const
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
const binding_exprt & binding() const
Union constructor to support unions without any member (a GCC/Clang feature).
A base class for variable bindings (quantifiers, let, lambda)
bool can_cast_expr< div_exprt >(const exprt &base)
std::vector< exprt > operandst
Complex constructor from a pair of numbers.
The Boolean constant false.
const operandst & values() const
vector_exprt(operandst _operands, vector_typet _type)
The unary plus expression.
multi_ary_exprt(const irep_idt &_id, operandst _operands, typet _type)
const exprt & cond() const
exprt & dividend()
The dividend of a division is the number that is being divided.
static void validate(const exprt &expr, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
let_exprt(binding_exprt::variablest variables, operandst values, const exprt &where)
void set_size_t(const irep_idt &name, const std::size_t value)
const exprt & dividend() const
The dividend of a division is the number that is being divided.
bool can_cast_expr< less_than_exprt >(const exprt &base)
const exprt & imag() const
const complex_imag_exprt & to_complex_imag_expr(const exprt &expr)
Cast an exprt to a complex_imag_exprt.
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
const array_typet & type() const
exprt & divisor()
The divisor of a division is the number the dividend is being divided by.
binary_relation_exprt(exprt _lhs, const irep_idt &_id, exprt _rhs)
unary_exprt(const irep_idt &_id, exprt _op, typet _type)
exprt & dividend()
The dividend of a division is the number that is being divided.
const with_exprt & to_with_expr(const exprt &expr)
Cast an exprt to a with_exprt.
Operator to update elements in structs and arrays.
const exprt & op0() const =delete
exprt::operandst & designator()
euclidean_mod_exprt(exprt _lhs, exprt _rhs)
static void validate(const exprt &expr, const namespacet &, const validation_modet vm=validation_modet::INVARIANT)
const exprt & op0() const
unary_plus_exprt(exprt op)
dstring_hash irep_id_hash
const or_exprt & to_or_expr(const exprt &expr)
Cast an exprt to a or_exprt.
bool can_cast_expr< index_exprt >(const exprt &base)
unary_exprt(const irep_idt &_id, const exprt &_op)
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
irep_idt get_component_name() const
unary_minus_exprt(exprt _op)
bool can_cast_expr< euclidean_mod_exprt >(const exprt &base)
Extract member of struct or union.
const exprt & dividend() const
The dividend of a division is the number that is being divided.
exprt & divisor()
The divisor of a division is the number the dividend is being divided by.
bool can_cast_expr< binary_relation_exprt >(const exprt &base)
equal_exprt(exprt _lhs, exprt _rhs)
Expression to hold a symbol (variable) with extra accessors to ID_c_static_lifetime and ID_C_thread_l...
bool can_cast_expr< complex_real_exprt >(const exprt &base)
An expression denoting a type.
bool can_cast_expr< array_comprehension_exprt >(const exprt &base)
plus_exprt(operandst _operands, typet _type)
this is a parametric version of an if-expression: it returns the value of the first case (using the o...
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
infinity_exprt(typet _type)
binding_exprt(irep_idt _id, const variablest &_variables, exprt _where, typet _type)
construct the binding expression
bool can_cast_expr< or_exprt >(const exprt &base)
array_exprt & with_source_location(const exprt &other) &
void copy_to_operands(const exprt &expr)=delete
decorated_symbol_exprt(const irep_idt &identifier, typet type)
const sign_exprt & to_sign_expr(const exprt &expr)
Cast an exprt to a sign_exprt.
const not_exprt & to_not_expr(const exprt &expr)
Cast an exprt to an not_exprt.
bool can_cast_expr< class_method_descriptor_exprt >(const exprt &base)
const class_method_descriptor_exprt & to_class_method_descriptor_expr(const exprt &expr)
Cast an exprt to a class_method_descriptor_exprt.
bool value_is_zero_string() const
const implies_exprt & to_implies_expr(const exprt &expr)
Cast an exprt to a implies_exprt.
member_exprt(exprt op, const struct_typet::componentt &c)
const exprt & op2() const =delete
bool can_cast_expr< type_exprt >(const exprt &base)
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
const exprt & false_case() const
Binary less than operator expression.
binary_exprt(exprt _lhs, const irep_idt &_id, exprt _rhs, typet _type)
A base class for relations, i.e., binary predicates whose two operands have the same type.
typecast_exprt(exprt op, typet _type)
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
exprt instantiate(const exprt::operandst &) const
substitute free occurrences of the variables in where() by the given values
Templated functions to cast to specific exprt-derived classes.
const exprt & op1() const =delete
Imaginary part of the expression describing a complex number.
bool can_cast_expr< nondet_symbol_exprt >(const exprt &base)
nullary_exprt(const irep_idt &_id, typet _type)
const equal_exprt & to_equal_expr(const exprt &expr)
Cast an exprt to an equal_exprt.
void add_to_operands(const exprt &expr)
Add the given argument to the end of exprt's operands.
const exprt & lhs() const
static void validate(const exprt &expr, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
binary_exprt(const exprt &_lhs, const irep_idt &_id, exprt _rhs)
void clear_thread_local()
static void check(const exprt &expr, const validation_modet vm=validation_modet::INVARIANT)
exprt & divisor()
The divisor of a division is the number the dividend is being divided by.
const irep_idt & class_id() const
Unique identifier in the symbol table, of the compile time type of the class which this expression is...
or_exprt(exprt op0, exprt op1, exprt op2)
const exprt & op2() const
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
bool can_cast_expr< typecast_exprt >(const exprt &base)
bool can_cast_expr< vector_exprt >(const exprt &base)
irep_idt get_component_name() const
complex_exprt(exprt _real, exprt _imag, complex_typet _type)
const irept & get_nil_irep()
const exprt & where() const
convenience accessor for binding().where()
bool can_cast_expr< if_exprt >(const exprt &base)
const exprt & what() const
exprt & component(const irep_idt &name, const namespacet &ns)
Array constructor from a list of index-element pairs Operands are index/value pairs,...
constant_exprt(const irep_idt &_value, typet _type)
bool can_cast_expr< constant_exprt >(const exprt &base)
bool is_static_lifetime() const
Binary less than or equal operator expression.
bool can_cast_expr< complex_exprt >(const exprt &base)
or_exprt(exprt op0, exprt op1)
const named_term_exprt & to_named_term_expr(const exprt &expr)
Cast an exprt to a named_term_exprt.
const exprt & op2() const =delete
void remove(const irep_idt &name)
source_locationt & add_source_location()
Semantic type conversion.
bool can_cast_expr< unary_plus_exprt >(const exprt &base)
unary_predicate_exprt(const irep_idt &_id, exprt _op)
static void validate(const exprt &expr, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
complex_imag_exprt(const exprt &op)
Expression to define a mapping from an argument (index) to elements.
The Boolean constant true.
A constant literal expression.
const exprt & op2() const =delete
const exprt & op3() const =delete
implies_exprt(exprt op0, exprt op1)
bool can_cast_expr< struct_exprt >(const exprt &base)
const symbol_exprt & symbol() const
bool can_cast_expr< greater_than_exprt >(const exprt &base)
const multi_ary_exprt & to_multi_ary_expr(const exprt &expr)
Cast an exprt to a multi_ary_exprt.
const binding_exprt & to_binding_expr(const exprt &expr)
Cast an exprt to a binding_exprt.
exprt & where()
convenience accessor for binding().where()
binding_exprt & binding()
multi_ary_exprt(const exprt &_lhs, const irep_idt &_id, exprt _rhs)
void set_component_number(std::size_t component_number)
const binary_relation_exprt & to_binary_relation_expr(const exprt &expr)
Cast an exprt to a binary_relation_exprt.
void set_value(const irep_idt &value)
const irep_idt & get_value() const
const symbol_exprt & symbol() const
convenience accessor for the symbol of a single binding
array_of_exprt(exprt _what, array_typet _type)
const member_designatort & to_member_designator(const exprt &expr)
Cast an exprt to an member_designatort.
Array constructor from list of elements.
bool can_cast_expr< with_exprt >(const exprt &base)
void set_component_name(const irep_idt &component_name)
A base class for expressions that are predicates, i.e., Boolean-typed, and that take exactly one argu...
void set_identifier(const irep_idt &identifier)
bool can_cast_expr< empty_union_exprt >(const exprt &base)
const exprt & new_value() const
less_than_exprt(exprt _lhs, exprt _rhs)
const exprt & dividend() const
The dividend of a division is the number that is being divided.
bool get_bool(const irep_idt &name) const
const and_exprt & to_and_expr(const exprt &expr)
Cast an exprt to a and_exprt.
const exprt & divisor() const
The divisor of a division is the number the dividend is being divided by.
Base class for all expressions.
const struct_exprt & to_struct_expr(const exprt &expr)
Cast an exprt to a struct_exprt.
bool can_cast_expr< member_designatort >(const exprt &base)
const abs_exprt & to_abs_expr(const exprt &expr)
Cast an exprt to a abs_exprt.
Modulo defined as lhs-(rhs * truncate(lhs/rhs)).
bool can_cast_expr< update_exprt >(const exprt &base)
const index_designatort & to_index_designator(const exprt &expr)
Cast an exprt to an index_designatort.
bool can_cast_expr< mult_exprt >(const exprt &base)
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
nondet_symbol_exprt(const irep_idt &identifier, typet type)
const exprt & op3() const