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 R
transformArgument(java.util.function.Consumer<C> consumer, Argument argument, int polarity)
R
transformConjunction(java.util.function.Consumer<C> consumer, java.util.Collection<R> subconditions, int polarity)
This method is visited by theConjunctionAcceptanceConditions
of the acceptance condition on which we apply thisTransform
.R
transformContradiction(java.util.function.Consumer<C> consumer, int polarity)
This method is visited by theContradictionAcceptanceConditions
of the acceptance condition on which we apply thisTransform
.R
transformDisjunction(java.util.function.Consumer<C> consumer, java.util.Collection<R> subconditions, int polarity)
This method is visited by theDisjunctionAcceptanceConditions
of the acceptance condition on which we apply thisTransform
.R
transformEquivalence(java.util.function.Consumer<C> consumer, R left, R right, int polarity)
This method is visited by theEquivalenceAcceptanceConditions
of the acceptance condition on which we apply thisTransform
.R
transformExclusiveDisjunction(java.util.function.Consumer<C> consumer, R left, R right, int polarity)
This method is visited by theExclusiveDisjunctionAcceptanceConditions
of the acceptance condition on which we apply thisTransform
.R
transformImplication(java.util.function.Consumer<C> consumer, R left, R right, int polarity)
This method is visited by theImplicationAcceptanceConditions
of the acceptance condition on which we apply thisTransform
.R
transformNegation(java.util.function.Consumer<C> consumer, R sub, int polarity)
This method is visited by theNegationAcceptanceConditions
of the acceptance condition on which we apply thisTransform
.R
transformTautology(java.util.function.Consumer<C> consumer, int polarity)
This method is visited by theTautologyAcceptanceConditions
of 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 theDisjunctionAcceptanceConditions
of 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 theConjunctionAcceptanceConditions
of 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 theImplicationAcceptanceConditions
of 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 theEquivalenceAcceptanceConditions
of 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 theExclusiveDisjunctionAcceptanceConditions
of 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 theNegationAcceptanceConditions
of 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 theArguments
of 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 theContradictionAcceptanceConditions
of 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 theTautologyAcceptanceConditions
of 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
-
-