@@ -40,6 +40,7 @@ class ebmc_propertiest
40
40
UNKNOWN, // no work done yet
41
41
DISABLED, // turned off by user
42
42
ASSUMED, // property is assumed to be true, unbounded
43
+ UNSUPPORTED, // property is unsupported
43
44
PROVED, // property is true, unbounded
44
45
PROVED_WITH_BOUND, // property is true, with bound
45
46
REFUTED, // property is false, possibly counterexample
@@ -98,24 +99,38 @@ class ebmc_propertiest
98
99
return status == statust::FAILURE;
99
100
}
100
101
102
+ bool is_unsupported () const
103
+ {
104
+ return status == statust::UNSUPPORTED;
105
+ }
106
+
101
107
bool is_inconclusive () const
102
108
{
103
109
return status == statust::INCONCLUSIVE;
104
110
}
105
111
112
+ void assumed ()
113
+ {
114
+ status = statust::ASSUMED;
115
+ failure_reason = {};
116
+ }
117
+
106
118
void unknown ()
107
119
{
108
120
status = statust::UNKNOWN;
121
+ failure_reason = {};
109
122
}
110
123
111
124
void disable ()
112
125
{
113
126
status = statust::DISABLED;
127
+ failure_reason = {};
114
128
}
115
129
116
130
void proved ()
117
131
{
118
132
status = statust::PROVED;
133
+ failure_reason = {};
119
134
}
120
135
121
136
void proved_with_bound (std::size_t _bound)
@@ -127,17 +142,20 @@ class ebmc_propertiest
127
142
void refuted ()
128
143
{
129
144
status = statust::REFUTED;
145
+ failure_reason = {};
130
146
}
131
147
132
148
void refuted_with_bound (std::size_t _bound)
133
149
{
134
150
status = statust::REFUTED_WITH_BOUND;
135
151
bound = _bound;
152
+ failure_reason = {};
136
153
}
137
154
138
155
void drop ()
139
156
{
140
157
status = statust::DROPPED;
158
+ failure_reason = {};
141
159
}
142
160
143
161
void failure (const std::optional<std::string> &reason = {})
@@ -146,9 +164,16 @@ class ebmc_propertiest
146
164
failure_reason = reason;
147
165
}
148
166
167
+ void unsupported (const std::optional<std::string> &reason = {})
168
+ {
169
+ status = statust::UNSUPPORTED;
170
+ failure_reason = reason;
171
+ }
172
+
149
173
void inconclusive ()
150
174
{
151
175
status = statust::INCONCLUSIVE;
176
+ failure_reason = {};
152
177
}
153
178
154
179
std::string status_as_string () const ;
@@ -164,16 +189,30 @@ class ebmc_propertiest
164
189
{
165
190
return ::is_exists_path (original_expr);
166
191
}
192
+
193
+ bool is_assumption () const
194
+ {
195
+ return original_expr.id () == ID_sva_assume;
196
+ }
167
197
};
168
198
169
199
typedef std::list<propertyt> propertiest;
170
200
propertiest properties;
171
201
172
- bool has_unknown_property () const
202
+ bool has_unfinished_property () const
173
203
{
174
204
for (const auto &p : properties)
175
- if (p.is_unknown ())
205
+ {
206
+ if (p.is_assumption ())
207
+ {
208
+ }
209
+ else if (
210
+ p.is_unknown () || p.is_unsupported () || p.is_failure () ||
211
+ p.is_inconclusive ())
212
+ {
176
213
return true ;
214
+ }
215
+ }
177
216
178
217
return false ;
179
218
}
@@ -209,12 +248,40 @@ class ebmc_propertiest
209
248
return result;
210
249
}
211
250
212
- void reset_failure_to_unknown ()
251
+ // / Resets properties/assumptions in FAILURE state to
252
+ // / ASSUMED/UNKNOWN respectively.
253
+ void reset_failure ()
213
254
{
214
255
for (auto &p : properties)
215
256
if (p.is_failure ())
257
+ {
258
+ if (p.is_assumption ())
259
+ p.assumed ();
260
+ else
261
+ p.unknown ();
262
+ }
263
+ }
264
+
265
+ // / Resets properties in INCONCLUSIVE state to UNKNOWN.
266
+ void reset_inconclusive ()
267
+ {
268
+ for (auto &p : properties)
269
+ if (p.is_inconclusive ())
216
270
p.unknown ();
217
271
}
272
+
273
+ // / Resets properties in UNSUPPORTED state to UNKNOWN/ASSUMED.
274
+ void reset_unsupported ()
275
+ {
276
+ for (auto &p : properties)
277
+ if (p.is_unsupported ())
278
+ {
279
+ if (p.is_assumption ())
280
+ p.assumed ();
281
+ else
282
+ p.unknown ();
283
+ }
284
+ }
218
285
};
219
286
220
287
#endif // CPROVER_EBMC_PROPERTIES_H
0 commit comments