57 for(natural_loopst::loop_mapt::const_iterator
62 assert(!l_it->second.empty());
72 it=l_it->second.begin();
73 it!=l_it->second.end();
77 if((*it)->get_target()==loop_start &&
78 (*it)->location_number>loop_end->location_number)
82 if(!
loop_map.insert(std::make_pair(loop_start, loop_end)).second)
94 if(instruction.is_dead())
96 dead_map[instruction.dead_symbol().get_identifier()] =
97 instruction.location_number;
108 if(instruction.is_assign())
110 const exprt &l = instruction.assign_lhs();
111 const exprt &
r = instruction.assign_rhs();
115 r.id() == ID_side_effect &&
121 else if(l.
type().
id()==ID_pointer &&
122 l.
type().
get(ID_C_typedef)==
"va_list" &&
124 r.id()==ID_typecast &&
141 if(target->type!=
ASSERT &&
142 !target->source_location.get_comment().empty())
145 dest.
statements().back().add_source_location().set_comment(
146 target->source_location.get_comment());
150 if(target->is_target() && !target->is_goto())
156 upper_bound->location_number > loop_entry->second->location_number))
173 dest.
add(target->get_function_call());
177 dest.
add(target->get_other());
192 dest.
statements().back().add_source_location().set_comment(
193 target->source_location.get_comment());
208 dest.
statements().back().add_source_location().set_comment(
"END_THREAD");
219 dest.
add(std::move(f));
246 if(target->is_target())
248 std::stringstream label;
253 latest_block->
add(std::move(l));
258 for(goto_programt::instructiont::labelst::const_iterator
259 it=target->labels.begin();
260 it!=target->labels.end();
275 latest_block->
add(std::move(l));
280 if(latest_block!=&dest)
289 const code_assignt a{target->assign_lhs(), target->assign_rhs()};
304 const exprt this_va_list_expr = target->assign_lhs();
307 if(
r.id()==ID_constant &&
312 {this_va_list_expr});
314 dest.
add(std::move(f));
317 r.id() == ID_side_effect &&
325 dest.
add(std::move(f));
327 else if(
r.id() == ID_plus)
331 {this_va_list_expr});
345 if(next!=upper_bound &&
348 const exprt &n_r = next->assign_rhs();
350 n_r.
id() == ID_dereference &&
353 f.lhs() = next->assign_lhs();
355 type_of.arguments().push_back(f.lhs());
356 f.arguments().push_back(type_of);
358 dest.
add(std::move(f));
364 assert(
r.find(ID_C_va_arg_type).is_not_nil());
365 const typet &va_arg_type=
366 static_cast<typet const&
>(
r.find(ID_C_va_arg_type));
372 type_of.arguments().push_back(deref);
373 f.arguments().push_back(type_of);
377 dest.
add(std::move(void_f));
383 {this_va_list_expr,
r});
385 dest.
add(std::move(f));
395 if(assign.
rhs().
id()==ID_array)
420 target->return_value().id() != ID_side_effect ||
432 while(next!=upper_bound && next->is_dead() && !next->is_target())
435 if(next!=upper_bound &&
459 upper_bound->location_number > entry->second);
463 if(next!=upper_bound &&
465 !next->is_target() &&
466 (next->is_assign() || next->is_function_call()))
469 next->is_assign() ? next->assign_lhs() : next->get_function_call().lhs();
473 if(next->is_assign())
498 dest.
add(std::move(d));
510 assert(loop_end->is_goto() && loop_end->is_backwards_goto());
519 for( ; target!=loop_end; ++target)
526 dest.
add(std::move(d));
535 assert(target->is_goto());
537 assert(target->targets.size()==1);
543 upper_bound->location_number > loop_entry->second->location_number))
545 else if(!target->guard.is_true())
558 assert(loop_end->is_goto() && loop_end->is_backwards_goto());
570 if(target->get_target()==after_loop)
575 else if(target->guard.is_true())
586 for(++target; target!=loop_end; ++target)
592 if(loop_end->guard.is_false())
596 else if(!loop_end->guard.is_true())
606 if(w.body().has_operands() &&
610 w.body().operands().pop_back();
611 increment.
id(ID_side_effect);
619 else if(w.body().has_operands() &&
629 w.body().operands().pop_back();
638 dest.
add(std::move(w));
646 const exprt &switch_var,
652 std::set<goto_programt::const_targett> unique_targets;
656 cases_it!=upper_bound && cases_it!=first_target;
659 if(cases_it->is_goto() &&
660 !cases_it->is_backwards_goto() &&
661 cases_it->guard.is_true())
663 default_target=cases_it->get_target();
666 first_target->location_number > default_target->location_number)
667 first_target=default_target;
669 last_target->location_number < default_target->location_number)
670 last_target=default_target;
672 cases.push_back(
caset(
677 unique_targets.insert(default_target);
682 else if(cases_it->is_goto() &&
683 !cases_it->is_backwards_goto() &&
684 (cases_it->guard.id()==ID_equal ||
685 cases_it->guard.id()==ID_or))
688 if(cases_it->guard.id()==ID_equal)
689 eqs.push_back(cases_it->guard);
691 eqs=cases_it->guard.operands();
695 for(exprt::operandst::const_reverse_iterator
697 e_it!=(exprt::operandst::const_reverse_iterator)eqs.rend();
700 if(e_it->id()!=ID_equal ||
705 cases.push_back(
caset(
709 cases_it->get_target()));
710 assert(cases.back().value.is_not_nil());
713 first_target->location_number>
714 cases.back().case_start->location_number)
715 first_target=cases.back().case_start;
717 last_target->location_number<
718 cases.back().case_start->location_number)
719 last_target=cases.back().case_start;
721 unique_targets.insert(cases.back().case_start);
730 if(unique_targets.size()<3)
734 if(cases_it==upper_bound ||
736 upper_bound->location_number < last_target->location_number) ||
738 last_target->location_number > default_target->location_number) ||
739 target->get_target()==default_target)
749 std::set<unsigned> &processed_locations)
751 std::set<goto_programt::const_targett> targets_done;
753 for(cases_listt::iterator it=cases.begin();
759 if(!targets_done.insert(it->case_start).second)
766 case_end!=upper_bound;
769 const auto &case_end_node = dominators.
get_node(case_end);
776 if(case_end==it->case_start)
783 if(!dominators.
dominates(it->case_start, case_end_node))
786 if(!processed_locations.insert(case_end->location_number).second)
789 it->case_last=case_end;
801 for(cases_listt::const_iterator it=cases.begin();
810 cases_listt::const_iterator last=--cases.end();
811 if(last->case_start==default_target &&
826 next_case == default_target &&
827 (!it->case_last->is_goto() ||
828 (it->case_last->get_condition().is_true() &&
829 it->case_last->get_target() == default_target)))
838 if(it->case_last->is_goto() &&
839 it->case_last->guard.is_true() &&
840 it->case_last->get_target()==default_target)
844 if(!it->case_last->is_goto())
859 exprt eq_cand=target->guard;
860 if(eq_cand.
id()==ID_or)
863 if(target->is_backwards_goto() ||
864 eq_cand.
id()!=ID_equal ||
896 if(cases_start==target)
904 for(target=cases_start; target!=first_target; ++target)
907 std::set<unsigned> processed_locations;
926 for(cases_listt::const_iterator it=cases.begin();
930 it->case_last->location_number > max_target->location_number)
931 max_target=it->case_last;
933 std::map<goto_programt::const_targett, unsigned> targets_done;
938 for(cases_listt::const_iterator it=cases.begin();
944 if(it->value.is_nil())
947 csc.case_op()=it->value;
951 if(targets_done.find(it->case_start)!=targets_done.end())
953 assert(it->case_selector==orig_target ||
954 !it->case_selector->is_target());
962 csc.code().swap(cscp->
code());
969 if(it->case_selector!=orig_target)
973 target=it->case_start;
980 if(it->case_start!=(--cases.end())->case_start)
994 for( ; target!=after_last; ++target)
999 targets_done[it->case_start]=s.
body().
operands().size();
1009 if(processed_locations.find(it->location_number)==
1010 processed_locations.end())
1019 dest.
add(std::move(s));
1032 bool has_else=
false;
1034 if(!target->is_backwards_goto())
1041 if(before_else==target)
1048 before_else->is_goto() &&
1049 before_else->get_target()->location_number > end_if->location_number &&
1050 before_else->guard.is_true() &&
1052 upper_bound->location_number>=
1053 before_else->get_target()->location_number);
1056 end_if=before_else->get_target();
1060 if(target->is_backwards_goto() ||
1062 upper_bound->location_number < end_if->location_number))
1079 for(++target; target!=before_else; ++target)
1085 for(++target; target!=end_if; ++target)
1091 for(++target; target!=end_if; ++target)
1096 dest.
add(std::move(i));
1119 if(target->get_target()==next)
1128 if(target->get_target()==loop_end &&
1139 dest.
add(std::move(i));
1153 if(target->get_target()==after_loop)
1163 dest.
add(std::move(i));
1178 if(target->get_target()==next)
1188 std::stringstream label;
1190 for(goto_programt::instructiont::labelst::const_iterator
1191 it=target->get_target()->labels.begin();
1192 it!=target->get_target()->labels.end();
1206 if(label.str().empty())
1207 label <<
CPROVER_PREFIX "DUMP_L" << target->get_target()->target_number;
1221 dest.
add(std::move(i));
1231 assert(target->is_start_thread());
1234 assert(thread_start->location_number > target->location_number);
1245 if(!next->is_goto())
1249 assert(this_end->is_end_thread());
1250 assert(thread_start->location_number > this_end->location_number);
1255 for(goto_programt::instructiont::labelst::const_iterator
1256 it=target->labels.begin();
1257 it!=target->labels.end();
1269 dest.
add(std::move(b));
1280 assert(next->is_goto() && next->guard.is_true());
1281 assert(!next->is_backwards_goto());
1282 assert(thread_start->location_number < next->get_target()->location_number);
1284 ++after_thread_start;
1288 assert(thread_start->location_number < thread_end->location_number);
1289 assert(thread_end->is_end_thread());
1292 thread_end->location_number < upper_bound->location_number);
1298 thread_start->is_function_call() &&
1299 thread_start->call_arguments().size() == 1 &&
1300 after_thread_start == thread_end)
1316 for( ; thread_start!=thread_end; ++thread_start)
1320 for(goto_programt::instructiont::labelst::const_iterator
1321 it=target->labels.begin();
1322 it!=target->labels.end();
1334 dest.
add(std::move(b));
1359 if(type.
id() == ID_struct_tag || type.
id() == ID_union_tag)
1376 else if(type.
id()==ID_c_enum_tag)
1385 assert(!identifier.
empty());
1388 else if(type.
id()==ID_pointer ||
1389 type.
id()==ID_array)
1402 code.
op1().
id()==ID_side_effect &&
1421 if(!typedef_str.
empty() &&
1434 call.
lhs().
id()==ID_typecast)
1442 if(op.id() == ID_code)
1450 if(statement==ID_label)
1455 assert(!label.
empty());
1463 else if(statement==ID_block)
1465 else if(statement==ID_ifthenelse)
1467 else if(statement==ID_dowhile)
1478 code=do_while.
body();
1483 const exprt &
function,
1486 if(
function.
id()!=ID_symbol)
1499 if(parameters.size()==arguments.size())
1501 code_typet::parameterst::const_iterator it=parameters.begin();
1502 for(
auto &argument : arguments)
1505 argument.type().id() == ID_union ||
1506 argument.type().id() == ID_union_tag)
1508 argument.type() = it->type();
1524 operands.size()>1 && i<operands.size();
1527 exprt::operandst::iterator it=operands.begin()+i;
1530 it->source_location().get_comment().
empty())
1535 bool has_decl=
false;
1545 operands.insert(operands.begin()+i+1,
1546 it->operands().begin(), it->operands().end());
1547 operands.erase(operands.begin()+i);
1557 if(operands.empty() && parent_stmt!=ID_nil)
1559 else if(operands.size()==1 &&
1560 parent_stmt!=ID_nil &&
1571 type.
remove(ID_C_constant);
1573 if(type.
id() == ID_struct_tag || type.
id() == ID_union_tag)
1582 "Symbol "+
id2string(identifier)+
" should be a type");
1586 else if(type.
id()==ID_array)
1588 else if(type.
id()==ID_struct ||
1589 type.
id()==ID_union)
1594 for(struct_union_typet::componentst::iterator
1600 else if(type.
id() == ID_c_bit_field)
1618 if(expr.
is_nil() ||
to_code(expr).get_statement() != ID_block)
1624 block.
statements().back().get_statement() != ID_label)
1705 code =
code_blockt({i_t_e, then_label, else_label});
1738 (expr.
id()==ID_address_of || expr.
id()==ID_member))
1743 else if(!no_typecast &&
1744 (expr.
id()==ID_union || expr.
id()==ID_struct ||
1745 expr.
id()==ID_array || expr.
id()==ID_vector))
1758 expr.
id() == ID_union && expr.
type().
id() != ID_union &&
1759 expr.
type().
id() != ID_union_tag)
1765 if(expr.
id()==ID_typecast &&
1769 if(expr.
id()==ID_union ||
1770 expr.
id()==ID_struct)
1776 expr.
type().
id() == ID_struct_tag || expr.
type().
id() == ID_union_tag,
1777 "union/struct expressions should have a tag type");
1785 if(!typedef_str.
empty() &&
1789 else if(expr.
id()==ID_array ||
1790 expr.
id()==ID_vector)
1793 expr.
get_bool(ID_C_string_constant))
1802 if(!typedef_str.
empty() &&
1806 else if(expr.
id()==ID_side_effect)
1810 if(statement==ID_nondet)
1817 for(symbol_tablet::symbolst::const_iterator
1822 if(it->second.type.id()!=ID_code)
1844 suffix=expr.
type().
get(ID_C_c_type);
1851 if(base_name.
empty())
1862 symbol.
name=base_name;
1880 else if(expr.
id()==ID_isnan ||
1883 else if(expr.
id()==ID_constant)
1885 if(expr.
type().
id()==ID_floatbv)
1891 else if(expr.
type().
id()==ID_pointer)
1894 const irept &c_sizeof_type=expr.
find(ID_C_c_sizeof_type);
1899 else if(expr.
id()==ID_typecast)
1901 if(expr.
type().
id() == ID_c_bit_field)
1908 if(!typedef_str.
empty() &&
1912 assert(expr.
type().
id()!=ID_union &&
1913 expr.
type().
id()!=ID_struct);
1916 else if(expr.
id()==ID_symbol)
1918 if(expr.
type().
id()!=ID_code)
1924 symbol.
type.
id()!=ID_code &&
1945 if(src->get_code().source_location().is_not_nil())
1947 else if(src->source_location.is_not_nil())
bitvector_typet index_type()
unsignedbv_typet size_type()
pointer_typet pointer_type(const typet &subtype)
const c_bit_field_typet & to_c_bit_field_type(const typet &type)
Cast a typet to a c_bit_field_typet.
const c_enum_tag_typet & to_c_enum_tag_type(const typet &type)
Cast a typet to a c_enum_tag_typet.
const exprt & size() const
bool dominates(T lhs, const nodet &rhs_node) const
Returns true if the program point corresponding to rhs_node is dominated by program point lhs.
bool program_point_reachable(const nodet &program_point_node) const
Returns true if the program point for program_point_node is reachable from the entry point.
const cfgt::nodet & get_node(const T &program_point) const
Get the graph node (which gives dominators, predecessors and successors) for program_point.
A non-fatal assertion, which checks a condition then permits execution to continue.
A codet representing an assignment in the program.
An assumption, which must hold in subsequent code.
A codet representing sequential composition of program statements.
void add(const codet &code)
code_operandst & statements()
codet representation of a break statement (within a for or while loop).
codet representation of a continue statement (within a for or while loop).
A codet representing the declaration of a local variable.
void set_initial_value(optionalt< exprt > initial_value)
Sets the value to which this declaration initializes the declared variable.
codet representation of a do while statement.
const exprt & cond() const
const codet & body() const
codet representation of an expression statement.
codet representation of a for statement.
codet representation of a function call statement.
exprt::operandst argumentst
codet representation of a goto statement.
codet representation of an if-then-else statement.
const codet & then_case() const
const exprt & cond() const
const codet & else_case() const
codet representation of a label for branch targets.
const irep_idt & get_label() const
codet representation of a "return from a function" statement.
const exprt & return_value() const
A codet representing a skip statement.
codet representation of a switch-case, i.e. a case statement within a switch.
codet representing a switch statement.
const exprt & value() const
const codet & body() const
std::vector< parametert > parameterst
const typet & return_type() const
const parameterst & parameters() const
codet representing a while statement.
Data structure for representing an arbitrary statement in a program.
void set_statement(const irep_idt &statement)
const irep_idt & get_statement() const
Operator to dereference a pointer.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
std::vector< exprt > operandst
bool has_operands() const
Return true if there is at least one operand.
bool is_true() const
Return whether the expression is a constant representing true.
void copy_to_operands(const exprt &expr)
Copy the given argument to the end of exprt's operands.
source_locationt & add_source_location()
const source_locationt & source_location() const
bool is_false() const
Return whether the expression is a constant representing false.
void reserve_operands(operandst::size_type n)
typet & type()
Return the type of the expression.
bool is_constant() const
Return whether the expression is a constant.
The Boolean constant false.
goto_programt::const_targett convert_goto_switch(goto_programt::const_targett target, goto_programt::const_targett upper_bound, code_blockt &dest)
goto_programt::const_targett convert_assign_varargs(goto_programt::const_targett target, goto_programt::const_targett upper_bound, code_blockt &dest)
std::unordered_set< irep_idt > local_static_set
std::unordered_set< irep_idt > type_names_set
goto_programt::const_targett convert_goto_break_continue(goto_programt::const_targett target, goto_programt::const_targett upper_bound, code_blockt &dest)
void cleanup_code_ifthenelse(codet &code, const irep_idt parent_stmt)
loop_last_stackt loop_last_stack
void convert_labels(goto_programt::const_targett target, code_blockt &dest)
goto_programt::const_targett convert_decl(goto_programt::const_targett target, goto_programt::const_targett upper_bound, code_blockt &dest)
symbol_tablet & symbol_table
goto_programt::const_targett convert_do_while(goto_programt::const_targett target, goto_programt::const_targett loop_end, code_blockt &dest)
goto_programt::const_targett convert_goto_goto(goto_programt::const_targett target, code_blockt &dest)
const goto_programt & goto_program
goto_programt::const_targett convert_start_thread(goto_programt::const_targett target, goto_programt::const_targett upper_bound, code_blockt &dest)
goto_programt::const_targett get_cases(goto_programt::const_targett target, goto_programt::const_targett upper_bound, const exprt &switch_var, cases_listt &cases, goto_programt::const_targett &first_target, goto_programt::const_targett &default_target)
void cleanup_code_block(codet &code, const irep_idt parent_stmt)
std::list< caset > cases_listt
void copy_source_location(goto_programt::const_targett, codet &dst)
bool remove_default(const cfg_dominatorst &dominators, const cases_listt &cases, goto_programt::const_targett default_target)
goto_programt::const_targett convert_throw(goto_programt::const_targett target, code_blockt &dest)
std::unordered_set< irep_idt > const_removed
goto_programt::const_targett convert_catch(goto_programt::const_targett target, goto_programt::const_targett upper_bound, code_blockt &dest)
void remove_const(typet &type)
std::unordered_set< exprt, irep_hash > va_list_expr
goto_programt::const_targett convert_goto(goto_programt::const_targett target, goto_programt::const_targett upper_bound, code_blockt &dest)
void add_local_types(const typet &type)
void cleanup_expr(exprt &expr, bool no_typecast)
void cleanup_code(codet &code, const irep_idt parent_stmt)
void cleanup_function_call(const exprt &function, code_function_callt::argumentst &arguments)
goto_programt::const_targett convert_assign(goto_programt::const_targett target, goto_programt::const_targett upper_bound, code_blockt &dest)
goto_programt::const_targett convert_instruction(goto_programt::const_targett target, goto_programt::const_targett upper_bound, code_blockt &dest)
void convert_assign_rec(const code_assignt &assign, code_blockt &dest)
std::unordered_set< irep_idt > labels_in_use
goto_programt::const_targett convert_goto_while(goto_programt::const_targett target, goto_programt::const_targett loop_end, code_blockt &dest)
goto_programt::const_targett convert_goto_if(goto_programt::const_targett target, goto_programt::const_targett upper_bound, code_blockt &dest)
std::set< std::string > & system_headers
code_blockt & toplevel_block
const std::unordered_set< irep_idt > & typedef_names
goto_programt::const_targett convert_set_return_value(goto_programt::const_targett target, goto_programt::const_targett upper_bound, code_blockt &dest)
bool set_block_end_points(goto_programt::const_targett upper_bound, const cfg_dominatorst &dominators, cases_listt &cases, std::set< unsigned > &processed_locations)
This class represents an instruction in the GOTO intermediate representation.
exprt guard
Guard for gotos, assume, assert Use get_condition() to read, and set_condition(c) to write.
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
instructionst::const_iterator const_targett
targett insert_before(const_targett target)
Insertion before the instruction pointed-to by the given instruction iterator target.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
bool get_bool(const irep_namet &name) const
const irept & find(const irep_namet &name) const
const irep_idt & id() const
void remove(const irep_namet &name)
const irep_idt & get(const irep_namet &name) const
loop_instructionst::const_iterator const_iterator
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
const cfg_dominators_templatet< P, T, false > & get_dominator_info() const
The null pointer constant.
A side_effect_exprt representation of a function call side effect.
exprt::operandst & arguments()
const irep_idt & get_statement() const
const irep_idt & get_function() const
Base type for structs and unions.
const componentst & components() const
std::vector< componentt > componentst
Expression to hold a symbol (variable)
const irep_idt & get_identifier() const
symbolt & get_writeable_ref(const irep_idt &name)
Find a symbol in the symbol table for read-write access.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
virtual std::pair< symbolt &, bool > insert(symbolt symbol) override
Author: Diffblue Ltd.
irep_idt base_name
Base (non-scoped) name.
source_locationt location
Source code location of definition of symbol.
typet type
Type of symbol.
irep_idt name
The unique identifier.
exprt value
Initial value of symbol.
const irep_idt & get_identifier() const
The Boolean constant true.
Semantic type conversion.
The type of an expression, extends irept.
const typet & subtype() const
bool has_prefix(const std::string &s, const std::string &prefix)
#define forall_operands(it, expr)
#define Forall_operands(it, expr)
const exprt & skip_typecast(const exprt &expr)
find the expression nested inside typecasts, if any
Deprecated expression utility functions.
static bool has_labels(const codet &code)
static bool move_label_ifthenelse(exprt &expr, exprt &label_dest)
Dump Goto-Program as C/C++ Source.
#define forall_goto_program_instructions(it, program)
const std::string & id2string(const irep_idt &d)
bool is_true(const literalt &l)
API to expression classes for Pointers.
const dereference_exprt & to_dereference_expr(const exprt &expr)
Cast an exprt to a dereference_exprt.
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
bool simplify(exprt &expr, const namespacet &ns)
exprt simplify_expr(exprt src, const namespacet &ns)
#define UNREACHABLE
This should be used to mark dead code.
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
const code_ifthenelset & to_code_ifthenelse(const codet &code)
side_effect_exprt & to_side_effect_expr(exprt &expr)
const code_switch_caset & to_code_switch_case(const codet &code)
const code_labelt & to_code_label(const codet &code)
side_effect_expr_function_callt & to_side_effect_expr_function_call(exprt &expr)
const codet & to_code(const exprt &expr)
const code_dowhilet & to_code_dowhile(const codet &code)
const code_blockt & to_code_block(const codet &code)
const code_function_callt & to_code_function_call(const codet &code)
const or_exprt & to_or_expr(const exprt &expr)
Cast an exprt to a or_exprt.
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
const union_exprt & to_union_expr(const exprt &expr)
Cast an exprt to a union_exprt.
const equal_exprt & to_equal_expr(const exprt &expr)
Cast an exprt to an equal_exprt.
const unary_exprt & to_unary_expr(const exprt &expr)
Cast an exprt to a unary_exprt.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
bool is_constant(const typet &type)
This method tests, if the given typet is a constant.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
const tag_typet & to_tag_type(const typet &type)
Cast a typet to a tag_typet.
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.