Interface Interpretation
-
- All Known Implementing Classes:
EmptyInterpretation
,SetInterpretation
,SingleValuedInterpretation
public interface Interpretation
This class represents a three-valued interpretation of an Abstract Dialectical Framework (ADF).- Author:
- Mathias Hofer
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Interpretation.Builder
-
Method Summary
Modifier and Type Method Description java.util.Set<Argument>
arguments()
static Interpretation.Builder
builder(java.util.Collection<Argument> arguments)
static Interpretation.Builder
builder(AbstractDialecticalFramework adf)
default boolean
containsAll(java.util.Collection<Argument> arguments)
static Interpretation
empty(AbstractDialecticalFramework adf)
static boolean
equalsTwoValued(Interpretation i1, Interpretation i2)
Checks if, and only if, the two valued assignments for both of the interpretations are the same, ignores differences in the undecided assignments.static Interpretation
fromMap(java.util.Map<Argument,java.lang.Boolean> assignment)
static Interpretation
fromSet(java.util.Set<Argument> satisfied, AbstractDialecticalFramework adf)
static Interpretation
fromSets(java.util.Set<Argument> satisfied, java.util.Set<Argument> unsatisfied, java.util.Set<Argument> undecided)
static Interpretation
fromSets(java.util.Set<Argument> satisfied, java.util.Set<Argument> unsatisfied, AbstractDialecticalFramework adf)
static Interpretation
fromWitness(Interpretation<PlBeliefSet,PlFormula> witness, PropositionalMapping encodingContext, AbstractDialecticalFramework adf)
Constructs a three-valued ADF interpretation from a witness of a propositional sat encoding.default boolean
isStrictSubsetOf(Interpretation superset)
default boolean
isStrictSupersetOf(Interpretation subset)
default boolean
isSubsetOf(Interpretation superset)
default boolean
isSupersetOf(Interpretation subset)
default int
numDecided()
Returns the number of decided arguments, i.e.static Interpretation
partial(java.util.Set<Argument> satisfied, java.util.Set<Argument> unsatisfied, AbstractDialecticalFramework adf)
static java.util.Iterator<Interpretation>
partials(java.util.List<Argument> arguments, AbstractDialecticalFramework adf)
Goes through all possible partial interpretations respecting the order of the given list of arguments.static Interpretation
restrict(Interpretation interpretation, java.util.Collection<Argument> restriction)
Creates a new interpretation with the same assignments as in the given arguments, but only uses the arguments contained inrestriction
.java.util.Set<Argument>
satisfied()
boolean
satisfied(Argument arg)
static Interpretation
singleValued(Argument argument, boolean value, AbstractDialecticalFramework adf)
Returns an interpretation relative toadf
with a single truth value decided.default int
size()
Returns the number of arguments in this interpretation.static java.util.Map<Argument,java.lang.Boolean>
toMap(Interpretation interpretation)
java.util.Set<Argument>
undecided()
boolean
undecided(Argument arg)
java.util.Set<Argument>
unsatisfied()
boolean
unsatisfied(Argument arg)
-
-
-
Method Detail
-
empty
static Interpretation empty(AbstractDialecticalFramework adf)
-
fromMap
static Interpretation fromMap(java.util.Map<Argument,java.lang.Boolean> assignment)
-
fromSet
static Interpretation fromSet(java.util.Set<Argument> satisfied, AbstractDialecticalFramework adf)
-
fromSets
static Interpretation fromSets(java.util.Set<Argument> satisfied, java.util.Set<Argument> unsatisfied, AbstractDialecticalFramework adf)
-
fromSets
static Interpretation fromSets(java.util.Set<Argument> satisfied, java.util.Set<Argument> unsatisfied, java.util.Set<Argument> undecided)
-
fromWitness
static Interpretation fromWitness(Interpretation<PlBeliefSet,PlFormula> witness, PropositionalMapping encodingContext, AbstractDialecticalFramework adf)
Constructs a three-valued ADF interpretation from a witness of a propositional sat encoding.- Parameters:
witness
- the propositional sat witnessencodingContext
- the mapping of the propositional variables and the adfadf
- the ADF for which we construct the interpretation- Returns:
- an ADF interpretation
- Throws:
java.lang.NullPointerException
- if any of the arguments are null
-
partial
static Interpretation partial(java.util.Set<Argument> satisfied, java.util.Set<Argument> unsatisfied, AbstractDialecticalFramework adf)
-
toMap
static java.util.Map<Argument,java.lang.Boolean> toMap(Interpretation interpretation)
-
restrict
static Interpretation restrict(Interpretation interpretation, java.util.Collection<Argument> restriction)
Creates a new interpretation with the same assignments as in the given arguments, but only uses the arguments contained inrestriction
.- Parameters:
interpretation
- the interpretation to restrictrestriction
- the arguments that act as a restriction/filter- Returns:
- an interpretation which only contains arguments in
restriction
-
equalsTwoValued
static boolean equalsTwoValued(Interpretation i1, Interpretation i2)
Checks if, and only if, the two valued assignments for both of the interpretations are the same, ignores differences in the undecided assignments.- Parameters:
i1
- an interpretationi2
- an interpretation to be compared withi1
for the two-valued assignments- Returns:
- true iff the values of the decided arguments of both interpretations are the same
-
singleValued
static Interpretation singleValued(Argument argument, boolean value, AbstractDialecticalFramework adf)
Returns an interpretation relative toadf
with a single truth value decided.This may be useful for some decision-level based algorithms.
- Parameters:
argument
- the argument to decidevalue
- the value of the argumentadf
- the contextual ADF- Returns:
- an interpretation with a single argument decided
-
partials
static java.util.Iterator<Interpretation> partials(java.util.List<Argument> arguments, AbstractDialecticalFramework adf)
Goes through all possible partial interpretations respecting the order of the given list of arguments.This returns exponentially many in the size of
arguments
interpretations.- Parameters:
arguments
- the arguments for which we compute the interpretationsadf
- the contextual ADF- Returns:
- the partial interpretations
-
builder
static Interpretation.Builder builder(AbstractDialecticalFramework adf)
-
builder
static Interpretation.Builder builder(java.util.Collection<Argument> arguments)
-
satisfied
boolean satisfied(Argument arg)
-
unsatisfied
boolean unsatisfied(Argument arg)
-
undecided
boolean undecided(Argument arg)
-
satisfied
java.util.Set<Argument> satisfied()
-
unsatisfied
java.util.Set<Argument> unsatisfied()
-
undecided
java.util.Set<Argument> undecided()
-
arguments
java.util.Set<Argument> arguments()
Returns the union ofsatisfied()
,unsatisfied()
andundecided()
. Must not return additional arguments.- Returns:
- all the assigned arguments
-
size
default int size()
Returns the number of arguments in this interpretation.- Returns:
- the number of arguments
-
containsAll
default boolean containsAll(java.util.Collection<Argument> arguments)
-
numDecided
default int numDecided()
Returns the number of decided arguments, i.e. satisfied or unsatisfied, in this interpretation.- Returns:
- the number of decided arguments
-
isSubsetOf
default boolean isSubsetOf(Interpretation superset)
-
isStrictSubsetOf
default boolean isStrictSubsetOf(Interpretation superset)
-
isSupersetOf
default boolean isSupersetOf(Interpretation subset)
-
isStrictSupersetOf
default boolean isStrictSupersetOf(Interpretation subset)
-
-