在 Alloy 中对序列建模
Modeling a sequence in Alloy
Alloy 是否具有对序列建模的能力?我可以手动完成(即创建一个 succeeds
关系,并在它适用的地方列出所有 one X
),但想象一下有一个更优雅的方法。
Does Alloy have the ability to model a sequence?
是的。
I could do it manually (i.e create a succeeds relation, and list all the one X where it applies),
是的,在某些情况下这就是您想要的方式。
but imagine there is a more elegant approach.
正如三十二上校已经指出的那样,util/ordering
可以提供帮助,util/seqrel
和 util/sequence
也可以。
但是在 Alloy 4 中,序列的最简单路径是记录在 on the Alloy website 中的 seq
关键字。我相信它是在 Software abstractions 第二版出版后引入的;至少,那里没有 seq
.
的索引条目
Alloy 是否具有对序列建模的能力?我可以手动完成(即创建一个 succeeds
关系,并在它适用的地方列出所有 one X
),但想象一下有一个更优雅的方法。
Does Alloy have the ability to model a sequence?
是的。
I could do it manually (i.e create a succeeds relation, and list all the one X where it applies),
是的,在某些情况下这就是您想要的方式。
but imagine there is a more elegant approach.
正如三十二上校已经指出的那样,util/ordering
可以提供帮助,util/seqrel
和 util/sequence
也可以。
但是在 Alloy 4 中,序列的最简单路径是记录在 on the Alloy website 中的 seq
关键字。我相信它是在 Software abstractions 第二版出版后引入的;至少,那里没有 seq
.