java.lang.Object
tools.refinery.interpreter.matchers.psystem.rewriters.AbstractRewriterTraceSource
tools.refinery.interpreter.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 Details

    • body

      protected PBody body
      The created body
    • variableMapping

      protected Map<PVariable,PVariable> variableMapping
      Mapping between the original and the copied variables
  • Constructor Details

  • Method Details

    • getVariableMapping

      public Map<PVariable,PVariable> getVariableMapping()
    • 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, 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)
    • copyRepresentativeElectionConstraint

      protected void copyRepresentativeElectionConstraint(RepresentativeElectionConstraint constraint)
    • 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
    • copyLeftJoinConstraint

      protected void copyLeftJoinConstraint(LeftJoinConstraint constraint)
    • 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