Reputation: 6753
I know the use of predicates in alloy but i was a little surprised by the below description:
pred locationConstraint(loc: Int -> Int){
loc in (Int[0] + Int[1] + Int[2] + Int[3] + Int[4] + Int[5] + Int[6]) -> (Int[2] + Int[3])
+ (Int[2] + Int[3]) -> (Int[0] + Int[1] + Int[2] + Int[3] + Int[4] + Int[5])
}
Can someone please explain the above to me.
Upvotes: 2
Views: 357
Reputation: 32629
Add run {}
to your model, and type {x,y:Int | locationConstraint[x->y]}
into the evaluator to get the result:
Upvotes: 1