Skip to content

Commit 7823ea8

Browse files
committed
Initialize properties with UNKNOWN
This is better for backwards compatibility for now, since we have no way of checking if a property was checked or we simply could not check it. However this is a potential place for improvements. Signed-off-by: František Nečas <[email protected]>
1 parent fdc3a09 commit 7823ea8

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/2ls/summary_checker_ai.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ resultt summary_checker_ait::operator()(
3131

3232
// properties
3333
property_map=initialize_properties(goto_model);
34+
set_properties_unknown();
3435

3536
resultt result=resultt::UNKNOWN;
3637
bool finished=false;

src/2ls/summary_checker_base.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ void summary_checker_baset::SSA_functions(
7070

7171
// properties
7272
property_map=initialize_properties(goto_model);
73+
set_properties_unknown();
7374
}
7475

7576
void summary_checker_baset::summarize(
@@ -239,7 +240,7 @@ void summary_checker_baset::check_properties(
239240
}
240241

241242
// do not recheck properties that have already been decided
242-
if(property_map.at(property_id).status!=property_statust::NOT_CHECKED)
243+
if(property_map.at(property_id).status!=property_statust::UNKNOWN)
243244
continue;
244245

245246
// TODO: some properties do not show up in initialize_property_map

src/2ls/summary_checker_base.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ class summary_checker_baset:public messaget
116116
const exprt::operandst& loophead_selects,
117117
incremental_solvert&);
118118

119+
// FIXME: This is a backwards-compatible hack. CPROVER introduced property
120+
// status NOT_CHECKED (previously there was only UNKNOWN). Adjust
121+
// 2LS to also differentiate between unknown properties and properties
122+
// that were not checked at all.
123+
inline void set_properties_unknown()
124+
{
125+
for(auto &property : property_map)
126+
if(property.second.status==property_statust::NOT_CHECKED)
127+
property.second.status=property_statust::UNKNOWN;
128+
}
129+
119130
friend graphml_witness_extt;
120131
};
121132

0 commit comments

Comments
 (0)