Dienstag, 4. Dezember 2012

How to run Alloy from the command line

I've recently started evaluating my Alloy models by script. This is a challenge, because Alloy does not offer simple command line parameters in order to be run from promt. However, there is a way, and Felix Chang tells us:
You can invoke it like this: (it will execute every command
in every Alloy file you specified, and if an assertion
has a counterexample, it will show the values of every sig
and every relation in that counterexample)
Here's a sample promt:
java -cp alloy4.jar edu.mit.csail.sdg.alloy4whole.ExampleUsingTheCompiler file1.als file2.als
And the same thing for Alloy 4.2:
java -cp alloy4.2-rc.jar edu.mit.csail.sdg.alloy4whole.ExampleUsingTheCompiler file1.als file2.als
This is actually a different program and it's important to account for the differences.