Purpose: practice writing expression using the Alloy logic
Do exercise A.1.4 in Appendix A of the text. Some extra guidance:
In Alloy 4, type scopes don’t limit the number of Int instances. To be able to create smaller counterexamples, use the following template model rather than that provided in the text:
// Problem A.1.4
module homework/hw3_1
sig Thing {}
assert union {
all s: set Thing, p, q: Thing->Thing |
s.(p+q) = s.p + s.q
}
check union for 4
s, p, and q. (You can read these from the picture in the visualizer if you reduce the scope enough.)
Do problem A.1.5 in Appendix A of the text. Again, some extra guidance:
Use the following template model rather than that provided in the text:
// Problem A.1.5
module homework/hw3_2
sig Node {}
pred isTree[r: Node -> Node] {
...
}
run isTree for 4
address relation) eventually map to an address.”