@@ -6,8 +6,6 @@ Author: Daniel Kroening
6
6
7
7
\*******************************************************************/
8
8
9
- #include < iostream>
10
-
11
9
#include < util/base_type.h>
12
10
#include < util/byte_operators.h>
13
11
#include < util/config.h>
@@ -179,6 +177,7 @@ void graphml_witnesst::operator()(const goto_tracet &goto_trace)
179
177
// step numbers start at 1
180
178
std::vector<std::size_t > step_to_node (goto_trace.steps .size ()+1 , 0 );
181
179
180
+ goto_tracet::stepst::const_iterator prev_it=goto_trace.steps .end ();
182
181
for (goto_tracet::stepst::const_iterator
183
182
it=goto_trace.steps .begin ();
184
183
it!=goto_trace.steps .end ();
@@ -188,6 +187,11 @@ void graphml_witnesst::operator()(const goto_tracet &goto_trace)
188
187
189
188
if (it->hidden ||
190
189
(!it->is_assignment () && !it->is_goto () && !it->is_assert ()) ||
190
+ // we filter out steps with the same source location
191
+ // TODO: if these are assignments we should accumulate them into
192
+ // a single edge
193
+ (prev_it!=goto_trace.steps .end () &&
194
+ prev_it->pc ->source_location ==it->pc ->source_location ) ||
191
195
(it->is_goto () && it->pc ->guard .is_true ()) ||
192
196
source_location.is_nil () ||
193
197
source_location.get_file ().empty () ||
@@ -212,6 +216,8 @@ void graphml_witnesst::operator()(const goto_tracet &goto_trace)
212
216
continue ;
213
217
}
214
218
219
+ prev_it=it;
220
+
215
221
const graphmlt::node_indext node=graphml.add_node ();
216
222
graphml[node].node_name =
217
223
i2string (it->pc ->location_number )+" ." +i2string (it->step_nr );
0 commit comments