Skip to content

Commit bf68e9d

Browse files
committed
SMV: the LTL release operator is "V"
NuSMV's LTL release operator is "V", not "R".
1 parent 29491d5 commit bf68e9d

15 files changed

+131
-11
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* SystemVerilog: typedefs from package scopes
44
* SystemVerilog: assignment patterns with keys for structs
5+
* SMV: LTL V operator
56

67
# EBMC 5.5
78

regression/smv/LTL/smv_ltlspec_R1.desc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
CORE
22
smv_ltlspec_R1.smv
33
--bound 10
4-
^\[.*\] x >= 1 R x = 1: PROVED up to bound 10$
5-
^\[.*\] FALSE R x != 4: PROVED up to bound 10$
6-
^\[.*\] x = 2 R x = 1: REFUTED$
7-
^\[.*\] x >= 1 R x = 1 & FALSE R x != 4: PROVED up to bound 10$
8-
^\[.*\] x = 2 R x = 1 & x >= 1 R x = 1: REFUTED$
9-
^\[.*\] x = 2 R x = 1 \| x >= 1 R x = 1: PROVED up to bound 10$
4+
^\[.*\] x >= 1 V x = 1: PROVED up to bound 10$
5+
^\[.*\] FALSE V x != 4: PROVED up to bound 10$
6+
^\[.*\] x = 2 V x = 1: REFUTED$
7+
^\[.*\] x >= 1 V x = 1 & FALSE V x != 4: PROVED up to bound 10$
8+
^\[.*\] x = 2 V x = 1 & x >= 1 V x = 1: REFUTED$
9+
^\[.*\] x = 2 V x = 1 \| x >= 1 V x = 1: PROVED up to bound 10$
1010
^EXIT=10$
1111
^SIGNAL=0$
1212
--

regression/smv/LTL/smv_ltlspec_R2.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
KNOWNBUG broken-smt-backend
22
smv_ltlspec_R2.smv
33
--bound 10
4-
^\[.*\] FALSE R x != 3: REFUTED$
4+
^\[.*\] FALSE V x != 3: REFUTED$
55
^Counterexample with 3 states:$
66
^x@0 = 1$
77
^x@1 = 2$

regression/smv/LTL/smv_ltlspec_R3.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CORE
22
smv_ltlspec_R3.smv
33
--bound 1
4-
^\[.*\] FALSE R x != 3: PROVED up to bound 1$
4+
^\[.*\] FALSE V x != 3: PROVED up to bound 1$
55
^EXIT=0$
66
^SIGNAL=0$
77
--

regression/smv/LTL/smv_ltlspec_R4.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CORE
22
smv_ltlspec_R4.smv
33
--bound 10
4-
^\[.*\] FALSE R x != 0: PROVED up to bound 10$
4+
^\[.*\] FALSE V x != 0: PROVED up to bound 10$
55
^EXIT=0$
66
^SIGNAL=0$
77
--
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CORE
2+
smv_ltlspec_V1.smv
3+
--bound 10
4+
^\[.*\] x >= 1 V x = 1: PROVED up to bound 10$
5+
^\[.*\] FALSE V x != 4: PROVED up to bound 10$
6+
^\[.*\] x = 2 V x = 1: REFUTED$
7+
^\[.*\] x >= 1 V x = 1 & FALSE V x != 4: PROVED up to bound 10$
8+
^\[.*\] x = 2 V x = 1 & x >= 1 V x = 1: REFUTED$
9+
^\[.*\] x = 2 V x = 1 \| x >= 1 V x = 1: PROVED up to bound 10$
10+
^EXIT=10$
11+
^SIGNAL=0$
12+
--
13+
^warning: ignoring
14+
--

regression/smv/LTL/smv_ltlspec_V1.smv

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MODULE main
2+
3+
VAR x : 0..10;
4+
5+
ASSIGN
6+
init(x) := 1;
7+
8+
next(x) :=
9+
case
10+
x>=3 : 3;
11+
TRUE: x+1;
12+
esac;
13+
14+
LTLSPEC x >= 1 V x = 1 -- should pass
15+
LTLSPEC FALSE V x != 4 -- should pass
16+
LTLSPEC x = 2 V x = 1 -- should fail
17+
LTLSPEC (x >= 1 V x = 1) & (FALSE V x != 4) -- should pass
18+
LTLSPEC (x = 2 V x = 1) & (x >= 1 V x = 1) -- should fail
19+
LTLSPEC (x = 2 V x = 1) | (x >= 1 V x = 1) -- should pass
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
KNOWNBUG broken-smt-backend
2+
smv_ltlspec_V2.smv
3+
--bound 10
4+
^\[.*\] FALSE V x != 3: REFUTED$
5+
^Counterexample with 3 states:$
6+
^x@0 = 1$
7+
^x@1 = 2$
8+
^x@2 = 3$
9+
^EXIT=10$
10+
^SIGNAL=0$
11+
--
12+
^warning: ignoring
13+
--
14+
The trace has too many states.

regression/smv/LTL/smv_ltlspec_V2.smv

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
MODULE main
2+
3+
VAR x : 0..3;
4+
5+
ASSIGN
6+
init(x) := 1;
7+
8+
next(x) :=
9+
case
10+
x=3 : 3;
11+
TRUE: x+1;
12+
esac;
13+
14+
-- trace should be 1, 2, 3
15+
LTLSPEC FALSE V x != 3
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
smv_ltlspec_V3.smv
3+
--bound 1
4+
^\[.*\] FALSE V x != 3: PROVED up to bound 1$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring
9+
--

regression/smv/LTL/smv_ltlspec_V3.smv

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
MODULE main
2+
3+
VAR x : 0..3;
4+
5+
ASSIGN
6+
init(x) := 1;
7+
8+
next(x) :=
9+
case
10+
x=3 : 3;
11+
TRUE: x+1;
12+
esac;
13+
14+
-- trace should be 1, 2, 3
15+
-- hence no trace with k=1
16+
LTLSPEC FALSE V x != 3
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
smv_ltlspec_V4.smv
3+
--bound 10
4+
^\[.*\] FALSE V x != 0: PROVED up to bound 10$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring
9+
--

regression/smv/LTL/smv_ltlspec_V4.smv

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
MODULE main
2+
3+
VAR x : 0..3;
4+
5+
ASSIGN
6+
init(x) := 1;
7+
8+
next(x) :=
9+
case
10+
x=3 : 3;
11+
TRUE: x+1;
12+
esac;
13+
14+
-- should pass
15+
LTLSPEC FALSE V x != 0

src/smvlang/expr2smv.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ bool expr2smvt::convert(
566566

567567
else if(
568568
src.id() == ID_AU || src.id() == ID_EU || src.id() == ID_AR ||
569-
src.id() == ID_ER || src.id() == ID_U || src.id() == ID_R)
569+
src.id() == ID_ER || src.id() == ID_U)
570570
{
571571
return convert_binary(
572572
to_binary_expr(src),
@@ -575,6 +575,13 @@ bool expr2smvt::convert(
575575
precedence = precedencet::TEMPORAL);
576576
}
577577

578+
else if(src.id() == ID_R)
579+
{
580+
// LTL release is "V" in NuSMV
581+
return convert_binary(
582+
to_binary_expr(src), dest, "V", precedence = precedencet::TEMPORAL);
583+
}
584+
578585
else if(src.id() == ID_if)
579586
return convert_if(to_if_expr(src), dest, precedencet::IF);
580587

src/smvlang/parser.y

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static void new_module(YYSTYPE &module)
284284
%left OR_Token
285285
%left AND_Token
286286
%left NOT_Token
287-
%left EX_Token AX_Token EF_Token AF_Token EG_Token AG_Token E_Token A_Token U_Token R_Token F_Token G_Token X_Token
287+
%left EX_Token AX_Token EF_Token AF_Token EG_Token AG_Token E_Token A_Token U_Token R_Token V_Token F_Token G_Token X_Token
288288
%left EQUAL_Token NOTEQUAL_Token LT_Token GT_Token LE_Token GE_Token
289289
%left union_Token
290290
%left IN_Token NOTIN_Token
@@ -621,6 +621,7 @@ term : variable_name
621621
| X_Token term { init($$, ID_X); mto($$, $2); }
622622
| term U_Token term { binary($$, $1, ID_U, $3); }
623623
| term R_Token term { binary($$, $1, ID_R, $3); }
624+
| term V_Token term { binary($$, $1, ID_R, $3); }
624625
| term EQUAL_Token term { binary($$, $1, ID_equal, $3); }
625626
| term NOTEQUAL_Token term { binary($$, $1, ID_notequal, $3); }
626627
| term LT_Token term { binary($$, $1, ID_lt, $3); }

0 commit comments

Comments
 (0)