Package net.sf.tweety.arg.adf.semantics
Class Interpretation
- java.lang.Object
-
- net.sf.tweety.commons.AbstractInterpretation<AbstractDialecticalFramework,Argument>
-
- net.sf.tweety.arg.adf.semantics.Interpretation
-
- All Implemented Interfaces:
java.lang.Comparable<Interpretation>,java.lang.Iterable<Argument>,Interpretation<AbstractDialecticalFramework,Argument>
public class Interpretation extends AbstractInterpretation<AbstractDialecticalFramework,Argument> implements java.lang.Comparable<Interpretation>, java.lang.Iterable<Argument>
This class represents an immutable three-valued interpretation of an Abstract Dialectical Framework (ADF).- Author:
- Mathias Hofer
-
-
Constructor Summary
Constructors Constructor Description Interpretation(java.lang.Iterable<Argument> undecided)Creates a new empty interpretation, hence where all arguments are undecided.Interpretation(java.util.Map<Argument,java.lang.Boolean> assignments)Creates an interpretation based on the given mapping.
-
Method Summary
Modifier and Type Method Description java.util.stream.Stream<Argument>arguments()intcompareTo(Interpretation that)booleancontains(Argument a)booleanequals(java.lang.Object obj)java.lang.Booleanget(Argument a)java.util.Set<Argument>getSatisfied()java.util.Set<Argument>getUndecided()java.util.Set<Argument>getUnsatisfied()inthashCode()booleanisSatisfied(Argument a)booleanisUndecided(Argument a)booleanisUnsatisfied(Argument a)java.util.Iterator<Argument>iterator()java.util.stream.Stream<Argument>satisfied()booleansatisfies(AbstractDialecticalFramework beliefBase)Checks whether this interpretation satisfies the given knowledge base.booleansatisfies(Argument formula)Checks whether this interpretation satisfies the given formula.intsize()java.lang.StringtoString()java.util.stream.Stream<Argument>undecided()java.util.stream.Stream<Argument>unsatisfied()-
Methods inherited from class net.sf.tweety.commons.AbstractInterpretation
satisfies
-
-
-
-
Constructor Detail
-
Interpretation
public Interpretation(java.lang.Iterable<Argument> undecided)
Creates a new empty interpretation, hence where all arguments are undecided.- Parameters:
undecided-
-
Interpretation
public Interpretation(java.util.Map<Argument,java.lang.Boolean> assignments)
Creates an interpretation based on the given mapping.An argument becomes:
- satisfied iff it is mapped to true
- unsatisfied iff it is mapped to false
- undecided iff it is mapped to null
- Parameters:
assignments-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(Interpretation that)
- Specified by:
compareToin interfacejava.lang.Comparable<Interpretation>
-
satisfies
public boolean satisfies(Argument formula) throws java.lang.IllegalArgumentException
Description copied from interface:InterpretationChecks whether this interpretation satisfies the given formula.- Specified by:
satisfiesin interfaceInterpretation<AbstractDialecticalFramework,Argument>- Parameters:
formula- a formula .- Returns:
- "true" if this interpretation satisfies the given formula.
- Throws:
java.lang.IllegalArgumentException- if the formula does not correspond to the expected language.
-
satisfies
public boolean satisfies(AbstractDialecticalFramework beliefBase) throws java.lang.IllegalArgumentException
Description copied from interface:InterpretationChecks whether this interpretation satisfies the given knowledge base.- Specified by:
satisfiesin interfaceInterpretation<AbstractDialecticalFramework,Argument>- Parameters:
beliefBase- a knowledge base.- Returns:
- "true" if this interpretation satisfies the given knowledge base.
- Throws:
java.lang.IllegalArgumentException- IllegalArgumentException if the knowledgebase does not correspond to the expected language.
-
arguments
public java.util.stream.Stream<Argument> arguments()
- Returns:
- an unmodifiable set of all the arguments labeled by this interpretation
-
getSatisfied
public java.util.Set<Argument> getSatisfied()
- Returns:
- an unmodifiable view of the satisfied arguments
-
satisfied
public java.util.stream.Stream<Argument> satisfied()
-
getUnsatisfied
public java.util.Set<Argument> getUnsatisfied()
- Returns:
- an unmodifiable view of the unsatisfied arguments
-
unsatisfied
public java.util.stream.Stream<Argument> unsatisfied()
-
getUndecided
public java.util.Set<Argument> getUndecided()
- Returns:
- an unmodifiable view of the undecided arguments
-
undecided
public java.util.stream.Stream<Argument> undecided()
-
size
public int size()
-
isSatisfied
public boolean isSatisfied(Argument a)
-
isUnsatisfied
public boolean isUnsatisfied(Argument a)
-
isUndecided
public boolean isUndecided(Argument a)
-
contains
public boolean contains(Argument a)
-
get
public java.lang.Boolean get(Argument a)
- Parameters:
a- the argument for which we want to know its value- Returns:
- true, false or null if this argument is labeled as satisfied, unsatisfied or undecided.
- Throws:
java.lang.IllegalArgumentException- if the interpretation does not contain the given argument.
-
-