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 intcompareTo(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.PlFormulagetCompleteConjunction(PlSignature sig)Returns the complete conjunction representing this possible world wrt.booleansatisfies(java.util.Collection<PlFormula> formulas)Checks whether this interpretation satisfies all given formulas.booleansatisfies(PlBeliefSet beliefBase)Checks whether this interpretation satisfies the given knowledge base.booleansatisfies(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:InterpretationChecks whether this interpretation satisfies the given formula.- Specified by:
satisfiesin 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:AbstractInterpretationChecks whether this interpretation satisfies all given formulas.- Specified by:
satisfiesin interfaceInterpretation<PlBeliefSet,PlFormula>- Overrides:
satisfiesin 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:InterpretationChecks whether this interpretation satisfies the given knowledge base.- Specified by:
satisfiesin 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:
compareToin interfacejava.lang.Comparable<PossibleWorld>
-
-