问题
In alloy consider
sig Queue{ link : Queue, elem: Int }
consider that I have some predicate predicate-1, How would I define scope when I run predicate-1 for Queue <=1 , int ={-3,-2,0,2}. I have not listed the predicate here
run predicate-1 for 1 Queue, int scope here
don't know what would be the syntax for int scope
回答1:
The syntax is
run predicate1 for 1 Queue, 3 Int
The scope for integers is always a bitwidth, so you can't specify that the Int set contains exactly {-3. -2. 0. 2}; you can only specify a bitwidth, and all integers within that bitwidth will be used. In my example above, the Int set will contain all integers from -4 to 3.
来源:https://stackoverflow.com/questions/14665629/run-command-scope-in-alloy