Package net.sf.tweety.arg.adf.transform
Interface Transform<C,R>
-
- Type Parameters:
R- the type of the bottom-up information, i.e. the values returned by the children of a nodeC- 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 concreteAcceptanceCondition-transform implementation visits its matchingTransform-transform method. Before that, it however callsAcceptanceCondition-transform on its sub-conditions and passes its return values (of type R) to the specificTransform-transform of this condition. This way information is passed from the bottom to the top of the acceptance condition structure.- Author:
- Mathias Hofer
-
-
Method Summary
Modifier and Type Method Description RtransformArgument(java.util.function.Consumer<C> consumer, Argument argument, int polarity)RtransformConjunction(java.util.function.Consumer<C> consumer, java.util.Collection<R> subconditions, int polarity)This method is visited by theConjunctionAcceptanceConditionsof the acceptance condition on which we apply thisTransform.RtransformContradiction(java.util.function.Consumer<C> consumer, int polarity)This method is visited by theContradictionAcceptanceConditionsof the acceptance condition on which we apply thisTransform.RtransformDisjunction(java.util.function.Consumer<C> consumer, java.util.Collection<R> subconditions, int polarity)This method is visited by theDisjunctionAcceptanceConditionsof the acceptance condition on which we apply thisTransform.RtransformEquivalence(java.util.function.Consumer<C> consumer, R left, R right, int polarity)This method is visited by theEquivalenceAcceptanceConditionsof the acceptance condition on which we apply thisTransform.RtransformExclusiveDisjunction(java.util.function.Consumer<C> consumer, R left, R right, int polarity)This method is visited by theExclusiveDisjunctionAcceptanceConditionsof the acceptance condition on which we apply thisTransform.RtransformImplication(java.util.function.Consumer<C> consumer, R left, R right, int polarity)This method is visited by theImplicationAcceptanceConditionsof the acceptance condition on which we apply thisTransform.RtransformNegation(java.util.function.Consumer<C> consumer, R sub, int polarity)This method is visited by theNegationAcceptanceConditionsof the acceptance condition on which we apply thisTransform.RtransformTautology(java.util.function.Consumer<C> consumer, int polarity)This method is visited by theTautologyAcceptanceConditionsof the acceptance condition on which we apply thisTransform.
-
-
-
Method Detail
-
transformDisjunction
R transformDisjunction(java.util.function.Consumer<C> consumer, java.util.Collection<R> subconditions, int polarity)
This method is visited by theDisjunctionAcceptanceConditionsof the acceptance condition on which we apply thisTransform.- Parameters:
consumer- the consumer of the computed return valuessubconditions- 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 theConjunctionAcceptanceConditionsof the acceptance condition on which we apply thisTransform.- Parameters:
consumer- the consumer of the computed return valuessubconditions- 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 theImplicationAcceptanceConditionsof the acceptance condition on which we apply thisTransform.- Parameters:
consumer- the consumer of the computed return valuesleft- the left part of the implicationright- the right part of the implicationpolarity- 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 theEquivalenceAcceptanceConditionsof the acceptance condition on which we apply thisTransform.- Parameters:
consumer- the consumer of the computed return valuesleft- the left part of the equivalenceright- the right part of the equivalencepolarity- 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 theExclusiveDisjunctionAcceptanceConditionsof the acceptance condition on which we apply thisTransform.- Parameters:
consumer- the consumer of the computed return valuesleft- the left part of the xorright- the right part of the xorpolarity- 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 theNegationAcceptanceConditionsof the acceptance condition on which we apply thisTransform.- Parameters:
consumer- the consumer of the computed return valuessub- 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 theArgumentsof the acceptance condition on which we apply thisTransform.- Parameters:
consumer- the consumer of the computed return valuesargument- the argument which calls this methodpolarity- 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 theContradictionAcceptanceConditionsof the acceptance condition on which we apply thisTransform.- Parameters:
consumer- the consumer of the computed return valuespolarity- 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 theTautologyAcceptanceConditionsof the acceptance condition on which we apply thisTransform.- Parameters:
consumer- the consumer of the computed return valuespolarity- 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
-
-