Skip to content

Commit a0640a9

Browse files
committed
SVA: fix normalization of ##[*] φ
This fixes the normalization of ##[*] φ.
1 parent 03d9ee4 commit a0640a9

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

regression/verilog/SVA/sequence3.desc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ CORE
22
sequence3.sv
33
--bound 20 --numbered-trace
44
^\[main\.p0\] ##\[\*\] main\.x == 6: REFUTED$
5-
^Counterexample with 2 states:$
6-
^\[main\.p1\] ##\[\+\] main\.x == 0: REFUTED$
75
^Counterexample with 7 states:$
6+
^\[main\.p1\] ##\[\*\] main\.x == 5: PROVED up to bound 20$
7+
^\[main\.p2\] ##\[\+\] main\.x == 0: REFUTED$
8+
^Counterexample with 7 states:$
9+
^\[main\.p3\] ##\[\+\] main\.x == 5: PROVED up to bound 20$
810
^EXIT=10$
911
^SIGNAL=0$
1012
--

regression/verilog/SVA/sequence3.sv

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ module main;
99
if(x < 5)
1010
x<=x+1;
1111

12-
initial p0: assert property (##[*] x==6); // same as [0:$]
13-
initial p1: assert property (##[+] x==0); // same as [1:$]
12+
// ##[*] is the same as [0:$]
13+
initial p0: assert property (##[*] x==6); // should fail
14+
initial p1: assert property (##[*] x==5); // should pass
15+
16+
// ##[+] is the same as [1:$]
17+
initial p2: assert property (##[+] x==0); // should fail
18+
initial p3: assert property (##[+] x==5); // should pass
1419

1520
endmodule

src/temporal-logic/normalize_property.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ exprt normalize_property(exprt expr)
172172
else if(expr.id() == ID_sva_cycle_delay_plus)
173173
expr = F_exprt{X_exprt{to_sva_cycle_delay_plus_expr(expr).op()}};
174174
else if(expr.id() == ID_sva_cycle_delay_star)
175-
expr = X_exprt{to_sva_cycle_delay_star_expr(expr).op()};
175+
expr = F_exprt{to_sva_cycle_delay_star_expr(expr).op()};
176176
else if(expr.id() == ID_sva_if)
177177
{
178178
auto &sva_if_expr = to_sva_if_expr(expr);

src/temporal-logic/normalize_property.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Author: Daniel Kroening, [email protected]
3535
/// ¬¬φ --> φ
3636
/// ¬Gφ --> F¬φ
3737
/// ¬Fφ --> G¬φ
38-
/// [*] φ --> F φ
39-
/// [+] φ --> X F φ
38+
/// ##[*] φ --> F φ
39+
/// ##[+] φ --> X F φ
4040
/// strong(φ) --> φ
4141
/// weak(φ) --> φ
4242
/// sva_case --> ? :

0 commit comments

Comments
 (0)