ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
goto_trace.h
Go to the documentation of this file.
1#ifndef CPROVER_GOTO_SYMEX_GOTO_TRACE_H
2#define CPROVER_GOTO_SYMEX_GOTO_TRACE_H
3
4#include <fstream>
7
8#include <map>
9#include <irep2/irep2.h>
10#include <util/irep/migrate.h>
11#include <util/config/cmdline.h>
12#include <vector>
13#include <string_view>
14
16{
17public:
18 unsigned step_nr;
19
20 // See SSA_stept.
21 std::vector<stack_framet> stack_trace;
22
23 bool is_assignment() const
24 {
26 }
27 bool is_assume() const
28 {
30 }
31 bool is_assert() const
32 {
34 }
35 bool is_output() const
36 {
38 }
39 bool is_skip() const
40 {
41 return type == symex_targett::SKIP;
42 }
43 bool is_renumber() const
44 {
46 }
47 bool is_branching() const
48 {
50 }
51
53
55
56 // this transition done by given thread number
57 unsigned thread_nr;
58
59 // for assume, assert, goto
60 bool guard;
61
62 // for assert
63 std::string comment;
64
65 // in SSA
67
68 // this is a constant
70
71 // original expression
73
74 /* For a violated assert: the source-level lvalues its claim reads that no
75 * assignment step carries -- a field of an object the program never wrote --
76 * each paired with its value in this counterexample. A witness has nothing
77 * else to record them from (#7858). */
78 std::list<std::pair<expr2tc, expr2tc>> nondet_reads;
79
80 // for OUTPUT
81 std::string format_string;
82 std::list<expr2tc> output_args;
83
84 void output(const class namespacet &ns, std::ostream &out) const;
85 void dump() const;
86
90};
91
93{
94public:
95 typedef std::list<goto_trace_stept> stepst;
96 typedef std::map<std::string, std::string, std::less<std::string>> mid;
98 std::string mode;
99
100 void clear()
101 {
102 mode.clear();
103 steps.clear();
104 }
105
106 void output(const class namespacet &ns, std::ostream &out) const;
107};
108
110 std::ostream &out,
111 const namespacet &ns,
112 const goto_tracet &goto_trace);
113
119void show_goto_trace(
120 std::ostream &out,
121 const namespacet &ns,
122 const goto_tracet &goto_trace,
123 bool reachability_trace = false);
124
125bool input_file_check(const locationt &l);
126
127void show_simplified_location(std::ostream &out, const locationt &location);
128
135 optionst &options,
136 const namespacet &ns,
137 const goto_tracet &goto_trace,
138 const std::string &output_path_override = "");
139
143 optionst &options,
144 const namespacet &ns,
145 const goto_tracet &goto_trace,
146 const std::string &output_path_override = "");
147
149 optionst &options,
150 const namespacet &ns,
151 const goto_tracet &goto_trace);
152
154 optionst &options,
155 const namespacet &ns,
156 const goto_tracet &goto_trace);
157
159 std::string &witness_output,
160 bool is_detailed_mode,
161 int &specification,
162 const namespacet &ns,
163 const goto_tracet &goto_trace);
164
166 std::ostream &out,
167 const namespacet &ns,
168 const expr2tc &identifier,
169 const expr2tc &value);
170
172 const std::string_view uuid,
173 const namespacet &ns,
174 const goto_tracet &goto_trace,
175 const optionst &options);
176
178 const std::string_view uuid,
179 const namespacet &ns,
180 const goto_tracet &goto_trace);
181
182#endif
instructionst::const_iterator const_targett
Definition goto_program.h:591
expr2tc lhs
Definition goto_trace.h:66
bool is_assignment() const
Definition goto_trace.h:23
void dump() const
Definition goto_trace.cpp:22
expr2tc value
Definition goto_trace.h:69
expr2tc rhs
Definition goto_trace.h:66
std::string comment
Definition goto_trace.h:63
std::vector< stack_framet > stack_trace
Definition goto_trace.h:21
goto_programt::const_targett pc
Definition goto_trace.h:54
symex_targett::step_typet type
Definition goto_trace.h:52
bool is_branching() const
Definition goto_trace.h:47
unsigned thread_nr
Definition goto_trace.h:57
bool guard
Definition goto_trace.h:60
bool is_assume() const
Definition goto_trace.h:27
std::list< expr2tc > output_args
Definition goto_trace.h:82
bool is_skip() const
Definition goto_trace.h:39
bool is_assert() const
Definition goto_trace.h:31
goto_trace_stept()
Definition goto_trace.h:87
expr2tc original_lhs
Definition goto_trace.h:72
void output(const class namespacet &ns, std::ostream &out) const
Definition goto_trace.cpp:29
std::string format_string
Definition goto_trace.h:81
bool is_renumber() const
Definition goto_trace.h:43
unsigned step_nr
Definition goto_trace.h:18
std::list< std::pair< expr2tc, expr2tc > > nondet_reads
Definition goto_trace.h:78
bool is_output() const
Definition goto_trace.h:35
Definition goto_trace.h:93
std::string mode
Definition goto_trace.h:98
stepst steps
Definition goto_trace.h:97
void clear()
Definition goto_trace.h:100
std::map< std::string, std::string, std::less< std::string > > mid
Definition goto_trace.h:96
void output(const class namespacet &ns, std::ostream &out) const
Definition goto_trace.cpp:16
std::list< goto_trace_stept > stepst
Definition goto_trace.h:95
Definition location.h:7
Definition namespace.h:10
Definition options.h:11
step_typet
Definition symex_target.h:20
@ OUTPUT
Definition symex_target.h:24
@ RENUMBER
Definition symex_target.h:26
@ ASSERT
Definition symex_target.h:23
@ SKIP
Definition symex_target.h:25
@ BREANCHING
Definition symex_target.h:27
@ ASSIGNMENT
Definition symex_target.h:21
@ ASSUME
Definition symex_target.h:22
Definition toml.hpp:1531
void generate_json_report(const std::string_view uuid, const namespacet &ns, const goto_tracet &goto_trace)
Definition json.cpp:496
void show_goto_trace(std::ostream &out, const namespacet &ns, const goto_tracet &goto_trace, bool reachability_trace=false)
Definition goto_trace.cpp:669
void counterexample_value(std::ostream &out, const namespacet &ns, const expr2tc &identifier, const expr2tc &value)
Definition goto_trace.cpp:110
void correctness_graphml_goto_trace(optionst &options, const namespacet &ns, const goto_tracet &goto_trace)
Definition goto_trace.cpp:567
void violation_graphml_goto_trace(optionst &options, const namespacet &ns, const goto_tracet &goto_trace, const std::string &output_path_override="")
Emit a GraphML violation witness for goto_trace.
Definition goto_trace.cpp:396
void show_goto_trace_gui(std::ostream &out, const namespacet &ns, const goto_tracet &goto_trace)
Definition goto_trace.cpp:163
void generate_goto_trace_in_correctness_graphml_format(std::string &witness_output, bool is_detailed_mode, int &specification, const namespacet &ns, const goto_tracet &goto_trace)
void violation_yaml_goto_trace(optionst &options, const namespacet &ns, const goto_tracet &goto_trace, const std::string &output_path_override="")
Emit a YAML violation witness for goto_trace; analogous to violation_graphml_goto_trace.
Definition goto_trace.cpp:505
void correctness_yaml_goto_trace(optionst &options, const namespacet &ns, const goto_tracet &goto_trace)
Definition goto_trace.cpp:615
void show_simplified_location(std::ostream &out, const locationt &location)
Definition goto_trace.cpp:646
bool input_file_check(const locationt &l)
Definition goto_trace.cpp:243
void generate_html_report(const std::string_view uuid, const namespacet &ns, const goto_tracet &goto_trace, const optionst &options)
Definition html.cpp:677
Classes and definitions for non-stringy internal representation.
irep_container< expr2t > expr2tc
Definition irep2.h:431
@ identifier
Definition nested_func_transform.cpp:62
#define false
Definition stdbool.h:10