Class RefineOperator
java.lang.Object
ca.mcscert.jpipe.operators.CompositionOperator
ca.mcscert.jpipe.operators.builtin.RefineOperator
Built-in
refine composition operator.
Syntax:
justification result is refine(base, refinement) {
hook: "elementId"
}
Semantics: the hook element (identified by its id in the first source model)
and the conclusion of the second source (refinement) are merged into
a single SubConclusion named "hook". All other elements are
kept with their source model name as id prefix (e.g. base:c,
refinement:s).
The hook id is resolved through the unit alias map, so it can refer to an
element that was renamed by a prior composition step (e.g. unification after
assemble).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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, Map<String, String> knownAliases) 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.Methods inherited from class CompositionOperator
additionalCommands, apply, apply, apply, apply, resultKind
-
Field Details
-
HOOK_ID
The fixed id of the merged SubConclusion in the result model.- See Also:
-
-
Constructor Details
-
RefineOperator
public RefineOperator()
-
-
Method Details
-
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, Map<String, String> knownAliases) Description copied from class:CompositionOperatorReturns the equivalence relation to use for partitioning elements fromsourcesandarguments.- Specified by:
equivalenceRelationin classCompositionOperator- Parameters:
knownAliases- alias registry of the compilation unit (keyed as"modelName/oldId"); operators may use this to resolve element ids that were renamed by a prior composition step.
-
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
-