Class AlloyGenerator
java.lang.Object
org.clafer.alloy.AlloyGenerator
The Alloy 6 code of a temporal model, as
clafer -m alloy writes it
(P.als): the port of the compiler's Generator/AlloyLtl.hs
(AlloyLtl) on the input the compiler builds for it
(AlloyInput). Static models are solved with Choco, and have no
Alloy code here.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAn assertion of the model, with its name in the Alloy code.static enumWhat the code of a region of the Alloy code is: a constraint of the model, or a cardinality of a clafer (not a group cardinality).static final recordA region of the Alloy code (1-based lines and columns, asmapLineColgives them) and what it is the code of.static final recordThe Alloy code of a model for solving it, as claferIG has the compiler write it, and what claferIG reads from the compiler with it.static final classA model that the port does not translate. -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringgenerate(Ir.Model rich, Map<String, Long> scopes, int traceLength, boolean keepUnused, boolean validate) static AlloyGenerator.TranslationThe Alloy code of a temporal model for solving it, as claferIG has the compiler write it: with-k, so that no abstract clafer is removed.
-
Method Details
-
generate
public static String generate(Ir.Model rich, Map<String, Long> scopes, int traceLength, boolean keepUnused, boolean validate) throws AlloyGenerator.UnsupportedModel- Parameters:
rich- the rich explicit IR of a temporal model, asToIrgives itscopes- its scopes, by UID, in the order of the UIDstraceLength- the trace length (--tl)keepUnused--k: keep the abstract clafers that nothing needsvalidate--v: without theruncommand- Returns:
- the Alloy code, without the statistics comment
- Throws:
AlloyGenerator.UnsupportedModel
-
translate
public static AlloyGenerator.Translation translate(Ir.Model rich, Map<String, Long> scopes, int traceLength) throws AlloyGenerator.UnsupportedModelThe Alloy code of a temporal model for solving it, as claferIG has the compiler write it: with-k, so that no abstract clafer is removed.- Parameters:
rich- the rich explicit IR of a temporal modelscopes- its scopes, by UID, in the order of the UIDstraceLength- the trace length (--tl)- Throws:
AlloyGenerator.UnsupportedModel
-