Class PossibleWorld
java.lang.Object
org.tweetyproject.commons.AbstractInterpretation<B,S>
org.tweetyproject.commons.InterpretationSet<Proposition,PlBeliefSet,PlFormula>
org.tweetyproject.logics.pl.semantics.PossibleWorld
- All Implemented Interfaces:
Comparable<PossibleWorld>,Iterable<Proposition>,Collection<Proposition>,Interpretation<PlBeliefSet,PlFormula>
public class PossibleWorld
extends InterpretationSet<Proposition,PlBeliefSet,PlFormula>
implements Comparable<PossibleWorld>
This class represents a possible world of propositional logic, i.e.
some set of propositions.
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty possible world.PossibleWorld(Collection<? extends Proposition> propositions) Creates a new possible world with the given set of propositions. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(PossibleWorld arg0) static Set<PossibleWorld>getAllPossibleWorlds(Collection<Proposition> signature) Returns the set of all possible worlds for the given propositional signature.static Set<PossibleWorld>getAllPossibleWorlds(PlSignature signature) Returns the set of all possible worlds for the given propositional signature.Returns the complete conjunction representing this possible world wrt.booleansatisfies(Collection<PlFormula> formulas) Checks whether this interpretation satisfies all given formulas.booleansatisfies(PlBeliefSet beliefBase) Checks whether this interpretation satisfies the given knowledge base.booleanChecks whether this interpretation satisfies the given formula.Methods inherited from class org.tweetyproject.commons.InterpretationSet
add, add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toStringMethods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
PossibleWorld
public PossibleWorld()Creates a new empty possible world. -
PossibleWorld
Creates a new possible world with the given set of propositions.- Parameters:
propositions- the propositions that are true in this possible world
-
-
Method Details
-
satisfies
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:
IllegalArgumentException- if the formula does not correspond to the expected language.
-
satisfies
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:
IllegalArgumentException- if at least one formula does not correspond to the expected language.
-
satisfies
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:
IllegalArgumentException- IllegalArgumentException if the knowledgebase does not correspond to the expected language.
-
getAllPossibleWorlds
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
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
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
- Specified by:
compareToin interfaceComparable<PossibleWorld>
-