Skip to content

Commit 30f26d2

Browse files
Get_all_property_ids should only return failed properties
Passed properties on traces are less interesting.
1 parent 4e30927 commit 30f26d2

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/cbmc/c_test_input_generator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ json_objectt test_inputst::to_json(
7171
}
7272

7373
json_arrayt goal_refs;
74-
for(const auto &goal_id : goto_trace.get_all_property_ids())
74+
for(const auto &goal_id : goto_trace.get_failed_property_ids())
7575
{
7676
goal_refs.push_back(json_stringt(goal_id));
7777
}
@@ -112,7 +112,7 @@ xmlt test_inputst::to_xml(
112112
}
113113
}
114114

115-
for(const auto &goal_id : goto_trace.get_all_property_ids())
115+
for(const auto &goal_id : goto_trace.get_failed_property_ids())
116116
{
117117
xmlt &xml_goal = xml_result.new_element("goal");
118118
xml_goal.set_attribute("id", id2string(goal_id));

src/goto-checker/goto_trace_storage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const goto_tracet &goto_trace_storaget::insert(goto_tracet &&trace)
3333
const goto_tracet &goto_trace_storaget::insert_all(goto_tracet &&trace)
3434
{
3535
traces.push_back(std::move(trace));
36-
const auto &all_property_ids = traces.back().get_all_property_ids();
36+
const auto &all_property_ids = traces.back().get_failed_property_ids();
3737
DATA_INVARIANT(
3838
!all_property_ids.empty(), "a trace must violate at least one assertion");
3939
for(const auto &property_id : all_property_ids)

src/goto-programs/goto_trace.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -773,13 +773,13 @@ void show_goto_trace(
773773

774774
const trace_optionst trace_optionst::default_options = trace_optionst();
775775

776-
std::vector<irep_idt> goto_tracet::get_all_property_ids() const
776+
std::set<irep_idt> goto_tracet::get_failed_property_ids() const
777777
{
778-
std::vector<irep_idt> property_ids;
778+
std::set<irep_idt> property_ids;
779779
for(const auto &step : steps)
780780
{
781-
if(step.is_assert())
782-
property_ids.push_back(step.property_id);
781+
if(step.is_assert() && !step.cond_value)
782+
property_ids.insert(step.property_id);
783783
}
784784
return property_ids;
785785
}

src/goto-programs/goto_trace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ class goto_tracet
206206
return steps.back();
207207
}
208208

209-
/// Returns the property IDs of all assertions in the trace
210-
std::vector<irep_idt> get_all_property_ids() const;
209+
/// Returns the property IDs of all failed assertions in the trace
210+
std::set<irep_idt> get_failed_property_ids() const;
211211
};
212212

213213
/// Options for printing the trace using show_goto_trace

0 commit comments

Comments
 (0)