Skip to content

Commit e9e770d

Browse files
authored
Merge pull request #767 from diffblue/change-Fphi-encoding
change Fφ BMC encoding
2 parents fb9a9d4 + 07eefa5 commit e9e770d

File tree

6 files changed

+43
-17
lines changed

6 files changed

+43
-17
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
KNOWNBUG
1+
CORE
22
eventually4.sv
33
--bound 2
44
^EXIT=0$
55
^SIGNAL=0$
66
--
77
^warning: ignoring
88
--
9-
Property gives counterexample but should pass.

regression/verilog/SVA/sva_iff2.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module main(input a, b);
22

3-
// p0: assert property ((always a) iff (always a));
3+
p0: assert property ((always a) iff (always a));
44
p1: assert property ((eventually[0:1] a) iff (eventually[0:1] a));
5-
// p2: assert property ((s_eventually a) iff (s_eventually a));
5+
p2: assert property ((s_eventually a) iff (s_eventually a));
66
p3: assert property ((a until b) iff (a until b));
77
// p4: assert property ((a s_until b) iff (a s_until a));
88
p5: assert property ((a until_with b) iff (a until_with b));
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
sva_implies2.sv
3+
--bound 2
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
--
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module main(input a, b);
2+
3+
p0: assert property ((always a) implies (always a));
4+
p1: assert property ((a or (always b)) implies (a or (always b)));
5+
p2: assert property ((eventually[0:1] a) implies (eventually[0:1] a));
6+
p3: assert property ((s_eventually a) implies (s_eventually a));
7+
p4: assert property ((a until b) implies (a until b));
8+
// p5: assert property ((a s_until b) implies (a s_until a));
9+
p6: assert property ((a until_with b) implies (a until_with b));
10+
p7: assert property ((a s_until_with b) implies (a s_until_with a));
11+
12+
endmodule

src/temporal-logic/normalize_property.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ exprt normalize_property_rec(exprt expr)
9191
}
9292
else if(expr.id() == ID_sva_cycle_delay_plus)
9393
{
94-
expr = sva_s_eventually_exprt{
95-
sva_s_nexttime_exprt{to_sva_cycle_delay_plus_expr(expr).op()}};
94+
expr = sva_s_nexttime_exprt{
95+
sva_s_eventually_exprt{to_sva_cycle_delay_plus_expr(expr).op()}};
9696
}
9797
else if(expr.id() == ID_sva_cycle_delay_star)
9898
{

src/trans-word-level/property.cpp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,19 @@ static obligationst property_obligations_rec(
256256

257257
obligationst obligations;
258258

259+
// Traces with any φ state from "current" onwards satisfy Fφ
260+
exprt::operandst phi_disjuncts;
261+
262+
phi_disjuncts.reserve(numeric_cast_v<std::size_t>(no_timeframes - current));
263+
264+
for(mp_integer j = current; j < no_timeframes; ++j)
265+
{
266+
auto tmp = property_obligations_rec(phi, j, no_timeframes);
267+
phi_disjuncts.push_back(tmp.conjunction().second);
268+
}
269+
270+
auto phi_disjunction = disjunction(phi_disjuncts);
271+
259272
// Counterexamples to Fφ must have a loop.
260273
// We consider l-k loops with l<k.
261274
for(mp_integer k = current + 1; k < no_timeframes; ++k)
@@ -265,19 +278,13 @@ static obligationst property_obligations_rec(
265278
//
266279
// (1) There is a loop from timeframe k back to
267280
// some earlier state l with current<=l<k.
268-
// (2) No state j with current<=j<=k to the end of the
269-
// lasso satisfies 'φ'.
281+
// (2) No state j with current<=j<no_timeframes satisfies 'φ'.
282+
// The weaker alternative current<=j<=k yields counterexamples
283+
// that exhibit a ¬φ loop, but are then followed by a φ state.
270284
for(mp_integer l = current; l < k; ++l)
271285
{
272-
exprt::operandst disjuncts = {not_exprt(lasso_symbol(l, k))};
273-
274-
for(mp_integer j = current; j <= k; ++j)
275-
{
276-
auto tmp = property_obligations_rec(phi, j, no_timeframes);
277-
disjuncts.push_back(tmp.conjunction().second);
278-
}
279-
280-
obligations.add(k, disjunction(disjuncts));
286+
auto tmp = or_exprt{not_exprt(lasso_symbol(l, k)), phi_disjunction};
287+
obligations.add(k, std::move(tmp));
281288
}
282289
}
283290

0 commit comments

Comments
 (0)