簡體   English   中英

謂詞和合金中的Int

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM