Package net.sf.tweety.arg.adf.syntax
Class AbstractDialecticalFramework
- java.lang.Object
-
- net.sf.tweety.arg.adf.syntax.AbstractDialecticalFramework
-
- All Implemented Interfaces:
java.lang.Comparable<AbstractDialecticalFramework>,java.lang.Iterable<Argument>,BeliefBase
public class AbstractDialecticalFramework extends java.lang.Object implements BeliefBase, java.lang.Comparable<AbstractDialecticalFramework>, java.lang.Iterable<Argument>
This class implements abstract dialectical frameworks, cf. [Brewka, Ellmauthaler, Strass, Wallner, Woltran. Abstract Dialectical Frameworks Revisited. IJCAI'13]- Author:
- Mathias Hofer
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Argument,AcceptanceCondition>accByArgumentprivate java.util.Map<Argument,java.util.Set<Argument>>childrenByParentMaps an argument to all the arguments in which it occurs in their acceptance condition.private Cache<Pair<Argument,Argument>,Link>linkCacheprivate LinkStrategylinkStrategyprivate java.util.Map<Argument,java.util.Set<Argument>>parentsByChildMaps an argument to the arguments of its acceptance condition
-
Constructor Summary
Constructors Constructor Description AbstractDialecticalFramework(java.util.Map<Argument,AcceptanceCondition> accByArgument)
-
Method Summary
Modifier and Type Method Description java.util.stream.Stream<Argument>arguments()booleanbipolar()Checks if the ADF is bipolar.intcompareTo(AbstractDialecticalFramework o)booleancontainsArgument(Argument a)AcceptanceConditiongetAcceptanceCondition(Argument argument)SignaturegetMinimalSignature()Returns the signature of the language of this knowledge base.java.util.Iterator<Argument>iterator()longkBipolar()Linklink(Argument a, Argument b)Computes the link (a,b) iff necessary and returns it afterwards.java.util.stream.Stream<Link>links()java.util.stream.Stream<Link>linksFromParents(Argument b)java.util.stream.Stream<Link>linksToChildren(Argument a)AbstractDialecticalFrameworkomegaReduct(Interpretation interpretation)Computes a reduct of this ADF relative to the given interpretation s.t.java.util.stream.Stream<Argument>parents(Argument child)voidsetLinkStrategy(LinkStrategy linkStrategy)AbstractDialecticalFrameworktransform(Transform<AcceptanceCondition,AcceptanceCondition> transform)Creates a copy of this ADF with transformed acceptance conditions.private voidupdateRelations(Argument child)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.tweety.commons.BeliefBase
toString
-
-
-
-
Field Detail
-
linkStrategy
private LinkStrategy linkStrategy
-
parentsByChild
private java.util.Map<Argument,java.util.Set<Argument>> parentsByChild
Maps an argument to the arguments of its acceptance condition
-
childrenByParent
private java.util.Map<Argument,java.util.Set<Argument>> childrenByParent
Maps an argument to all the arguments in which it occurs in their acceptance condition.
-
accByArgument
private java.util.Map<Argument,AcceptanceCondition> accByArgument
-
-
Constructor Detail
-
AbstractDialecticalFramework
public AbstractDialecticalFramework(java.util.Map<Argument,AcceptanceCondition> accByArgument)
-
-
Method Detail
-
updateRelations
private void updateRelations(Argument child)
-
arguments
public java.util.stream.Stream<Argument> arguments()
-
bipolar
public boolean bipolar()
Checks if the ADF is bipolar. May compute all links to do so.- Returns:
- true iff all of the links are bipolar
-
kBipolar
public long kBipolar()
-
getAcceptanceCondition
public AcceptanceCondition getAcceptanceCondition(Argument argument)
-
links
public java.util.stream.Stream<Link> links()
-
containsArgument
public boolean containsArgument(Argument a)
-
omegaReduct
public AbstractDialecticalFramework omegaReduct(Interpretation interpretation)
Computes a reduct of this ADF relative to the given interpretation s.t. all unsatisfied arguments are replaced with false.- Parameters:
interpretation-- Returns:
- the reduct
-
transform
public AbstractDialecticalFramework transform(Transform<AcceptanceCondition,AcceptanceCondition> transform)
Creates a copy of this ADF with transformed acceptance conditions.- Parameters:
transform- the transform to apply- Returns:
- a copy of this ADF
-
linksFromParents
public java.util.stream.Stream<Link> linksFromParents(Argument b)
- Parameters:
b-- Returns:
- a stream of links (a,b)
-
linksToChildren
public java.util.stream.Stream<Link> linksToChildren(Argument a)
- Parameters:
a-- Returns:
- a stream of links (a,b)
-
link
public Link link(Argument a, Argument b)
Computes the link (a,b) iff necessary and returns it afterwards.- Parameters:
a-b-- Returns:
- (a,b)
-
setLinkStrategy
public void setLinkStrategy(LinkStrategy linkStrategy)
- Parameters:
linkStrategy- the strategy which is used for computing the links
-
compareTo
public int compareTo(AbstractDialecticalFramework o)
- Specified by:
compareToin interfacejava.lang.Comparable<AbstractDialecticalFramework>
-
getMinimalSignature
public Signature getMinimalSignature()
Description copied from interface:BeliefBaseReturns the signature of the language of this knowledge base.- Specified by:
getMinimalSignaturein interfaceBeliefBase- Returns:
- the signature of the language of this knowledge base.
-
-