CBMC
Loading...
Searching...
No Matches
goto_trace.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Traces of GOTO Programs
4
5Author: Daniel Kroening
6
7 Date: July 2005
8
9\*******************************************************************/
10
13
14#include "goto_trace.h"
15
16#include <util/arith_tools.h>
17#include <util/byte_operators.h>
18#include <util/c_types.h>
19#include <util/config.h>
20#include <util/format_expr.h>
21#include <util/merge_irep.h>
22#include <util/namespace.h>
23#include <util/range.h>
24#include <util/string_utils.h>
25#include <util/symbol.h>
26
29
30static std::optional<symbol_exprt> get_object_rec(const exprt &src)
31{
32 if(src.id()==ID_symbol)
33 return to_symbol_expr(src);
34 else if(src.id()==ID_member)
35 return get_object_rec(to_member_expr(src).struct_op());
36 else if(src.id()==ID_index)
37 return get_object_rec(to_index_expr(src).array());
38 else if(src.id()==ID_typecast)
39 return get_object_rec(to_typecast_expr(src).op());
40 else if(
43 {
44 return get_object_rec(to_byte_extract_expr(src).op());
45 }
46 else
47 return {}; // give up
48}
49
50std::optional<symbol_exprt> goto_trace_stept::get_lhs_object() const
51{
53}
54
56 const class namespacet &ns,
57 std::ostream &out) const
58{
59 for(const auto &step : steps)
60 step.output(ns, out);
61}
62
64 const namespacet &,
65 std::ostream &out) const
66{
67 out << "*** ";
68
69 // clang-format off
70 switch(type)
71 {
72 case goto_trace_stept::typet::ASSERT: out << "ASSERT"; break;
73 case goto_trace_stept::typet::ASSUME: out << "ASSUME"; break;
74 case goto_trace_stept::typet::LOCATION: out << "LOCATION"; break;
75 case goto_trace_stept::typet::ASSIGNMENT: out << "ASSIGNMENT"; break;
76 case goto_trace_stept::typet::GOTO: out << "GOTO"; break;
77 case goto_trace_stept::typet::DECL: out << "DECL"; break;
78 case goto_trace_stept::typet::DEAD: out << "DEAD"; break;
79 case goto_trace_stept::typet::OUTPUT: out << "OUTPUT"; break;
80 case goto_trace_stept::typet::INPUT: out << "INPUT"; break;
82 out << "ATOMIC_BEGIN";
83 break;
84 case goto_trace_stept::typet::ATOMIC_END: out << "ATOMIC_END"; break;
85 case goto_trace_stept::typet::SHARED_READ: out << "SHARED_READ"; break;
86 case goto_trace_stept::typet::SHARED_WRITE: out << "SHARED WRITE"; break;
87 case goto_trace_stept::typet::FUNCTION_CALL: out << "FUNCTION CALL"; break;
89 out << "FUNCTION RETURN"; break;
90 case goto_trace_stept::typet::MEMORY_BARRIER: out << "MEMORY_BARRIER"; break;
91 case goto_trace_stept::typet::SPAWN: out << "SPAWN"; break;
92 case goto_trace_stept::typet::CONSTRAINT: out << "CONSTRAINT"; break;
93 case goto_trace_stept::typet::NONE: out << "NONE"; break;
94 }
95 // clang-format on
96
97 if(is_assert() || is_assume() || is_goto())
98 out << " (" << cond_value << ')';
99 else if(is_function_call())
100 out << ' ' << called_function;
101
102 if(hidden)
103 out << " hidden";
104
105 out << '\n';
106
107 if(is_assignment())
108 {
109 out << " " << format(full_lhs)
110 << " = " << format(full_lhs_value)
111 << '\n';
112 }
113
114 if(!pc->source_location().is_nil())
115 out << pc->source_location() << '\n';
116
117 out << pc->type() << '\n';
118
119 if(pc->is_assert())
120 {
121 if(!cond_value)
122 {
123 out << "Violated property:" << '\n';
124 if(pc->source_location().is_nil())
125 out << " " << pc->source_location() << '\n';
126
127 if(!comment.empty())
128 out << " " << comment << '\n';
129
130 out << " " << format(original_condition) << '\n';
131 out << '\n';
132 }
133 }
134
135 out << '\n';
136}
137
139{
140 dest(cond_expr);
141 dest(full_lhs);
142 dest(full_lhs_value);
143
144 for(auto &io_arg : io_args)
145 dest(io_arg);
146
148 dest(function_arg);
149}
150
160static std::string numeric_representation(
161 const constant_exprt &expr,
162 const namespacet &ns,
163 const trace_optionst &options)
164{
165 std::string result;
166 std::string prefix;
167
168 const typet &expr_type = expr.type();
169
170 const typet &underlying_type =
172 ? ns.follow_tag(to_c_enum_tag_type(expr_type)).underlying_type()
173 : expr_type;
174
175 const irep_idt &value = expr.get_value();
176
177 const auto width = to_bitvector_type(underlying_type).get_width();
178
179 const mp_integer value_int = bvrep2integer(id2string(value), width, false);
180
181 if(options.hex_representation)
182 {
183 result = integer2string(value_int, 16);
184 prefix = "0x";
185 }
186 else
187 {
188 result = integer2binary(value_int, width);
189 prefix = "0b";
190 }
191
192 std::ostringstream oss;
193 std::string::size_type i = 0;
194 for(const auto c : result)
195 {
196 oss << c;
197 if(++i % config.ansi_c.char_width == 0 && result.size() != i)
198 oss << ' ';
199 }
200 if(options.base_prefix)
201 return prefix + oss.str();
202 else
203 return oss.str();
204}
205
207 const exprt &expr,
208 const namespacet &ns,
209 const trace_optionst &options)
210{
211 const typet &type = expr.type();
212
213 if(expr.is_constant())
214 {
215 if(type.id()==ID_unsignedbv ||
216 type.id()==ID_signedbv ||
217 type.id()==ID_bv ||
218 type.id()==ID_fixedbv ||
219 type.id()==ID_floatbv ||
220 type.id()==ID_pointer ||
221 type.id()==ID_c_bit_field ||
222 type.id()==ID_c_bool ||
223 type.id()==ID_c_enum ||
224 type.id()==ID_c_enum_tag)
225 {
226 return numeric_representation(to_constant_expr(expr), ns, options);
227 }
228 else if(type.id()==ID_bool)
229 {
230 return expr.is_true()?"1":"0";
231 }
232 else if(type.id()==ID_integer)
233 {
234 const auto i = numeric_cast<mp_integer>(expr);
235 if(i.has_value() && *i >= 0)
236 {
237 if(options.hex_representation)
238 return "0x" + integer2string(*i, 16);
239 else
240 return "0b" + integer2string(*i, 2);
241 }
242 }
243 }
244 else if(expr.id() == ID_annotated_pointer_constant)
245 {
246 const auto &annotated_pointer_constant =
248 auto width = to_pointer_type(expr.type()).get_width();
249 auto &value = annotated_pointer_constant.get_value();
250 auto c = constant_exprt(value, unsignedbv_typet(width));
251 return numeric_representation(c, ns, options);
252 }
253 else if(expr.id()==ID_array)
254 {
255 std::string result;
256
257 for(const auto &op : expr.operands())
258 {
259 if(result.empty())
260 result="{ ";
261 else
262 result+=", ";
263 result += trace_numeric_value(op, ns, options);
264 }
265
266 return result+" }";
267 }
268 else if(expr.id()==ID_struct)
269 {
270 std::string result="{ ";
271
272 forall_operands(it, expr)
273 {
274 if(it!=expr.operands().begin())
275 result+=", ";
276 result+=trace_numeric_value(*it, ns, options);
277 }
278
279 return result+" }";
280 }
281 else if(expr.id()==ID_union)
282 {
283 return trace_numeric_value(to_union_expr(expr).op(), ns, options);
284 }
285
286 return "?";
287}
288
289static void trace_value(
291 const namespacet &ns,
292 const std::optional<symbol_exprt> &lhs_object,
293 const exprt &full_lhs,
294 const exprt &value,
295 const trace_optionst &options)
296{
297 irep_idt identifier;
298
299 if(lhs_object.has_value())
300 identifier=lhs_object->get_identifier();
301
302 out << from_expr(ns, identifier, full_lhs) << '=';
303
304 if(value.is_nil())
305 out << "(assignment removed)";
306 else
307 {
308 out << from_expr(ns, identifier, value);
309
310 // the binary representation
311 out << ' ' << messaget::faint << '('
312 << trace_numeric_value(value, ns, options) << ')' << messaget::reset;
313 }
314
315 out << '\n';
316}
317
318static std::string
320{
321 std::string result;
322
323 const auto &source_location = state.pc->source_location();
324
325 if(!source_location.get_file().empty())
326 result += "file " + id2string(source_location.get_file());
327
328 if(!state.function_id.empty())
329 {
330 const symbolt &symbol = ns.lookup(state.function_id);
331 if(!result.empty())
332 result += ' ';
333 result += "function " + id2string(symbol.display_name());
334 }
335
336 if(!source_location.get_line().empty())
337 {
338 if(!result.empty())
339 result += ' ';
340 result += "line " + id2string(source_location.get_line());
341 }
342
343 if(!result.empty())
344 result += ' ';
345 result += "thread " + std::to_string(state.thread_nr);
346
347 return result;
348}
349
352 const namespacet &ns,
353 const goto_trace_stept &state,
354 std::size_t step_nr,
355 const trace_optionst &options)
356{
357 out << '\n';
358
359 if(step_nr == 0)
360 out << "Initial State";
361 else
362 out << "State " << step_nr;
363
364 out << ' ' << state_location(state, ns) << '\n';
365 out << "----------------------------------------------------" << '\n';
366
367 if(options.show_code)
368 {
369 out << as_string(ns, state.function_id, *state.pc) << '\n';
370 out << "----------------------------------------------------" << '\n';
371 }
372}
373
375{
376 if(src.id()==ID_index)
377 return is_index_member_symbol(to_index_expr(src).array());
378 else if(src.id()==ID_member)
379 return is_index_member_symbol(to_member_expr(src).compound());
380 else if(src.id()==ID_symbol)
381 return true;
382 else
383 return false;
384}
385
393 const namespacet &ns,
394 const goto_tracet &goto_trace,
395 const trace_optionst &options)
396{
397 for(const auto &step : goto_trace.steps)
398 {
399 // hide the hidden ones
400 if(step.hidden)
401 continue;
402
403 switch(step.type)
404 {
406 if(!step.cond_value)
407 {
408 out << '\n';
409 out << messaget::red << "Violated property:" << messaget::reset << '\n';
410 if(!step.pc->source_location().is_nil())
411 out << " " << state_location(step, ns) << '\n';
412
413 out << " " << messaget::red << step.comment << messaget::reset << '\n';
414
415 if(step.pc->is_assert())
416 {
417 out << " "
418 << from_expr(ns, step.function_id, step.original_condition)
419 << '\n';
420 }
421
422 out << '\n';
423 }
424 break;
425
427 if(
428 step.assignment_type ==
430 {
431 break;
432 }
433
434 out << " ";
435
436 if(!step.pc->source_location().get_line().empty())
437 {
438 out << messaget::faint << step.pc->source_location().get_line() << ':'
439 << messaget::reset << ' ';
440 }
441
443 out,
444 ns,
445 step.get_lhs_object(),
446 step.full_lhs,
447 step.full_lhs_value,
448 options);
449 break;
450
452 // downwards arrow
453 out << '\n' << messaget::faint << u8"\u21b3" << messaget::reset << ' ';
454 if(!step.pc->source_location().get_file().empty())
455 {
456 out << messaget::faint << step.pc->source_location().get_file();
457
458 if(!step.pc->source_location().get_line().empty())
459 {
460 out << messaget::faint << ':'
461 << step.pc->source_location().get_line();
462 }
463
464 out << messaget::reset << ' ';
465 }
466
467 {
468 // show the display name
469 const auto &f_symbol = ns.lookup(step.called_function);
470 out << f_symbol.display_name();
471 }
472
473 {
474 auto arg_strings = make_range(step.function_arguments)
475 .map([&ns, &step](const exprt &arg) {
476 return from_expr(ns, step.function_id, arg);
477 });
478
479 out << '(';
480 join_strings(out, arg_strings.begin(), arg_strings.end(), ", ");
481 out << ")\n";
482 }
483
484 break;
485
487 // upwards arrow
488 out << messaget::faint << u8"\u21b5" << messaget::reset << '\n';
489 break;
490
505 break;
506
509 }
510 }
511}
512
515 const namespacet &ns,
516 const goto_tracet &goto_trace,
517 const trace_optionst &options)
518{
519 std::size_t prev_step_nr = 0;
520 bool first_step=true;
521 std::size_t function_depth=0;
522
523 for(const auto &step : goto_trace.steps)
524 {
525 // hide the hidden ones
526 if(step.hidden)
527 continue;
528
529 switch(step.type)
530 {
532 if(!step.cond_value)
533 {
534 out << '\n';
535 out << messaget::red << "Violated property:" << messaget::reset << '\n';
536 if(!step.pc->source_location().is_nil())
537 {
538 out << " " << state_location(step, ns) << '\n';
539 }
540
541 out << " " << messaget::red << step.comment << messaget::reset << '\n';
542
543 if(step.pc->is_assert())
544 {
545 out << " "
546 << from_expr(ns, step.function_id, step.original_condition)
547 << '\n';
548 }
549
550 out << '\n';
551 }
552 break;
553
555 if(step.cond_value && step.pc->is_assume())
556 {
557 out << "\n";
558 out << "Assumption:\n";
559
560 if(!step.pc->source_location().is_nil())
561 out << " " << step.pc->source_location() << '\n';
562
563 out << " " << from_expr(ns, step.function_id, step.original_condition)
564 << '\n';
565 }
566 break;
567
569 break;
570
572 break;
573
575 if(
576 step.pc->is_assign() ||
577 step.pc->is_set_return_value() || // returns have a lhs!
578 step.pc->is_function_call() ||
579 (step.pc->is_other() && step.full_lhs.is_not_nil()))
580 {
581 if(prev_step_nr!=step.step_nr || first_step)
582 {
583 first_step=false;
584 prev_step_nr=step.step_nr;
585 show_state_header(out, ns, step, step.step_nr, options);
586 }
587
588 out << " ";
590 out,
591 ns,
592 step.get_lhs_object(),
593 step.full_lhs,
594 step.full_lhs_value,
595 options);
596 }
597 break;
598
600 if(prev_step_nr!=step.step_nr || first_step)
601 {
602 first_step=false;
603 prev_step_nr=step.step_nr;
604 show_state_header(out, ns, step, step.step_nr, options);
605 }
606
607 out << " ";
609 out, ns, step.get_lhs_object(), step.full_lhs, step.full_lhs_value, options);
610 break;
611
613 if(step.formatted)
614 {
616 printf_formatter(id2string(step.format_string), step.io_args);
617 printf_formatter.print(out);
618 out << '\n';
619 }
620 else
621 {
622 show_state_header(out, ns, step, step.step_nr, options);
623 out << " OUTPUT " << step.io_id << ':';
624
625 for(std::list<exprt>::const_iterator
626 l_it=step.io_args.begin();
627 l_it!=step.io_args.end();
628 l_it++)
629 {
630 if(l_it!=step.io_args.begin())
631 out << ';';
632
633 out << ' ' << from_expr(ns, step.function_id, *l_it);
634
635 // the binary representation
636 out << " (" << trace_numeric_value(*l_it, ns, options) << ')';
637 }
638
639 out << '\n';
640 }
641 break;
642
644 show_state_header(out, ns, step, step.step_nr, options);
645 out << " INPUT " << step.io_id << ':';
646
647 for(std::list<exprt>::const_iterator
648 l_it=step.io_args.begin();
649 l_it!=step.io_args.end();
650 l_it++)
651 {
652 if(l_it!=step.io_args.begin())
653 out << ';';
654
655 out << ' ' << from_expr(ns, step.function_id, *l_it);
656
657 // the binary representation
658 out << " (" << trace_numeric_value(*l_it, ns, options) << ')';
659 }
660
661 out << '\n';
662 break;
663
666 if(options.show_function_calls)
667 {
668 out << "\n#### Function call: " << step.called_function;
669 out << '(';
670
671 bool first = true;
672 for(auto &arg : step.function_arguments)
673 {
674 if(first)
675 first = false;
676 else
677 out << ", ";
678
679 out << from_expr(ns, step.function_id, arg);
680 }
681
682 out << ") (depth " << function_depth << ") ####\n";
683 }
684 break;
685
688 if(options.show_function_calls)
689 {
690 out << "\n#### Function return from " << step.function_id << " (depth "
691 << function_depth << ") ####\n";
692 }
693 break;
694
700 break;
701
707 }
708 }
709}
710
713 const namespacet &ns,
714 const goto_tracet &goto_trace)
715{
716 // map from thread number to a call stack
717 std::map<unsigned, std::vector<goto_tracet::stepst::const_iterator>>
719
720 // by default, we show thread 0
721 unsigned thread_to_show = 0;
722
723 for(auto s_it = goto_trace.steps.begin(); s_it != goto_trace.steps.end();
724 s_it++)
725 {
726 const auto &step = *s_it;
727 auto &stack = call_stacks[step.thread_nr];
728
729 if(step.is_assert())
730 {
731 if(!step.cond_value)
732 {
733 stack.push_back(s_it);
734 thread_to_show = step.thread_nr;
735 }
736 }
737 else if(step.is_function_call())
738 {
739 stack.push_back(s_it);
740 }
741 else if(step.is_function_return())
742 {
743 stack.pop_back();
744 }
745 }
746
747 const auto &stack = call_stacks[thread_to_show];
748
749 // print in reverse order
750 for(auto s_it = stack.rbegin(); s_it != stack.rend(); s_it++)
751 {
752 const auto &step = **s_it;
753 if(step.is_assert())
754 {
755 out << " assertion failure";
756 if(!step.pc->source_location().is_nil())
757 out << ' ' << step.pc->source_location();
758 out << '\n';
759 }
760 else if(step.is_function_call())
761 {
762 out << " " << step.called_function;
763 out << '(';
764
765 bool first = true;
766 for(auto &arg : step.function_arguments)
767 {
768 if(first)
769 first = false;
770 else
771 out << ", ";
772
773 out << from_expr(ns, step.function_id, arg);
774 }
775
776 out << ')';
777
778 if(!step.pc->source_location().is_nil())
779 out << ' ' << step.pc->source_location();
780
781 out << '\n';
782 }
783 }
784}
785
788 const namespacet &ns,
789 const goto_tracet &goto_trace,
790 const trace_optionst &options)
791{
792 if(options.stack_trace)
794 else if(options.compact_trace)
795 show_compact_goto_trace(out, ns, goto_trace, options);
796 else
797 show_full_goto_trace(out, ns, goto_trace, options);
798}
799
801
802std::set<irep_idt> goto_tracet::get_failed_property_ids() const
803{
804 std::set<irep_idt> property_ids;
805 for(const auto &step : steps)
806 {
807 if(step.is_assert() && !step.cond_value)
808 property_ids.insert(step.property_id);
809 }
810 return property_ids;
811}
configt config
Definition config.cpp:25
mp_integer bvrep2integer(const irep_idt &src, std::size_t width, bool is_signed)
convert a bit-vector representation (possibly signed) to integer
const bitvector_typet & to_bitvector_type(const typet &type)
Cast a typet to a bitvector_typet.
Expression classes for byte-level operators.
const byte_extract_exprt & to_byte_extract_expr(const exprt &expr)
const c_enum_tag_typet & to_c_enum_tag_type(const typet &type)
Cast a typet to a c_enum_tag_typet.
Definition c_types.h:377
virtual void output(const namespacet &ns, const irep_idt &function_id, const goto_programt &goto_program, std::ostream &out) const
Output the abstract states for a single function.
Definition ai.cpp:39
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
struct configt::ansi_ct ansi_c
A constant literal expression.
Definition std_expr.h:3118
const irep_idt & get_value() const
Definition std_expr.h:3126
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:38
bool empty() const
Definition dstring.h:89
Base class for all expressions.
Definition expr.h:56
bool is_true() const
Return whether the expression is a constant representing true.
Definition expr.cpp:27
bool is_constant() const
Return whether the expression is a constant.
Definition expr.h:212
typet & type()
Return the type of the expression.
Definition expr.h:84
operandst & operands()
Definition expr.h:94
Step of the trace of a GOTO program.
Definition goto_trace.h:50
std::vector< exprt > function_arguments
Definition goto_trace.h:145
bool is_function_call() const
Definition goto_trace.h:60
exprt original_condition
Definition goto_trace.h:120
bool is_assignment() const
Definition goto_trace.h:55
std::string comment
Definition goto_trace.h:124
goto_programt::const_targett pc
Definition goto_trace.h:112
irep_idt function_id
Definition goto_trace.h:111
void merge_ireps(merge_irept &dest)
Use dest to establish sharing among ireps.
unsigned thread_nr
Definition goto_trace.h:115
bool is_goto() const
Definition goto_trace.h:58
bool is_assume() const
Definition goto_trace.h:56
bool is_assert() const
Definition goto_trace.h:57
irep_idt called_function
Definition goto_trace.h:142
std::optional< symbol_exprt > get_lhs_object() const
void output(const class namespacet &ns, std::ostream &out) const
Outputs the trace step in ASCII to a given stream.
Trace of a GOTO program.
Definition goto_trace.h:177
stepst steps
Definition goto_trace.h:180
std::set< irep_idt > get_failed_property_ids() const
Returns the property IDs of all failed assertions in the trace.
void output(const class namespacet &ns, std::ostream &out) const
Outputs the trace in ASCII to a given stream.
const irep_idt & id() const
Definition irep.h:388
bool is_nil() const
Definition irep.h:368
source_locationt source_location
Definition message.h:239
static const commandt reset
return to default formatting, as defined by the terminal
Definition message.h:335
static const commandt faint
render text with faint font
Definition message.h:377
static const commandt red
render text with red foreground color
Definition message.h:338
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
Definition namespace.cpp:49
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
Symbol table entry.
Definition symbol.h:28
const irep_idt & display_name() const
Return language specific display name if present.
Definition symbol.h:55
The type of an expression, extends irept.
Definition type.h:29
Fixed-width bit-vector with unsigned binary interpretation.
#define forall_operands(it, expr)
Definition expr.h:20
static format_containert< T > format(const T &o)
Definition format.h:37
static void show_goto_stack_trace(messaget::mstreamt &out, const namespacet &ns, const goto_tracet &goto_trace)
void show_state_header(messaget::mstreamt &out, const namespacet &ns, const goto_trace_stept &state, std::size_t step_nr, const trace_optionst &options)
static std::string state_location(const goto_trace_stept &state, const namespacet &ns)
std::string trace_numeric_value(const exprt &expr, const namespacet &ns, const trace_optionst &options)
static std::string numeric_representation(const constant_exprt &expr, const namespacet &ns, const trace_optionst &options)
Returns the numeric representation of an expression, based on options.
void show_full_goto_trace(messaget::mstreamt &out, const namespacet &ns, const goto_tracet &goto_trace, const trace_optionst &options)
void show_goto_trace(messaget::mstreamt &out, const namespacet &ns, const goto_tracet &goto_trace, const trace_optionst &options)
Output the trace on the given stream out.
bool is_index_member_symbol(const exprt &src)
static void trace_value(messaget::mstreamt &out, const namespacet &ns, const std::optional< symbol_exprt > &lhs_object, const exprt &full_lhs, const exprt &value, const trace_optionst &options)
void show_compact_goto_trace(messaget::mstreamt &out, const namespacet &ns, const goto_tracet &goto_trace, const trace_optionst &options)
show a compact variant of the goto trace on the console
static std::optional< symbol_exprt > get_object_rec(const exprt &src)
Traces of GOTO Programs.
const std::string & id2string(const irep_idt &d)
Definition irep.h:44
std::string from_expr(const namespacet &ns, const irep_idt &identifier, const exprt &expr)
const std::string integer2string(const mp_integer &n, unsigned base)
Definition mp_arith.cpp:103
const std::string integer2binary(const mp_integer &n, std::size_t width)
Definition mp_arith.cpp:64
const annotated_pointer_constant_exprt & to_annotated_pointer_constant_expr(const exprt &expr)
Cast an exprt to an annotated_pointer_constant_exprt.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
printf Formatting
Ranges: pair of begin and end iterators, which can be initialized from containers,...
ranget< iteratort > make_range(iteratort begin, iteratort end)
Definition range.h:522
BigInt mp_integer
Definition smt_terms.h:17
#define UNREACHABLE
This should be used to mark dead code.
Definition invariant.h:525
std::string as_string(const ai_verifier_statust &status)
Makes a status message string from a status.
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
Definition std_expr.h:1538
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
Definition std_expr.h:2107
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
Definition std_expr.h:3064
const union_exprt & to_union_expr(const exprt &expr)
Cast an exprt to a union_exprt.
Definition std_expr.h:1816
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
Definition std_expr.h:3173
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
Definition std_expr.h:272
Stream & join_strings(Stream &&os, const It b, const It e, const Delimiter &delimiter, TransformFunc &&transform_func)
Prints items to an stream, separated by a constant delimiter.
Options for printing the trace using show_goto_trace.
Definition goto_trace.h:221
static const trace_optionst default_options
Definition goto_trace.h:238
bool hex_representation
Represent plain trace values in hex.
Definition goto_trace.h:225
bool base_prefix
Use prefix (0b or 0x) for distinguishing the base of the representation.
Definition goto_trace.h:228
bool show_code
Show original code in plain text trace.
Definition goto_trace.h:232
bool compact_trace
Give a compact trace.
Definition goto_trace.h:234
bool show_function_calls
Show function calls in plain text trace.
Definition goto_trace.h:230
bool stack_trace
Give a stack trace only.
Definition goto_trace.h:236
Symbol table entry.