简体   繁体   中英

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 thinking was that, eg

MySig = {N0,N1,N2} iden = {(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.

However, I get this model:

model found by alloy

Ie one where my_rel is reflexive.

my_rel not in iden says that my_rel is not a subset of iden . Since N0 -> N1 in my_rel and N0 -> N1 not in iden , my_rel isn't a subset and the fact still holds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM