@@ -70,14 +70,17 @@ Function: property
70
70
71
71
\*******************************************************************/
72
72
73
- void property (
73
+ std::map<std:: size_t , exprt::operandst> property_obligations (
74
74
const exprt &property_expr,
75
- exprt::operandst &prop_handles,
76
75
message_handlert &message_handler,
77
76
decision_proceduret &solver,
78
77
std::size_t no_timeframes,
79
78
const namespacet &ns)
80
79
{
80
+ PRECONDITION (no_timeframes > 0 );
81
+
82
+ std::map<std::size_t , exprt::operandst> obligations;
83
+
81
84
messaget message (message_handler);
82
85
83
86
// Initial state only property?
@@ -87,14 +90,9 @@ void property(
87
90
property_expr.id () == ID_sva_nexttime ||
88
91
property_expr.id () == ID_sva_s_nexttime)
89
92
{
90
- prop_handles.resize (no_timeframes, true_exprt ());
91
- if (no_timeframes > 0 )
92
- {
93
- exprt tmp = instantiate (property_expr, 0 , no_timeframes, ns);
94
- prop_handles.push_back (solver.handle (tmp));
95
- }
96
-
97
- return ;
93
+ exprt tmp = instantiate (property_expr, 0 , no_timeframes, ns);
94
+ obligations[0 ].push_back (solver.handle (tmp));
95
+ return obligations;
98
96
}
99
97
100
98
// We want AG p.
@@ -115,7 +113,45 @@ void property(
115
113
instantiate (p, c, no_timeframes, ns);
116
114
117
115
auto handle = solver.handle (tmp);
118
- prop_handles.push_back (std::move (handle));
116
+ obligations[c].push_back (std::move (handle));
117
+ }
118
+
119
+ return obligations;
120
+ }
121
+
122
+ /* ******************************************************************\
123
+
124
+ Function: property
125
+
126
+ Inputs:
127
+
128
+ Outputs:
129
+
130
+ Purpose:
131
+
132
+ \*******************************************************************/
133
+
134
+ void property (
135
+ const exprt &property_expr,
136
+ exprt::operandst &prop_handles,
137
+ message_handlert &message_handler,
138
+ decision_proceduret &solver,
139
+ std::size_t no_timeframes,
140
+ const namespacet &ns)
141
+ {
142
+ // The first element of the pair is the length of the
143
+ // counterexample, and the second is the condition that
144
+ // must be valid for the property to hold.
145
+ auto obligations = property_obligations (
146
+ property_expr, message_handler, solver, no_timeframes, ns);
147
+
148
+ // Map obligations onto timeframes.
149
+ prop_handles.resize (no_timeframes, true_exprt ());
150
+ for (auto &obligation_it : obligations)
151
+ {
152
+ auto t = obligation_it.first ;
153
+ DATA_INVARIANT (t < no_timeframes, " obligation must have valid timeframe" );
154
+ prop_handles[t] = conjunction (obligation_it.second );
119
155
}
120
156
}
121
157
0 commit comments