TLC passes property but the state is not existed.

huangapple go评论106阅读模式
英文:

TLC passes property but the state is not existed

问题

我是TLA+的新用户。以下的代码可能有点傻。这是我私有代码的精简版本。在下面的代码中没有将END赋值给s,但Prop在TLC模型检查中通过而没有错误。

我无法弄清楚为什么它会通过。我的代码可能存在问题。有人可以解释一下吗?TLA+版本是1.7.1。操作系统是Ubuntu 20.04。谢谢。

英文:

I'm a new user of TLA+. The following code might be silly. It's a narrowed-down version of my private code.
There are no lines assigning END to s on the following code but the Prop passes without error on TLC model check.

----------------------------- MODULE notExisted -----------------------------
EXTENDS Sequences
VARIABLES s, q

Init == /\ s = "S0"
        /\ q = <<>>

sub_nxt == /\ q' = Append(q, "wow")
           /\ UNCHANGED<<s>>

Next == \/ /\ s = "S0"
           /\ s' = "S1"
           /\ UNCHANGED<<q>>

Spec == /\ Init
        /\ [][Next]_<<s,q>>
        /\ SF_<<s,q>>(sub_nxt)

Prop == []<>(s = "END")

=============================================================================

I can't figure out why it passes. There might be bad pattern on my code.
Can anyone explain?
The TLA+ version is 1.7.1.
The OS is Ubuntu 20.04.
Thanks.

答案1

得分: 0

这是一个自问自答。

我查阅了指定系统的"14.3.5 有限性检查的限制",最终弄清楚了问题所在。我认为...
因为规范是有限的,而sub_nxt始终为真,所以SF为假。
在这种情况下,SF_<<s, q>>(sub_nxt) => []<>(s = "END")是真的。
当A为假时,A => B是真的。

我还尝试了以下内容,也通过了。

EXTENDS Integers
VARIABLE x

Spec == (x=0) /\ [][x' = x + 2 /\ x < 10]_x /\ WF_x(x' = x + 2)

Prop == []<>(x=1)

=============================================================================
英文:

It is a self-answer.
I checked Specifying Systems "14.3.5 Limitations of Liveness Checking" and finally figured out what was wrong. I think...
The SF is False since the Spec is finite and sub_nxt always true.
In that case, the SF_&lt;&lt;s,q&gt;&gt;(sub_nxt) =&gt; []&lt;&gt;(s = &quot;END&quot;) is true.
The A =&gt; B is true when A is false.

I've also tried following and it also passes.

--------------------------- MODULE LimOfLivCheck ---------------------------
EXTENDS Integers
VARIABLE x

Spec == (x=0) /\ [][x&#39; = x + 2 /\ x &lt; 10]_x /\ WF_x(x&#39; = x + 2)

Prop == []&lt;&gt;(x=1)

=============================================================================

huangapple
  • 本文由 发表于 2023年2月26日 23:24:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75572987.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定