4

My question is whether the semantics of () in the declaration of fields had changed in Alloy 4.2.

I read in "Software Abstractions" that

addr: (Book -> Name) -> lone Addr

means that the relation addr associates at most one address with each address book and name pair but this does not hold when running Alloy 4.2

For instance, for

sig Book, Name, Addr  {}
sig AddBX {
  addr : (Book -> Name) -> lone Addr
}

run XRun {
  some B : Book, N : Name, X : AddBX | #X.addr[B][N] = 2
} 

Alloy 4.2 finds a model instance which has for instance AddBX$2 with

Book$1 ->Name$0 ->Addr$0
Book$1 ->Name$0 ->Addr$1
Book$1 ->Name$0 ->Addr$2

If I use instead

addr : Book -> Name -> lone Addr

then no instance for the same run is found. This seems to indicate that in Alloy 4.2 this is how to declare that the relation addr associates at most one address with each address book and name pair but I would like to have a confirmation for this.

4

1 回答 1

5

这实际上是 v4.2 中的一个 bug,正确的行为是 Alloy4.1.10 实现的。

我创建了修复此问题的 v4.2 快照,您可以在此处下载:

http://alloy.mit.edu/alloy/downloads/alloy4.2_2013-01-28.jar

感谢您报告此错误。

于 2013-01-28T17:00:01.330 回答