检查系统是否通过了所有状态

时间:2017-12-05 21:32:12

标签: tla+

变量state代表系统的状态,例如state \in {"ready", "prepare", "do", "cleanup", "done"}。如何表达state最终应该通过所有五个状态(以任何顺序)的条件?

工作示例(接受的答案):

EXTENDS Naturals
VARIABLE n
Init == n = 1
Next == IF n < 3 THEN n' = n + 1 ELSE n' = n
Spec == Init /\ [][Next]_<<n>> /\ WF_<<n>>(Next)
Check == \A s \in {1,2,3}: <>(s = n)    \* This goes: Model Overview >
                                        \* > "What to check?" > Properties

1 个答案:

答案 0 :(得分:2)

给定$related_categories_posts = Post::whereHas('categories', function ($query) use ($post){ $query->where('category_name', $post->categories->category_name); }) ,您可以使用

检查它是否达到某个给定状态
States = {"ready", "prepare", "do", "cleanup", "done"}

你可以通过

检查它是否到达所有州
<>(state = "ready")