@@ -109,6 +109,63 @@ exprt adjust_lhs_object(
109
109
return nil_exprt ();
110
110
}
111
111
112
+ // / set internal field for variable assignment related to dynamic_object[0-9]
113
+ // / and dynamic_[0-9]_array.
114
+ void hide_dynamic_object (
115
+ const exprt &expr,
116
+ goto_trace_stept &goto_trace_step,
117
+ const namespacet &ns)
118
+ {
119
+ if (expr.id ()==ID_symbol)
120
+ {
121
+ const irep_idt &id=to_ssa_expr (expr).get_original_name ();
122
+ const symbolt *symbol;
123
+ if (!ns.lookup (id, symbol))
124
+ {
125
+ bool result=symbol->type .get_bool (" #dynamic" );
126
+ if (result)
127
+ goto_trace_step.hidden =true ;
128
+ }
129
+ }
130
+ else
131
+ {
132
+ forall_operands (it, expr)
133
+ hide_dynamic_object (*it, goto_trace_step, ns);
134
+ }
135
+ }
136
+
137
+ // / set internal for variables assignments related to dynamic_object and CPROVER
138
+ // / internal functions (e.g., __CPROVER_initialize)
139
+ void update_fields_to_hidden (
140
+ const symex_target_equationt::SSA_stept &SSA_step,
141
+ goto_trace_stept &goto_trace_step,
142
+ const namespacet &ns)
143
+ {
144
+ // hide dynamic_object in both lhs and rhs expressions
145
+ hide_dynamic_object (SSA_step.ssa_lhs , goto_trace_step, ns);
146
+ hide_dynamic_object (SSA_step.ssa_rhs , goto_trace_step, ns);
147
+
148
+ // hide internal CPROVER functions (e.g., __CPROVER_initialize)
149
+ if (SSA_step.is_function_call ())
150
+ {
151
+ if (SSA_step.source .pc ->source_location .as_string ().empty ())
152
+ goto_trace_step.hidden =true ;
153
+ }
154
+
155
+ // set internal field to input and output steps
156
+ if (goto_trace_step.type ==goto_trace_stept::typet::OUTPUT ||
157
+ goto_trace_step.type ==goto_trace_stept::typet::INPUT)
158
+ {
159
+ goto_trace_step.hidden =true ;
160
+ }
161
+
162
+ // set internal field to _start function-return step
163
+ if (SSA_step.source .pc ->function ==goto_functionst::entry_point ())
164
+ {
165
+ goto_trace_step.internal =true ;
166
+ }
167
+ }
168
+
112
169
void build_goto_trace (
113
170
const symex_target_equationt &target,
114
171
symex_target_equationt::SSA_stepst::const_iterator end_step,
@@ -216,6 +273,9 @@ void build_goto_trace(
216
273
goto_trace_step.formatted =SSA_step.formatted ;
217
274
goto_trace_step.identifier =SSA_step.identifier ;
218
275
276
+ // hide specific variables in the counterexample trace
277
+ update_fields_to_hidden (SSA_step, goto_trace_step, ns);
278
+
219
279
goto_trace_step.assignment_type =
220
280
(it->is_assignment ()&&
221
281
(SSA_step.assignment_type ==
0 commit comments