IVAR
我知道 . 中(输入变量)和VAR
(状态变量)之间的区别NuSMV
。但是,我能够理解使用时的反例VAR
,但我不是在其他情况下。
让我用一个例子来展示它。
MODULE main
VAR
v1: 0..20;
v2: 0..20;
v3: 0..100;
INIT
v3 = 0;
TRANS
((v2+v1 = 0) -> (next(v3) = 10)) &
(!(v2+v1 = 0) -> (next(v3) = v1 + v2))
LTLSPEC
G(v3 = 10);
NuSMV 给出的反例(足够清楚)是:
Trace Type: Counterexample
-> State: 1.1 <-
v1 = 0
v2 = 0
v3 = 0
-- Loop starts here
-> State: 1.2 <-
v3 = 10
-> State: 1.3 <-
v1 = 7
v2 = 6
-> State: 1.4 <-
v1 = 0
v2 = 0
v3 = 13
-> State: 1.5 <-
v3 = 10
现在,将 v1 和 v2 更改为 IVAR。
MODULE main
IVAR
v1: 0..20;
v2: 0..20;
VAR
v3: 0..100;
INIT
v3 = 0;
TRANS
((v2+v1 = 0) -> (next(v3) = 10)) &
(!(v2+v1 = 0) -> (next(v3) = v1 + v2))
LTLSPEC
G(v3 = 10);
反例是:
Trace Type: Counterexample
-> State: 1.1 <-
v3 = 0
-> Input: 1.2 <-
v1 = 7
v2 = 3
-- Loop starts here
-> State: 1.2 <-
v3 = 10
-> Input: 1.3 <-
-- Loop starts here
-> State: 1.3 <-
-> Input: 1.4 <-
-- Loop starts here
-> State: 1.4 <-
-> Input: 1.5 <-
-- Loop starts here
-> State: 1.5 <-
-> Input: 1.6 <-
-- Loop starts here
-> State: 1.6 <-
-> Input: 1.7 <-
-> State: 1.7 <-
有人可以解释为什么这个反例如此奇怪吗?它有几个嵌套循环。输出是什么意思?