Class PossibleWorld
- java.lang.Object
-
- net.sf.tweety.commons.AbstractInterpretation<B,S>
-
- net.sf.tweety.commons.InterpretationSet<Proposition,PlBeliefSet,PlFormula>
-
- net.sf.tweety.logics.pl.semantics.PossibleWorld
-
- All Implemented Interfaces:
java.lang.Comparable<PossibleWorld>
,java.lang.Iterable<Proposition>
,java.util.Collection<Proposition>
,Interpretation<PlBeliefSet,PlFormula>
public class PossibleWorld extends InterpretationSet<Proposition,PlBeliefSet,PlFormula> implements java.lang.Comparable<PossibleWorld>
This class represents a possible world of propositional logic, i.e. some set of propositions.- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description PossibleWorld()
Creates a new empty possible world.PossibleWorld(java.util.Collection<? extends Proposition> propositions)
Creates a new possible world with the given set of propositions.
-
Method Summary
Modifier and Type Method Description int
compareTo(PossibleWorld arg0)
static java.util.Set<PossibleWorld>
getAllPossibleWorlds(java.util.Collection<Proposition> signature)
Returns the set of all possible worlds for the given propositional signature.static java.util.Set<PossibleWorld>
getAllPossibleWorlds(PlSignature signature)
Returns the set of all possible worlds for the given propositional signature.PlFormula
getCompleteConjunction(PlSignature sig)
Returns the complete conjunction representing this possible world wrt.boolean
satisfies(java.util.Collection<PlFormula> formulas)
Checks whether this interpretation satisfies all given formulas.boolean
satisfies(PlBeliefSet beliefBase)
Checks whether this interpretation satisfies the given knowledge base.boolean
satisfies(PlFormula formula)
Checks whether this interpretation satisfies the given formula.-
Methods inherited from class net.sf.tweety.commons.InterpretationSet
add, add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
-
-
-
-
Constructor Detail
-
PossibleWorld
public PossibleWorld()
Creates a new empty possible world.
-
PossibleWorld
public PossibleWorld(java.util.Collection<? extends Proposition> propositions)
Creates a new possible world with the given set of propositions.- Parameters:
propositions
- the propositions that are true in this possible world
-
-
Method Detail
-
satisfies
public boolean satisfies(PlFormula formula) throws java.lang.IllegalArgumentException
Description copied from interface:Interpretation
Checks whether this interpretation satisfies the given formula.- Specified by:
satisfies
in interfaceInterpretation<PlBeliefSet,PlFormula>
- 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(java.util.Collection<PlFormula> formulas) throws java.lang.IllegalArgumentException
Description copied from class:AbstractInterpretation
Checks whether this interpretation satisfies all given formulas.- Specified by:
satisfies
in interfaceInterpretation<PlBeliefSet,PlFormula>
- Overrides:
satisfies
in classAbstractInterpretation<PlBeliefSet,PlFormula>
- Parameters:
formulas
- a collection of formulas.- Returns:
- "true" if this interpretation satisfies all given formulas.
- Throws:
java.lang.IllegalArgumentException
- if at least one formula does not correspond to the expected language.
-
satisfies
public boolean satisfies(PlBeliefSet beliefBase) throws java.lang.IllegalArgumentException
Description copied from interface:Interpretation
Checks whether this interpretation satisfies the given knowledge base.- Specified by:
satisfies
in interfaceInterpretation<PlBeliefSet,PlFormula>
- 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.
-
getAllPossibleWorlds
public static java.util.Set<PossibleWorld> getAllPossibleWorlds(java.util.Collection<Proposition> signature)
Returns the set of all possible worlds for the given propositional signature.- Parameters:
signature
- a propositional signature.- Returns:
- the set of all possible worlds for the given propositional signature.
-
getAllPossibleWorlds
public static java.util.Set<PossibleWorld> getAllPossibleWorlds(PlSignature signature)
Returns the set of all possible worlds for the given propositional signature.- Parameters:
signature
- a propositional signature.- Returns:
- the set of all possible worlds for the given propositional signature.
-
getCompleteConjunction
public PlFormula getCompleteConjunction(PlSignature sig)
Returns the complete conjunction representing this possible world wrt. the give signature- Parameters:
sig
- a propositional signature- Returns:
- the complete conjunction representing this possible world wrt. the give signature
-
compareTo
public int compareTo(PossibleWorld arg0)
- Specified by:
compareTo
in interfacejava.lang.Comparable<PossibleWorld>
-
-