【发布时间】:2013-02-02 19:31:38
【问题描述】:
合金考虑
签名队列{ 链接:队列, 元素:诠释 }
考虑到我有一些谓词 predicate-1,当我为队列
为 1 个队列运行 predicate-1,此处为 int 范围
不知道 int 范围的语法是什么
【问题讨论】:
标签: alloy
合金考虑
签名队列{ 链接:队列, 元素:诠释 }
考虑到我有一些谓词 predicate-1,当我为队列
为 1 个队列运行 predicate-1,此处为 int 范围
不知道 int 范围的语法是什么
【问题讨论】:
标签: alloy
语法是
run predicate1 for 1 Queue, 3 Int
整数的范围始终是位宽,因此您不能指定 Int 集正好包含 {-3。 -2。 0. 2};您只能指定一个位宽,并且将使用该位宽内的所有整数。在我上面的示例中,Int 集将包含从 -4 到 3 的所有整数。
【讨论】:
predicate1 中添加条件(或编写附加谓词,并使用util/integer 模块执行run {predicate1 and intLimit} for 1 Queue, 3 Int,以限制使用的整数。