45 {ID_notequal, {
u8"\u2260"}},
46 {ID_and, {
u8"\u2227"}},
47 {ID_or, {
u8"\u2228"}},
48 {ID_xor, {
u8"\u2295"}},
49 {ID_implies, {
u8"\u21d2"}},
50 {ID_le, {
u8"\u2264"}},
51 {ID_ge, {
u8"\u2265"}},
72 (sub_expr.
id() == ID_mult || sub_expr.
id() == ID_div) &&
73 (expr.
id() == ID_plus || expr.
id() == ID_minus))
78 (sub_expr.
id() == ID_equal || sub_expr.
id() == ID_notequal ||
79 sub_expr.
id() == ID_lt || sub_expr.
id() == ID_gt ||
80 sub_expr.
id() == ID_le || sub_expr.
id() == ID_ge) &&
81 (expr.
id() == ID_and || expr.
id() == ID_or))
86 (sub_expr.
id() == ID_plus || sub_expr.
id() == ID_minus ||
87 sub_expr.
id() == ID_mult || sub_expr.
id() == ID_div) &&
88 (expr.
id() == ID_equal || expr.
id() == ID_notequal || expr.
id() == ID_lt ||
89 expr.
id() == ID_gt || expr.
id() == ID_le || expr.
id() == ID_ge))
106 src.
id() == ID_equal && !src.
operands().empty() &&
109 operator_str =
u8"\u21d4";
115 operator_str = infix_map_it->second.rep;
118 for(
const auto &op : src.
operands())
123 os <<
' ' << operator_str <<
' ';
150 if(src.
id() == ID_not)
152 else if(src.
id() == ID_unary_minus)
155 return os << src.
pretty();
158 return os <<
'(' <<
format(src.
op()) <<
')';
166 auto type = src.
type().
id();
173 return os <<
"false";
175 return os << src.
pretty();
177 else if(type == ID_unsignedbv || type == ID_signedbv || type == ID_c_bool)
178 return os << *numeric_cast<mp_integer>(src);
179 else if(type == ID_integer)
181 else if(type == ID_string)
183 else if(type == ID_floatbv)
185 else if(type == ID_pointer && src.
is_zero())
188 return os << src.
pretty();
196 if(s.first != ID_type)
197 os <<
' ' << s.first <<
"=\"" << s.second.id() <<
'"';
204 for(
const auto &op : expr.
operands())
225 const auto &
id = expr.
id();
227 if(
id == ID_plus ||
id == ID_mult ||
id == ID_and ||
id == ID_or)
230 id == ID_lt ||
id == ID_gt ||
id == ID_ge ||
id == ID_le ||
231 id == ID_minus ||
id == ID_implies ||
id == ID_equal ||
id == ID_notequal)
233 else if(
id == ID_not ||
id == ID_unary_minus)
235 else if(
id == ID_constant)
237 else if(
id == ID_typecast)
241 id == ID_byte_extract_little_endian ||
id == ID_byte_extract_big_endian)
244 return os <<
id <<
'(' <<
format(byte_extract_expr.op()) <<
", " 245 <<
format(byte_extract_expr.offset()) <<
", " 246 <<
format(byte_extract_expr.type()) <<
')';
248 else if(
id == ID_byte_update_little_endian ||
id == ID_byte_update_big_endian)
251 return os <<
id <<
'(' <<
format(byte_update_expr.op()) <<
", " 252 <<
format(byte_update_expr.offset()) <<
", " 253 <<
format(byte_update_expr.value()) <<
", " 254 <<
format(byte_update_expr.type()) <<
')';
256 else if(
id == ID_member)
259 else if(
id == ID_symbol)
261 else if(
id == ID_index)
264 return os <<
format(index_expr.array()) <<
'[' <<
format(index_expr.index())
267 else if(
id == ID_type)
269 else if(
id == ID_forall)
273 else if(
id == ID_exists)
277 else if(
id == ID_let)
281 else if(
id == ID_array ||
id == ID_struct)
287 for(
const auto &op : expr.
operands())
302 return os <<
'(' <<
format(if_expr.cond()) <<
" ? " 303 <<
format(if_expr.true_case()) <<
" : " 304 <<
format(if_expr.false_case()) <<
')';
306 else if(
id == ID_code)
308 const auto &code =
to_code(expr);
309 const irep_idt &statement = code.get_statement();
311 if(statement == ID_assign)
314 else if(statement == ID_block)
const if_exprt & to_if_expr(const exprt &expr)
Cast an exprt to an if_exprt.
const std::string & id2string(const irep_idt &d)
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
const irep_idt & get_identifier() const
bool is_false() const
Return whether the expression is a constant representing false.
const irep_idt & get_value() const
bool is_true() const
Return whether the expression is a constant representing true.
typet & type()
Return the type of the expression.
A constant literal expression.
Forward depth-first search iterators These iterators' copy operations are expensive,...
const let_exprt & to_let_expr(const exprt &expr)
Cast an exprt to a let_exprt.
const byte_update_exprt & to_byte_update_expr(const exprt &expr)
const code_assignt & to_code_assign(const codet &code)
const irep_idt & id() const
Expression classes for byte-level operators.
A base class for binary expressions.
API to expression classes.
Generic base class for unary expressions.
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const quantifier_exprt & to_quantifier_expr(const exprt &expr)
Cast an exprt to a quantifier_exprt.
std::string escape(const std::string &s)
Generic escaping of strings; this is not meant to be a particular programming language.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
bool has_operands() const
Return true if there is at least one operand.
named_subt & get_named_sub()
const multi_ary_exprt & to_multi_ary_expr(const exprt &expr)
Cast an exprt to a multi_ary_exprt.
Base class for all expressions.
irep_idt get_component_name() const
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
bool is_zero() const
Return whether the expression is a constant representing 0.
const codet & to_code(const exprt &expr)
const code_blockt & to_code_block(const codet &code)
const binary_exprt & to_binary_expr(const exprt &expr)
Cast an exprt to a binary_exprt.
A base class for multi-ary expressions Associativity is not specified.
const unary_exprt & to_unary_expr(const exprt &expr)
Cast an exprt to a unary_exprt.
const byte_extract_exprt & to_byte_extract_expr(const exprt &expr)
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.