java.lang.Object
org.tweetyproject.commons.AbstractInterpretation<PlBeliefSet,PlFormula>
org.tweetyproject.logics.translators.adfconditional.FourValuedWorld
All Implemented Interfaces:
Interpretation<PlBeliefSet,PlFormula>

public class FourValuedWorld extends AbstractInterpretation<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
  • Constructor Details

    • FourValuedWorld

      public FourValuedWorld()
      Creates an empty 4-valued world
    • FourValuedWorld

      public FourValuedWorld(FourValuedWorld other)
      Creates a new world which is a copy of the given world
      Parameters:
      other - some other world
  • Method Details

    • set

      public void set(Proposition p, FourValuedWorld.TruthValue val)
      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

      public PlSignature 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 - firstTruthValue
      secondTruthValue - secondTruthValue
      Returns:
      true, if the first TruthValue is at least as informative as the second one
    • isAtLeastAsInformativeAs

      public boolean isAtLeastAsInformativeAs(FourValuedWorld otherWorld)
      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 worlds
      getMostInformative - getMostInformative
      Returns:
      = least informative worlds
    • getThreeValuedSet

      public Collection<ThreeValuedWorld> 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

      public boolean satisfies(PlFormula formula) throws IllegalArgumentException
      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

      public FourValuedWorld.TruthValue satisfies4VL(PlFormula formula)
      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

      public boolean satisfies(PlBeliefSet beliefBase) throws IllegalArgumentException
      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

      public String toString()
      Overrides:
      toString in class Object
    • printValues

      public String printValues()
      Returns:
      values as string
    • printCollection

      public static String printCollection(Collection<FourValuedWorld> coll)
      Parameters:
      coll - worlds
      Returns:
      the string representation
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object