【问题标题】:run command scope in alloy在合金中运行命令范围
【发布时间】:2013-02-02 19:31:38
【问题描述】:

合金考虑

签名队列{ 链接:队列, 元素:诠释 }

考虑到我有一些谓词 predicate-1,当我为队列

为 1 个队列运行 predicate-1,此处为 int 范围

不知道 int 范围的语法是什么

【问题讨论】:

    标签: alloy


    【解决方案1】:

    语法是

    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,以限制使用的整数。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多