Skip to content

Commit 812aafa

Browse files
committed
simplify r_ok
1 parent 33058f0 commit 812aafa

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

regression/cprover/safety/r_ok2.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
r_ok2.c
33
--no-inline --safety
44
^EXIT=10$

src/cprover/simplify_state_expr.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ exprt simplify_ok_expr(
208208
const std::unordered_set<symbol_exprt, irep_hash> &address_taken,
209209
const namespacet &ns)
210210
{
211-
#if 0
212-
const auto &state = src.op0();
213-
const auto &pointer = src.op1();
214-
const auto &size = src.op2();
211+
auto &state = src.op0();
212+
//auto &pointer = src.op1();
213+
//auto &size = src.op2();
215214

215+
#if 0
216216
// rewrite X_ok(p, s)
217217
// --> live_object(p) ∧ offset(p)≥0 ∧ offset(p)+s≤object_size(p)
218218
auto live_object =
@@ -233,21 +233,17 @@ exprt simplify_ok_expr(
233233
plus_exprt(offset_simplified, size_casted), ID_le, object_size_simplified);
234234

235235
return and_exprt(live_object_simplified, lower, upper);
236-
#else
237-
return src;
238236
#endif
239237

240-
#if 0
241238
// A store does not affect the result.
242239
// X_ok(ς[A:=V]), A, S) --> X_ok(ς, A, S)
243-
if(src.op0().id() == ID_update_state)
240+
if(state.id() == ID_update_state)
244241
{
245-
src.op0() = to_update_state_expr(src.op0()).state();
242+
state = to_update_state_expr(state).state();
246243
return std::move(src);
247244
}
248245

249246
return src;
250-
#endif
251247
}
252248

253249
#if 0

0 commit comments

Comments
 (0)