@@ -225,3 +225,53 @@ void slice(
225
225
<< " remaining after simplification" << messaget::eom;
226
226
}
227
227
228
+ std::vector<irep_idt> update_properties_status_from_symex_target_equation (
229
+ propertiest &properties,
230
+ const symex_target_equationt &equation)
231
+ {
232
+ std::vector<irep_idt> updated_properties;
233
+
234
+ for (const auto &step : equation.SSA_steps )
235
+ {
236
+ if (!step.is_assert ())
237
+ continue ;
238
+
239
+ irep_idt property_id = step.get_property_id ();
240
+
241
+ if (property_id.empty ())
242
+ continue ;
243
+
244
+ // Don't set false properties; we wouldn't have traces for them.
245
+ const auto status = step.cond_expr .is_true () ? property_statust::PASS
246
+ : property_statust::UNKNOWN;
247
+ auto emplace_result = properties.emplace (
248
+ property_id, property_infot{step.source .pc , step.comment , status});
249
+
250
+ if (emplace_result.second )
251
+ {
252
+ updated_properties.push_back (property_id);
253
+ }
254
+ else
255
+ {
256
+ property_infot &property_info = emplace_result.first ->second ;
257
+ property_statust old_status = property_info.status ;
258
+ property_info.status |= status;
259
+
260
+ if (property_info.status != old_status)
261
+ updated_properties.push_back (property_id);
262
+ }
263
+ }
264
+
265
+ for (auto &property_pair : properties)
266
+ {
267
+ if (property_pair.second .status == property_statust::NOT_CHECKED)
268
+ {
269
+ // This could be a NOT_CHECKED, NOT_REACHABLE or PASS,
270
+ // but the equation doesn't give us precise information.
271
+ property_pair.second .status = property_statust::PASS;
272
+ updated_properties.push_back (property_pair.first );
273
+ }
274
+ }
275
+
276
+ return updated_properties;
277
+ }
0 commit comments