Skip to content

Commit 81a0c57

Browse files
author
martin
committed
Make the property interface to --verify history-aware
This should improve the quality of results that are given if a more involved history.
1 parent f0f7dbf commit 81a0c57

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

src/goto-analyzer/static_verifier.cpp

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -180,33 +180,31 @@ void static_verifier(
180180
{
181181
auto &property_status = property.second.status;
182182
const goto_programt::const_targett &property_location = property.second.pc;
183-
exprt condition = property_location->get_condition();
184-
const std::shared_ptr<const ai_baset::statet> predecessor_state_copy =
185-
ai.abstract_state_before(property_location);
186-
// simplify the condition given the domain information we have
187-
// about the state right before the assertion is evaluated
188-
predecessor_state_copy->ai_simplify(condition, ns);
189-
// if the condition simplifies to true the assertion always succeeds
190-
if(condition.is_true())
183+
184+
auto result = check_assertion(ai, property_location, "unused", ns);
185+
186+
switch(result.status)
191187
{
188+
case static_verifier_resultt::TRUE:
189+
// if the condition simplifies to true the assertion always succeeds
192190
property_status = property_statust::PASS;
193-
}
194-
// if the condition simplifies to false the assertion always fails
195-
else if(condition.is_false())
196-
{
191+
break;
192+
case static_verifier_resultt::FALSE:
193+
// if the condition simplifies to false the assertion always fails
197194
property_status = property_statust::FAIL;
198-
}
199-
// if the domain state is bottom then the assertion is definitely
200-
// unreachable
201-
else if(predecessor_state_copy->is_bottom())
202-
{
195+
break;
196+
case static_verifier_resultt::BOTTOM:
197+
// if the domain state is bottom then the assertion is definitely
198+
// unreachable
203199
property_status = property_statust::NOT_REACHABLE;
204-
}
205-
// if the condition isn't definitely true, false or unreachable
206-
// we don't know whether or not it may fail
207-
else
208-
{
200+
break;
201+
case static_verifier_resultt::UNKNOWN:
202+
// if the condition isn't definitely true, false or unreachable
203+
// we don't know whether or not it may fail
209204
property_status = property_statust::UNKNOWN;
205+
break;
206+
default:
207+
UNREACHABLE;
210208
}
211209
}
212210
}

0 commit comments

Comments
 (0)