Package net.sf.tweety.arg.aba.syntax
Class ABATheory<T extends Formula>
- java.lang.Object
-
- net.sf.tweety.arg.aba.syntax.ABATheory<T>
-
- Type Parameters:
T
- is the type of the language that the ABA theory's rules range over
- All Implemented Interfaces:
BeliefBase
public class ABATheory<T extends Formula> extends java.lang.Object implements BeliefBase
- Author:
- Nils Geilen (geilenn@uni-koblenz.de) An implementation of Assumption Based Argumentation
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Collection<Assumption<T>>
assumptions
The assumptions used in this theory wehen no explicit set of assumptions is givenprivate java.util.Collection<Negation<T>>
negations
The negation relationprivate java.util.Collection<InferenceRule<T>>
rules
The inference rules
-
Constructor Summary
Constructors Constructor Description ABATheory()
-
Method Summary
Modifier and Type Method Description void
add(Formula rule)
void
addAssumption(T assumption)
void
addNegation(T formula, T negation)
Adds a negation of form not formula = negationDungTheory
asDungTheory()
boolean
attacks(java.util.Collection<Assumption<T>> atters, java.util.Collection<Assumption<T>> atteds)
boolean
attacks(Deduction<T> atter, T atted)
boolean
defends(java.util.Collection<Assumption<T>> defor, Assumption<T> defed)
Checks whether a set of arguments defends an argumentjava.util.Collection<AbaExtension<T>>
getAllAdmissbleExtensions()
Computes all admissible extensionsjava.util.Collection<java.util.Collection<Assumption<T>>>
getAllConflictFreeExtensions()
Computes all context-free extensionsjava.util.Collection<Deduction<T>>
getAllDeductions()
java.util.Collection<Deduction<T>>
getAllDeductions(java.util.Collection<Assumption<T>> assumptions)
java.util.Collection<java.util.Collection<Assumption<T>>>
getAllExtensions()
Computes all possible extensionsjava.util.Collection<Assumption<T>>
getAssumptions()
java.util.Collection<Assumption<T>>
getClosure(java.util.Collection<Assumption<T>> assumptions)
A closure is the set of assumptions that can be derived from a set of assumptions via inference rulesSignature
getMinimalSignature()
Returns the signature of the language of this knowledge base.java.util.Collection<Negation<T>>
getNegations()
java.util.Collection<InferenceRule<T>>
getRules()
boolean
isAdmissible(AbaExtension<T> ext)
Checks whether a set of arguments is admissibleboolean
isClosed(java.util.Collection<Assumption<T>> assumptions)
A set of assumptions is closed iff it equals its closureboolean
isConflictFree(java.util.Collection<Assumption<T>> ext)
Checks whether a set of arguments is conflict-freeboolean
isFlat()
An ABA theory is flat iff all subsets of its argumentation set are closedboolean
negates(T negation, T formula)
Checks whether the given two formulas are negations of each othervoid
setAssumptions(java.util.Collection<Assumption<T>> assumptions)
private static <S> java.util.Collection<java.util.Collection<S>>
toPowerSet(java.util.Collection<S> set)
Computes the power set of a collectionjava.lang.String
toString()
-
-
-
Field Detail
-
rules
private java.util.Collection<InferenceRule<T extends Formula>> rules
The inference rules
-
assumptions
private java.util.Collection<Assumption<T extends Formula>> assumptions
The assumptions used in this theory wehen no explicit set of assumptions is given
-
-
Method Detail
-
getAllDeductions
public java.util.Collection<Deduction<T>> getAllDeductions()
- Returns:
- all deductions that can be derived from this theory
-
getAllDeductions
public java.util.Collection<Deduction<T>> getAllDeductions(java.util.Collection<Assumption<T>> assumptions)
- Parameters:
assumptions
- the set of assumptions used for the derivation- Returns:
- all deductions that can be derived from this theory
-
getClosure
public java.util.Collection<Assumption<T>> getClosure(java.util.Collection<Assumption<T>> assumptions)
A closure is the set of assumptions that can be derived from a set of assumptions via inference rules- Parameters:
assumptions
- a set of assumptions- Returns:
- the closure of assumptions
-
isClosed
public boolean isClosed(java.util.Collection<Assumption<T>> assumptions)
A set of assumptions is closed iff it equals its closure- Parameters:
assumptions
- a set of assumptions- Returns:
- true iff the set of assumptions is closed under this argumentation theory
-
isFlat
public boolean isFlat()
An ABA theory is flat iff all subsets of its argumentation set are closed- Returns:
- true iff the theory is flat
-
toPowerSet
private static <S> java.util.Collection<java.util.Collection<S>> toPowerSet(java.util.Collection<S> set)
Computes the power set of a collection- Parameters:
set
- a collection- Returns:
- a power set
-
add
public void add(Formula rule)
- Parameters:
rule
- an assumption or an inference rule or a negation that is added to the theory
-
addAssumption
public void addAssumption(T assumption)
- Parameters:
assumption
- a formula that is used as an assumption in the theory
-
addNegation
public void addNegation(T formula, T negation)
Adds a negation of form not formula = negation- Parameters:
formula
- a formulanegation
- it's complement
-
negates
public boolean negates(T negation, T formula)
Checks whether the given two formulas are negations of each other- Parameters:
formula
- a formulanegation
- a formula- Returns:
- true iff the two formulas are negations of each other
-
attacks
public boolean attacks(Deduction<T> atter, T atted)
- Parameters:
atter
- the attacking deductionatted
- the attacked assumption- Returns:
- true iff atter attacks atted
-
getRules
public java.util.Collection<InferenceRule<T>> getRules()
- Returns:
- the rules
-
getAssumptions
public java.util.Collection<Assumption<T>> getAssumptions()
- Returns:
- the assumptions
-
setAssumptions
public void setAssumptions(java.util.Collection<Assumption<T>> assumptions)
- Parameters:
assumptions
- the assumptions to set
-
attacks
public boolean attacks(java.util.Collection<Assumption<T>> atters, java.util.Collection<Assumption<T>> atteds)
-
defends
public boolean defends(java.util.Collection<Assumption<T>> defor, Assumption<T> defed)
Checks whether a set of arguments defends an argument- Parameters:
defor
- the defending setdefed
- the assumption which shall be defended- Returns:
- true iff defor defends defed
-
isConflictFree
public boolean isConflictFree(java.util.Collection<Assumption<T>> ext)
Checks whether a set of arguments is conflict-free- Parameters:
ext
- a set of arguments- Returns:
- true iff ext is conflict-free
-
getAllExtensions
public java.util.Collection<java.util.Collection<Assumption<T>>> getAllExtensions()
Computes all possible extensions- Returns:
- the powerset of the assumptions
-
getAllConflictFreeExtensions
public java.util.Collection<java.util.Collection<Assumption<T>>> getAllConflictFreeExtensions()
Computes all context-free extensions- Returns:
- all context-free extensions
-
isAdmissible
public boolean isAdmissible(AbaExtension<T> ext)
Checks whether a set of arguments is admissible- Parameters:
ext
- the set- Returns:
- true iff ext is admissible
-
getAllAdmissbleExtensions
public java.util.Collection<AbaExtension<T>> getAllAdmissbleExtensions()
Computes all admissible extensions- Returns:
- all admissible extensions
-
getMinimalSignature
public Signature getMinimalSignature()
Description copied from interface:BeliefBase
Returns the signature of the language of this knowledge base.- Specified by:
getMinimalSignature
in interfaceBeliefBase
- Returns:
- the signature of the language of this knowledge base.
-
asDungTheory
public DungTheory asDungTheory()
- Returns:
- a Dung Theory derived from this ABA theory
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfaceBeliefBase
- Overrides:
toString
in classjava.lang.Object
-
-