I come from a C/C++ background and am trying to understand how are predicates/assertions run/checked in Alloy. (a) If I have more than one predicates and I want to run both of them, when I run the first predicate how do I ensure that the conditions related to constraint in my other predicate remain static? I am simply puzzled on how do you run multiple predicates. (b) Same for assertions. Do I have to run check of each assertion?
Thanks for any feedback on this.
You can have an arbitrary formula in your "run" commands, so in there you can conjoin as many predicates as you want. Here is an example:
With assertions, I think you have to check them one by one, e.g.,
However, you can turn your assertions into predicates, and then you can form arbitrary formulas from them in the body of a "check" command, e.g.,