Class AssembleOperator
java.lang.Object
ca.mcscert.jpipe.operators.CompositionOperator
ca.mcscert.jpipe.operators.builtin.AssembleOperator
Built-in
assemble composition operator.
Syntax:
justification assembled is assemble(a, b, c) {
conclusionLabel: "A global conclusion"
strategyLabel: "An aggregating strategy"
}
Semantics: each source model's conclusion is demoted to a
SubConclusion (preserving its label and source-prefixed id). All
demoted sub-conclusions feed a newly created Strategy (id
"assembleStrategy"), which in turn supports a newly created
Conclusion (id "assembleConclusion"). All other elements are
copied with sourceName:elementId prefixed ids.
If any source is a Template, the result model is also a
Template; otherwise it is a Justification.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadditionalCommands(String resultName, List<JustificationModel<?>> sources, AliasRegistry aliases, Map<String, String> args) Returns additional commands to append after Phase 2 edge reconstruction.protected CommandcreateResultModel(String name, SourceLocation location, List<JustificationModel<?>> sources, Map<String, String> arguments) Returns the command that creates the result model (typicallyCreateJustificationorCreateTemplate).protected EquivalenceRelationequivalenceRelation(List<JustificationModel<?>> sources, Map<String, String> arguments) Returns the equivalence relation to use for partitioning elements fromsourcesandarguments.protected MergeFunctionmergeFunction(List<JustificationModel<?>> sources, Map<String, String> arguments) Returns the merge function to use for creating result elements fromsourcesandarguments.Declares which argument keys this operator requires.resultKind(List<JustificationModel<?>> sources, Map<String, String> args) Methods inherited from class CompositionOperator
apply, apply, apply
-
Field Details
-
STRATEGY_ID
Id of the synthesized aggregating strategy in the result model.- See Also:
-
CONCLUSION_ID
Id of the synthesized global conclusion in the result model.- See Also:
-
-
Constructor Details
-
AssembleOperator
public AssembleOperator()
-
-
Method Details
-
resultKind
Description copied from class:CompositionOperatorReturns theModelKindof the model produced by this operator for the givensourcesandargs. Defaults toModelKind.JUSTIFICATION. Override in subclasses whose result kind depends on the input models (e.g. an operator that produces aTemplatewhen any source is aTemplate).- Overrides:
resultKindin classCompositionOperator
-
requiredArguments
Description copied from class:CompositionOperatorDeclares which argument keys this operator requires. The framework validates their presence at the start ofCompositionOperator.apply(String, List, Map)and throwsInvalidOperatorCallExceptionlisting any missing keys. Default: empty set (no required arguments).- Overrides:
requiredArgumentsin classCompositionOperator
-
createResultModel
protected Command createResultModel(String name, SourceLocation location, List<JustificationModel<?>> sources, Map<String, String> arguments) Description copied from class:CompositionOperatorReturns the command that creates the result model (typicallyCreateJustificationorCreateTemplate).- Specified by:
createResultModelin classCompositionOperator- Parameters:
location- the source location of the operator call; forwarded to the creation command so the result model appears in the symbol table.sources- the source models being composed; provided so operators can choose the result model type (e.g.TemplatevsJustification) based on the source types.
-
equivalenceRelation
protected EquivalenceRelation equivalenceRelation(List<JustificationModel<?>> sources, Map<String, String> arguments) Description copied from class:CompositionOperatorReturns the equivalence relation to use for partitioning elements fromsourcesandarguments.- Specified by:
equivalenceRelationin classCompositionOperator
-
mergeFunction
protected MergeFunction mergeFunction(List<JustificationModel<?>> sources, Map<String, String> arguments) Description copied from class:CompositionOperatorReturns the merge function to use for creating result elements fromsourcesandarguments.- Specified by:
mergeFunctionin classCompositionOperator
-
additionalCommands
protected List<Command> additionalCommands(String resultName, List<JustificationModel<?>> sources, AliasRegistry aliases, Map<String, String> args) Description copied from class:CompositionOperatorReturns additional commands to append after Phase 2 edge reconstruction. Override to inject synthesized elements and their edges that have no counterpart in any source model. Default: empty.- Overrides:
additionalCommandsin classCompositionOperator
-