Skip to content

Commit d183e1d

Browse files
authored
Merge pull request #679 from diffblue/sequence3-fix
SVA: fix normalization of ##[*] φ
2 parents a0a6f3a + a0640a9 commit d183e1d

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
@@ -182,7 +182,7 @@ exprt normalize_property(exprt expr)
182182
else if(expr.id() == ID_sva_cycle_delay_plus)
183183
expr = F_exprt{X_exprt{to_sva_cycle_delay_plus_expr(expr).op()}};
184184
else if(expr.id() == ID_sva_cycle_delay_star)
185-
expr = X_exprt{to_sva_cycle_delay_star_expr(expr).op()};
185+
expr = F_exprt{to_sva_cycle_delay_star_expr(expr).op()};
186186
else if(expr.id() == ID_sva_if)
187187
{
188188
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
@@ -37,8 +37,8 @@ Author: Daniel Kroening, [email protected]
3737
/// ¬¬φ --> φ
3838
/// ¬Gφ --> F¬φ
3939
/// ¬Fφ --> G¬φ
40-
/// [*] φ --> F φ
41-
/// [+] φ --> X F φ
40+
/// ##[*] φ --> F φ
41+
/// ##[+] φ --> X F φ
4242
/// strong(φ) --> φ
4343
/// weak(φ) --> φ
4444
/// sva_case --> ? :

0 commit comments

Comments
 (0)