Class FourValuedWorld
java.lang.Object
org.tweetyproject.commons.AbstractInterpretation<PlBeliefSet,PlFormula>
org.tweetyproject.logics.translators.adfconditional.FourValuedWorld
- All Implemented Interfaces:
Interpretation<PlBeliefSet,
PlFormula>
This class models a four-valued interpretation for propositional logic
Formulas are interpreted using completions
Every atom is assigned one of the four truth values: TRUE, FALSE, UNDECIDED, INCONSISTENT
- Author:
- Jonas Schumacher
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionCreates an empty 4-valued worldFourValuedWorld
(FourValuedWorld other) Creates a new world which is a copy of the given world -
Method Summary
Modifier and TypeMethodDescriptionboolean
get
(Proposition p) Returns the truth value of the given proposition.Returns the signature of this world.This method calculates a collection of 3-valued worlds based on this 4-valued world INCONSISTENT atoms are replaced by FALSE or TRUEThis method takes a set of 3-valued worlds and returns a set of sets of 2-valued worlds where undecided atoms are replaced by False or Trueint
hashCode()
static boolean
informationOrder
(FourValuedWorld.TruthValue firstTruthValue, FourValuedWorld.TruthValue secondTruthValue) This method puts the 4 truth values into an information orderboolean
isAtLeastAsInformativeAs
(FourValuedWorld otherWorld) This method compares this world to another world by comparing their information-orderboolean
Decide whether this world is two-valued or notstatic String
static Collection<FourValuedWorld>
reduceToLeastInformativeWorlds
(Collection<FourValuedWorld> coll, boolean getMostInformative) This method returns the least informative world among a collection of FourValuedWorldsboolean
satisfies
(PlBeliefSet beliefBase) Checks whether this interpretation satisfies the given knowledge base.boolean
Checks whether this interpretation satisfies the given formula.satisfies4VL
(PlFormula formula) Determines the 4-valued truth value of the given formula.void
set
(Proposition p, FourValuedWorld.TruthValue val) Sets the value of the given proposition.toString()
Methods inherited from class org.tweetyproject.commons.AbstractInterpretation
satisfies
-
Constructor Details
-
FourValuedWorld
public FourValuedWorld()Creates an empty 4-valued world -
FourValuedWorld
Creates a new world which is a copy of the given world- Parameters:
other
- some other world
-
-
Method Details
-
set
Sets the value of the given proposition.- Parameters:
p
- some proposition.val
- some truth value.
-
get
Returns the truth value of the given proposition.- Parameters:
p
- a proposition- Returns:
- a truth value.
-
getSignature
Returns the signature of this world.- Returns:
- the signature of this world.
-
isTwoValued
public boolean isTwoValued()Decide whether this world is two-valued or not- Returns:
- isTwoValued
-
informationOrder
public static boolean informationOrder(FourValuedWorld.TruthValue firstTruthValue, FourValuedWorld.TruthValue secondTruthValue) This method puts the 4 truth values into an information order- Parameters:
firstTruthValue
- firstTruthValuesecondTruthValue
- secondTruthValue- Returns:
- true, if the first TruthValue is at least as informative as the second one
-
isAtLeastAsInformativeAs
This method compares this world to another world by comparing their information-order- Parameters:
otherWorld
- = the world to be compared to- Returns:
- true, if this world is more informative
-
reduceToLeastInformativeWorlds
public static Collection<FourValuedWorld> reduceToLeastInformativeWorlds(Collection<FourValuedWorld> coll, boolean getMostInformative) This method returns the least informative world among a collection of FourValuedWorlds- Parameters:
coll
- = possible input worldsgetMostInformative
- getMostInformative- Returns:
- = least informative worlds
-
getThreeValuedSet
This method calculates a collection of 3-valued worlds based on this 4-valued world INCONSISTENT atoms are replaced by FALSE or TRUE- Returns:
- Collection of 3-valued worlds
-
getTwoValuedSetOfSets
public Collection<Collection<PossibleWorld>> getTwoValuedSetOfSets(Collection<ThreeValuedWorld> coll3V) This method takes a set of 3-valued worlds and returns a set of sets of 2-valued worlds where undecided atoms are replaced by False or True- Parameters:
coll3V
- :- Returns:
- set of sets
-
satisfies
Description copied from interface:Interpretation
Checks whether this interpretation satisfies the given formula.- 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.
-
satisfies4VL
Determines the 4-valued truth value of the given formula.- Parameters:
formula
- : some propositional formula- Returns:
- the 4-valued truth value of the formula.
-
satisfies
Description copied from interface:Interpretation
Checks whether this interpretation satisfies the given knowledge base.- 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.
-
toString
-
printValues
- Returns:
- values as string
-
printCollection
- Parameters:
coll
- worlds- Returns:
- the string representation
-
hashCode
public int hashCode() -
equals
-