CSSE 373 -- Formal Methods in Specification and Design Quiz 3 Name:_________________________________________ Grade:______________ 1. Relations in Alloy are a lot like tables in relational databases, but not exactly the same. List three ways in which relations and Alloy differ: * * * 2. Are the following two relations equivalent? _______ * { (N0, D0), (N1, D1), (N2, D2) } * { (N1, D1), (N2, D2), (N0, D0) } Why or why not? 3. Are the following two relations equivalent? _______ * { (N0, D0), (N1, D1), (N2, D2) } * { (D0, N0), (D1, N1), (D2, N2) } Why or why not? 4. What's the difference between sets in Alloy and the usual sets in Math? 5. What is a "scalar"? (continued on back) 6. Why does Alloy use relations for almost everything? 7. What does it mean when we say Alloy doesn't allow higher-order relations? 8. Of the three styles of writing constraints in Alloy, which is the preferred style and why?