[英]Predicates and Int in alloy
我知道在合金中使用謂詞,但以下描述使我有些驚訝:
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])
}
有人可以向我解釋以上內容。
將run {}
添加到模型中,然后輸入{x,y:Int | locationConstraint[x->y]}
{x,y:Int | locationConstraint[x->y]}
進入評估器以獲取結果:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.