Interface Transform<C,​R>

  • Type Parameters:
    R - the type of the bottom-up information, i.e. the values returned by the children of a node
    C - the type of the additional results the implementing transform operation may return
    All Known Subinterfaces:
    SimpleTransform<R>
    All Known Implementing Classes:
    DefinitionalCNFTransform, FixPartialTransform, OmegaReductTransform, PlFormulaTransform

    public interface Transform<C,​R>
    An interface which allows transform operations on the recursive structure of AcceptanceCondition.

    This transform works via the visitor-pattern. Via dynamic dispatch on AcceptanceCondition.transform(Transform) the concrete AcceptanceCondition-transform implementation visits its matching Transform-transform method. Before that, it however calls AcceptanceCondition-transform on its sub-conditions and passes its return values (of type R) to the specific Transform-transform of this condition. This way information is passed from the bottom to the top of the acceptance condition structure.

    Author:
    Mathias Hofer
    • Method Detail

      • transformDisjunction

        R transformDisjunction​(java.util.function.Consumer<C> consumer,
                               java.util.Collection<R> subconditions,
                               int polarity)
        This method is visited by the DisjunctionAcceptanceConditions of the acceptance condition on which we apply this Transform.
        Parameters:
        consumer - the consumer of the computed return values
        subconditions - the subconditions of this disjunction, e.g. {a, b} if this = or(a,b)
        polarity - polarity < 0: negative global position of this disjunction, e.g. this -> a
        polarity = 0: neutral global position of this disjunction, e.g. this <-> a
        polarity > 0: positive global position of this disjunction, e.g. a -> this
        Returns:
        the result which we want to return to the parent-formula of this disjunction
      • transformConjunction

        R transformConjunction​(java.util.function.Consumer<C> consumer,
                               java.util.Collection<R> subconditions,
                               int polarity)
        This method is visited by the ConjunctionAcceptanceConditions of the acceptance condition on which we apply this Transform.
        Parameters:
        consumer - the consumer of the computed return values
        subconditions - the subconditions of this conjunction, e.g. {a, b} if this = and(a,b)
        polarity - polarity < 0: negative global position of this conjunction, e.g. this -> a
        polarity = 0: neutral global position of this conjunction, e.g. this <-> a
        polarity > 0: positive global position of this conjunction, e.g. a -> this
        Returns:
        the result which we want to return to the parent-formula of this conjunction
      • transformImplication

        R transformImplication​(java.util.function.Consumer<C> consumer,
                               R left,
                               R right,
                               int polarity)
        This method is visited by the ImplicationAcceptanceConditions of the acceptance condition on which we apply this Transform.
        Parameters:
        consumer - the consumer of the computed return values
        left - the left part of the implication
        right - the right part of the implication
        polarity - polarity < 0: negative global position of this implication, e.g. this -> a
        polarity = 0: neutral global position of this implication, e.g. this <-> a
        polarity > 0: positive global position of this implication, e.g. a -> this
        Returns:
        the result which we want to return to the parent-formula of this implication
      • transformEquivalence

        R transformEquivalence​(java.util.function.Consumer<C> consumer,
                               R left,
                               R right,
                               int polarity)
        This method is visited by the EquivalenceAcceptanceConditions of the acceptance condition on which we apply this Transform.
        Parameters:
        consumer - the consumer of the computed return values
        left - the left part of the equivalence
        right - the right part of the equivalence
        polarity - polarity < 0: negative global position of this equivalence, e.g. this -> a
        polarity = 0: neutral global position of this equivalence, e.g. this <-> a
        polarity > 0: positive global position of this equivalence, e.g. a -> this
        Returns:
        the result which we want to return to the parent-formula of this equivalence
      • transformExclusiveDisjunction

        R transformExclusiveDisjunction​(java.util.function.Consumer<C> consumer,
                                        R left,
                                        R right,
                                        int polarity)
        This method is visited by the ExclusiveDisjunctionAcceptanceConditions of the acceptance condition on which we apply this Transform.
        Parameters:
        consumer - the consumer of the computed return values
        left - the left part of the xor
        right - the right part of the xor
        polarity - polarity < 0: negative global position of this xor, e.g. this -> a
        polarity = 0: neutral global position of this xor, e.g. this <-> a
        polarity > 0: positive global position of this xor, e.g. a -> this
        Returns:
        the result which we want to return to the parent-formula of this xor
      • transformNegation

        R transformNegation​(java.util.function.Consumer<C> consumer,
                            R sub,
                            int polarity)
        This method is visited by the NegationAcceptanceConditions of the acceptance condition on which we apply this Transform.
        Parameters:
        consumer - the consumer of the computed return values
        sub - the subformula of this negation, i.e. this = neg(sub)
        polarity - polarity < 0: negative global position of this negation, e.g. this -> a
        polarity = 0: neutral global position of this negation, e.g. this <-> a
        polarity > 0: positive global position of this negation, e.g. a -> this
        Returns:
        the result which we want to return to the parent-formula of this negation
      • transformArgument

        R transformArgument​(java.util.function.Consumer<C> consumer,
                            Argument argument,
                            int polarity)
        This method is visited by the Arguments of the acceptance condition on which we apply this Transform.
        Parameters:
        consumer - the consumer of the computed return values
        argument - the argument which calls this method
        polarity - polarity < 0: negative global position of this argument, e.g. this -> a
        polarity = 0: neutral global position of this argument, e.g. this <-> a
        polarity > 0: positive global position of this argument, e.g. a -> this
        Returns:
        the result which we want to return to the parent-formula of this argument
      • transformContradiction

        R transformContradiction​(java.util.function.Consumer<C> consumer,
                                 int polarity)
        This method is visited by the ContradictionAcceptanceConditions of the acceptance condition on which we apply this Transform.
        Parameters:
        consumer - the consumer of the computed return values
        polarity - polarity < 0: negative global position of this contradiction, e.g. this -> a
        polarity = 0: neutral global position of this contradiction, e.g. this <-> a
        polarity > 0: positive global position of this contradiction, e.g. a -> this
        Returns:
        the result which we want to return to the parent-formula of this contradiction
      • transformTautology

        R transformTautology​(java.util.function.Consumer<C> consumer,
                             int polarity)
        This method is visited by the TautologyAcceptanceConditions of the acceptance condition on which we apply this Transform.
        Parameters:
        consumer - the consumer of the computed return values
        polarity - polarity < 0: negative global position of this tautology, e.g. this -> a
        polarity = 0: neutral global position of this tautology, e.g. this <-> a
        polarity > 0: positive global position of this tautology, e.g. a -> this
        Returns:
        the result which we want to return to the parent-formula of this tautology