Class 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 Detail

      • body

        protected PBody body
        The created body
      • variableMapping

        protected java.util.Map<PVariable,​PVariable> variableMapping
        Mapping between the original and the copied variables
    • 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)
      • 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