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