Relational Join and Operators in Alloy

和自甴很熟 提交于 2019-12-13 07:19:15

问题


I've been going over Alloy in general and found some concepts that I need some clearance on.

First of all, the . (Dot Join). I got how it works for trivial examples but in a case like this:

sig B {}
sig A {
rel: B -> C
}
sig C {
rel1: B -> A
}
rel = {(a1,b1,c1), (a2,b2,c2)}
rel1 = {(c1,b1,a1),(c2,b2,a2)}
rel.rel1 = {(a1,b1,b1,a1),(a2,b2,b2,a2)}
rel1.rel = {(c1,b1,b1,c1),(c2,b2,b2,c2)

I don't get the result of rel.rel1 or rel1.rel. Can somebody explain how it works please?

I am also having problems with <: and >: operators.

Thanks in advance.


回答1:


This is explained in detail with lots of examples in my book (Software Abstractions, MIT Press, 2012).

Also, you might find these slides from an old talk helpful:

From slide 80 on, there's an extended example of various dot joins.



来源:https://stackoverflow.com/questions/35253014/relational-join-and-operators-in-alloy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!