首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TLA+错误:不变量不变量不是状态谓词

TLA+错误:不变量不变量不是状态谓词
EN

Stack Overflow用户
提问于 2021-03-04 04:01:07
回答 1查看 122关注 0票数 2

在我的规范中,我尝试检查序列中的更改是否为-1、0或1。

我对这个不变量的描述如下:

代码语言:javascript
复制
PVariance == Len(waitingRoomP') - Len(waitingRoomP) \in {-1,0,1}
CVariance == Len(waitingRoomC') - Len(waitingRoomC) \in {-1,0,1}

Invariants ==
    /\ TypeInv
    /\ \/ PVariance 
       \/ CVariance

TLC模型检查器输出以下内容:

代码语言:javascript
复制
The invariant Invariants is not a state predicate (one with no primes or temporal operators).
Note that a bug can cause TLC to incorrectly report this error.
If you believe your TLA+ or PlusCal specification to be correct,
please check if this bug described in LevelNode.java starting at line 590ff affects you.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-03-04 04:23:24

waitingRoomP'是下一个状态下的waitingRoomP的值,这意味着PVariance现在是一个动作。不变量不能是动作,它们只能是“纯”运算符。

相反,您可以通过编写[][PVariance]_waitingRoomPPVariance作为操作属性进行检查。这将需要在工具箱中作为时态属性进行检查,而不是不变量。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66464077

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档