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: "base/elementId"
}
Semantics: the hook element (identified by model name and element id) from
base and the conclusion of 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).
-
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) 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, 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) 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
-