【发布时间】:2020-04-29 20:20:55
【问题描述】:
这个问题可能有一个是/否的答案。考虑 sn-p:
sig A { my : lone B }
sig B { }
pred single1 [x:A]{ // defined using []
#x.my = 0
}
pred single2 (x:A){ // defined using ()
#x.my = 0
}
// these two runs produce the exact same results
run single1 for 3 but exactly 1 A
run single2 for 3 but exactly 1 A
check oneOfTheMostTrivialQuestionsOnStackOverflow { all x: A |
single1[x] iff single2[x] // pred calls use [], so as expected, single2(x) would cause a syntax error
} for 3000 but exactly 1 A // assertion holds :)
single1 和 single2 完全一样吗?
他们似乎是,但我错过了什么吗?
【问题讨论】:
标签: alloy