@@ -27,6 +27,49 @@ struct static_verifier_resultt
27
27
irep_idt function_id;
28
28
};
29
29
30
+ void static_verifier (
31
+ const abstract_goto_modelt &abstract_goto_model,
32
+ const ai_baset &ai,
33
+ propertiest &properties)
34
+ {
35
+ const namespacet ns{abstract_goto_model.get_symbol_table ()};
36
+ // this is mutable because we want to change the property status
37
+ // in this loop
38
+ for (auto &property : properties)
39
+ {
40
+ auto &property_status = property.second .status ;
41
+ const goto_programt::const_targett &property_location = property.second .pc ;
42
+ exprt condition = property_location->get_condition ();
43
+ const std::unique_ptr<ai_baset::statet> predecessor_state_copy =
44
+ ai.abstract_state_before (property_location);
45
+ // simplify the condition given the domain information we have
46
+ // about the state right before the assertion is evaluated
47
+ predecessor_state_copy->ai_simplify (condition, ns);
48
+ // if the condition simplifies to true the assertion always succeeds
49
+ if (condition.is_true ())
50
+ {
51
+ property_status = property_statust::PASS;
52
+ }
53
+ // if the condition simplifies to false the assertion always fails
54
+ else if (condition.is_false ())
55
+ {
56
+ property_status = property_statust::FAIL;
57
+ }
58
+ // if the domain state is bottom then the assertion is definitely
59
+ // unreachable
60
+ else if (predecessor_state_copy->is_bottom ())
61
+ {
62
+ property_status = property_statust::NOT_REACHABLE;
63
+ }
64
+ // if the condition isn't definitely true, false or unreachable
65
+ // we don't know whether or not it may fail
66
+ else
67
+ {
68
+ property_status = property_statust::UNKNOWN;
69
+ }
70
+ }
71
+ }
72
+
30
73
// / Makes a status message string from a status.
31
74
static const char *message (const static_verifier_resultt::statust &status)
32
75
{
0 commit comments