Class PBodyCopier
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.matchers.psystem.rewriters.AbstractRewriterTraceSource
-
- org.eclipse.viatra.query.runtime.matchers.psystem.rewriters.PBodyCopier
-
public class PBodyCopier extends AbstractRewriterTraceSource
This class can create a new PBody for a PQuery. The result body contains a copy of given variables and constraints.
-
-
Field Summary
Fields Modifier and Type Field Description protected PBodybodyThe created bodyprotected java.util.Map<PVariable,PVariable>variableMappingMapping between the original and the copied variables
-
Constructor Summary
Constructors Constructor Description PBodyCopier(PBody body, IRewriterTraceCollector traceCollector)PBodyCopier(PQuery query)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcopyAggregatorConstraint(AggregatorConstraint constraint)protected voidcopyBinaryReflexiveTransitiveClosureConstraint(BinaryReflexiveTransitiveClosure binaryReflexiveTransitiveClosure)protected voidcopyBinaryTransitiveClosureConstraint(BinaryTransitiveClosure binaryTransitiveClosure)protected voidcopyConstantValueConstraint(ConstantValue constantValue)protected voidcopyConstraint(PConstraint constraint)protected voidcopyEqualityConstraint(Equality equality)protected ExportedParametercopyExportedParameterConstraint(ExportedParameter exportedParameter)protected voidcopyExpressionEvaluationConstraint(ExpressionEvaluation expressionEvaluation)protected voidcopyInequalityConstraint(Inequality inequality)protected voidcopyNegativePatternCallConstraint(NegativePatternCall negativePatternCall)protected voidcopyPatternMatchCounterConstraint(PatternMatchCounter patternMatchCounter)protected voidcopyPositivePatternCallConstraint(PositivePatternCall positivePatternCall)protected voidcopyRelationEvaluationConstraint(RelationEvaluation relationEvaluation)protected voidcopyTypeConstraint(TypeConstraint typeConstraint)protected voidcopyTypeFilterConstraint(TypeFilterConstraint typeConstraint)protected voidcopyVariable(PVariable variable, java.lang.String newName)protected PVariable[]extractMappedVariables(EnumerablePConstraint enumerablePConstraint)For positive pattern callsPBodygetCopiedBody()Returns the body with the copied variables and constraints.java.util.Map<PVariable,PVariable>getVariableMapping()voidmergeBody(PBody sourceBody)voidmergeBody(PBody sourceBody, IVariableRenamer namingTool, IConstraintFilter filter)Merge all variables and constraints from a source body to a target body.-
Methods inherited from class org.eclipse.viatra.query.runtime.matchers.psystem.rewriters.AbstractRewriterTraceSource
addTrace, derivativeRemoved, getTraceCollector, getTraces, setTraceCollector
-
-
-
-
Constructor Detail
-
PBodyCopier
public PBodyCopier(PBody body, IRewriterTraceCollector traceCollector)
- Since:
- 1.6
-
PBodyCopier
public PBodyCopier(PQuery query)
- Since:
- 1.6
-
-
Method Detail
-
mergeBody
public void mergeBody(PBody sourceBody)
-
mergeBody
public void mergeBody(PBody sourceBody, IVariableRenamer namingTool, IConstraintFilter filter)
Merge all variables and constraints from a source body to a target body. If multiple bodies are merged into a single one, use the renamer and filter options to avoid collisions.
-
copyVariable
protected void copyVariable(PVariable variable, java.lang.String newName)
-
getCopiedBody
public PBody getCopiedBody()
Returns the body with the copied variables and constraints. The returned body is still uninitialized.
-
copyConstraint
protected void copyConstraint(PConstraint constraint)
-
copyExportedParameterConstraint
protected ExportedParameter copyExportedParameterConstraint(ExportedParameter exportedParameter)
-
copyEqualityConstraint
protected void copyEqualityConstraint(Equality equality)
-
copyInequalityConstraint
protected void copyInequalityConstraint(Inequality inequality)
-
copyTypeConstraint
protected void copyTypeConstraint(TypeConstraint typeConstraint)
-
copyTypeFilterConstraint
protected void copyTypeFilterConstraint(TypeFilterConstraint typeConstraint)
-
copyConstantValueConstraint
protected void copyConstantValueConstraint(ConstantValue constantValue)
-
copyPositivePatternCallConstraint
protected void copyPositivePatternCallConstraint(PositivePatternCall positivePatternCall)
-
copyNegativePatternCallConstraint
protected void copyNegativePatternCallConstraint(NegativePatternCall negativePatternCall)
-
copyBinaryTransitiveClosureConstraint
protected void copyBinaryTransitiveClosureConstraint(BinaryTransitiveClosure binaryTransitiveClosure)
-
copyRelationEvaluationConstraint
protected void copyRelationEvaluationConstraint(RelationEvaluation relationEvaluation)
- Since:
- 2.8
-
copyBinaryReflexiveTransitiveClosureConstraint
protected void copyBinaryReflexiveTransitiveClosureConstraint(BinaryReflexiveTransitiveClosure binaryReflexiveTransitiveClosure)
- Since:
- 2.0
-
copyPatternMatchCounterConstraint
protected void copyPatternMatchCounterConstraint(PatternMatchCounter patternMatchCounter)
-
copyAggregatorConstraint
protected void copyAggregatorConstraint(AggregatorConstraint constraint)
- Since:
- 1.4
-
copyExpressionEvaluationConstraint
protected void copyExpressionEvaluationConstraint(ExpressionEvaluation expressionEvaluation)
-
extractMappedVariables
protected PVariable[] extractMappedVariables(EnumerablePConstraint enumerablePConstraint)
For positive pattern calls- Parameters:
positivePatternCall-- Returns:
- the mapped variables to the pattern's parameters
-
-