Class QbPossibleWorld
java.lang.Object
org.tweetyproject.commons.AbstractInterpretation<PlBeliefSet,PlFormula>
org.tweetyproject.commons.InterpretationSet<Proposition,PlBeliefSet,PlFormula>
org.tweetyproject.logics.qbf.semantics.QbPossibleWorld
- All Implemented Interfaces:
Comparable<PossibleWorld>
,Iterable<Proposition>
,Collection<Proposition>
,Interpretation<PlBeliefSet,
PlFormula>
public class QbPossibleWorld
extends InterpretationSet<Proposition,PlBeliefSet,PlFormula>
implements Comparable<PossibleWorld>
This class represents a possible world of quantified boolean logic, i.e. some set
of propositions.
- Author:
- Anna Gessler, Matthias Thimm
-
Constructor Summary
ConstructorDescriptionCreates a new empty possible world.QbPossibleWorld
(Collection<? extends Proposition> propositions) Creates a new possible world with the given set of propositions. -
Method Summary
Modifier and TypeMethodDescriptionint
static Set
<QbPossibleWorld> getAllPossibleWorlds
(Collection<Proposition> signature) Returns the set of all possible worlds for the given propositional signature.static Set
<QbPossibleWorld> getAllPossibleWorlds
(PlSignature signature) Returns the set of all possible worlds for the given propositional signature.boolean
satisfies
(Collection<PlFormula> formulas) Checks whether this interpretation satisfies the given formula.boolean
satisfies
(PlBeliefSet beliefBase) Checks whether this interpretation satisfies the given formula.boolean
Checks whether this interpretation satisfies the given formula.substitute
(PlFormula f, Proposition v) Substitutes all occurrences of the proposition v with the possible truth values and returns a set of the possible substitutions.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
-
QbPossibleWorld
public QbPossibleWorld()Creates a new empty possible world. -
QbPossibleWorld
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
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
Checks whether this interpretation satisfies the given formula.- 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
Checks whether this interpretation satisfies the given formula.- 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.
-
substitute
Substitutes all occurrences of the proposition v with the possible truth values and returns a set of the possible substitutions.- Parameters:
f
- a formulav
- a proposition- Returns:
- all possible substituted formulas
-
compareTo
- Specified by:
compareTo
in interfaceComparable<PossibleWorld>
-