Class PossibleWorld
java.lang.Object
org.tweetyproject.commons.AbstractInterpretation<PlBeliefSet,PlFormula>
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
ConstructorDescriptionCreates 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 TypeMethodDescriptionint
compareTo
(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.boolean
satisfies
(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
Checks 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, toString
Methods 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: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:
IllegalArgumentException
- if the formula does not correspond to the expected language.
-
satisfies
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:
IllegalArgumentException
- if at least one formula does not correspond to the expected language.
-
satisfies
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:
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:
compareTo
in interfaceComparable<PossibleWorld>
-