[英]Alloy - Irreflexivity
I just started using Alloy.我刚开始使用合金。 I have a question about the following minimal example:
我对以下最小示例有疑问:
module test
abstract sig MySig {
my_rel : set MySig
}
//fact my_rel_irrefl {no iden & my_rel } // this works
fact my_rel_irrelfl {my_rel not in iden} // this does not work
run {}
Why is the second my_rel_irrelfl not working?为什么第二个 my_rel_irrelfl 不起作用? My thinking was that, eg
我的想法是,例如
MySig = {N0,N1,N2} iden = {(N0,N0),(N1,N1),(N2,N2)} MySig = {N0,N1,N2} 同义词 = {(N0,N0),(N1,N1),(N2,N2)}
If there is an element (x,x), where x in MySig in the relation my_rel then it has to be in iden as well.如果有一个元素 (x,x),其中 MySig 中的 x 在关系 my_rel 中,那么它也必须在 iden 中。
However, I get this model:但是,我得到了这个 model:
model found by alloy model 合金发现
Ie one where my_rel is reflexive.即 my_rel 是自反的。
my_rel not in iden
says that my_rel
is not a subset of iden
. my_rel not in iden
表示my_rel
不是iden
的子集。 Since N0 -> N1 in my_rel
and N0 -> N1 not in iden
, my_rel
isn't a subset and the fact still holds.由于
N0 -> N1 in my_rel
N0 -> N1 和N0 -> N1 not in iden
iden 中, my_rel
不是子集,事实仍然成立。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.