Class AlloyBackend
java.lang.Object
org.clafer.alloy.solve.AlloyBackend
- All Implemented Interfaces:
Backend
The Alloy backend of the solution loop, for a temporal model: claferIG's
ClaferIG.hs, and its commands of CommandLine.hs, on an
AlloySession in this JVM. The model is translated by the
frontend's port of the compiler's AlloyLtl generator, with -k, as
claferIG has the compiler translate it; the code is given to Alloy in
memory.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceReads the model again (r), with the errors of the model as the messages of an exception.static final recordWhat claferIG takes from its command line.Nested classes/interfaces inherited from interface Backend
Backend.Shown -
Constructor Summary
ConstructorsConstructorDescriptionAlloyBackend(AlloyBackend.Loader loader, String modelFileName, AlloyBackend.Options options) Loads the model, as claferIG'sloaddoes. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck(Repl.Io io, Integer line, Repl.Displayer display) check: checks the assertions (on the line, if positive), and shows each counterexample with the loop.booleanHandles a command of the backend's own.fork: another trace with the states of the last trace before the given state, or null once the backend has said why there is none.help()booleannames()next: the next solution, or the unsat core of the model with a near-miss, or none.config: a solution with another configuration, or null once the backend has said why there is none.intnumber(Repl.Context context) voidprepare()Sets the bitwidth that the scopes need and solves the model, asstart(Repl.Io)does without its messages: before the firstnext(Repl.Io).prompt()voidquit()Releases the solver.show(int n, Backend.Shown shown) The full view of the n-th solution, as the backend prints it.voidPrints what comes before the first solution, which the loop then asks for.voidSays that the input is no command.
-
Constructor Details
-
AlloyBackend
public AlloyBackend(AlloyBackend.Loader loader, String modelFileName, AlloyBackend.Options options) throws Exception Loads the model, as claferIG'sloaddoes.- Parameters:
modelFileName- the name of the model's file, which names the saved files- Throws:
Exception
-
-
Method Details
-
next
-
fork
-
nextConfiguration
Description copied from interface:Backendconfig: a solution with another configuration, or null once the backend has said why there is none.- Specified by:
nextConfigurationin interfaceBackend- Throws:
Exception
-
check
-
start
-
prepare
Sets the bitwidth that the scopes need and solves the model, asstart(Repl.Io)does without its messages: before the firstnext(Repl.Io).- Throws:
Exception
-
isDynamic
-
prompt
-
number
-
show
-
names
-
modelFileName
- Specified by:
modelFileNamein interfaceBackend- Returns:
- the name of the model's file, which names the saved files
-
quit
-
unknown
-
command
-
help
-