Class QbPossibleWorld
- java.lang.Object
-
- net.sf.tweety.commons.AbstractInterpretation<B,S>
-
- net.sf.tweety.commons.InterpretationSet<Proposition,PlBeliefSet,PlFormula>
-
- net.sf.tweety.logics.qbf.semantics.QbPossibleWorld
-
- All Implemented Interfaces:
java.lang.Comparable<PossibleWorld>,java.lang.Iterable<Proposition>,java.util.Collection<Proposition>,Interpretation<PlBeliefSet,PlFormula>
public class QbPossibleWorld extends InterpretationSet<Proposition,PlBeliefSet,PlFormula> implements java.lang.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
Constructors Constructor Description QbPossibleWorld()Creates a new empty possible world.QbPossibleWorld(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 o)static java.util.Set<QbPossibleWorld>getAllPossibleWorlds(java.util.Collection<Proposition> signature)Returns the set of all possible worlds for the given propositional signature.static java.util.Set<QbPossibleWorld>getAllPossibleWorlds(PlSignature signature)Returns the set of all possible worlds for the given propositional signature.booleansatisfies(java.util.Collection<PlFormula> formulas)Checks whether this interpretation satisfies the given formula.booleansatisfies(PlBeliefSet beliefBase)Checks whether this interpretation satisfies the given formula.booleansatisfies(PlFormula formula)Checks whether this interpretation satisfies the given formula.java.util.Set<PlFormula>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 net.sf.tweety.commons.InterpretationSet
add, add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
-
-
-
-
Constructor Detail
-
QbPossibleWorld
public QbPossibleWorld()
Creates a new empty possible world.
-
QbPossibleWorld
public QbPossibleWorld(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
Checks 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
Checks whether this interpretation satisfies the given formula.- 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
Checks whether this interpretation satisfies the given formula.- 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<QbPossibleWorld> 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<QbPossibleWorld> 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.
-
substitute
public java.util.Set<PlFormula> 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.- Parameters:
f- a formulav- a proposition- Returns:
- all possible substituted formulas
-
compareTo
public int compareTo(PossibleWorld o)
- Specified by:
compareToin interfacejava.lang.Comparable<PossibleWorld>
-
-