Class RankingFunction

java.lang.Object
org.tweetyproject.commons.AbstractInterpretation<ClBeliefSet,Conditional>
org.tweetyproject.logics.cl.semantics.RankingFunction
All Implemented Interfaces:
Interpretation<ClBeliefSet,Conditional>

public class RankingFunction extends AbstractInterpretation<ClBeliefSet,Conditional>
A ranking function (or ordinal conditional function, OCF) that maps possible worlds of a propositional language to integers.

See W. Spohn. Ordinal conditional functions: a dynamic theory of epistemic states. In W.L. Harper and B. Skyrms, editors, Causation in Decision, Belief Change, and Statistics, II, pages 105-134. Kluwer Academic Publishers, 1988.
Author:
Matthias Thimm
  • Field Details

    • INFINITY

      public static final Integer INFINITY
      Integer used to define infinity.
  • Constructor Details

    • RankingFunction

      public RankingFunction(PlSignature signature)
      Creates a new ranking function mapping each given interpretation to zero.
      Parameters:
      signature - the signature of the language this ranking function is defined on.
  • Method Details

    • rank

      Gets the rank of the given possible world.
      Parameters:
      w - an possible world.
      Returns:
      the rank of the given possible world.
      Throws:
      IllegalArgumentException - if the given possible world has no rank in this ranking function.
    • setRank

      public void setRank(PossibleWorld w, Integer value)
      Sets the rank for the given possible world.
      Parameters:
      w - an possible world.
      value - the rank for the possible world.
    • satisfies

      public boolean satisfies(Conditional 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.
    • satisfies

      public boolean satisfies(ClBeliefSet beliefBase)
      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.
    • forceStrictness

      public void forceStrictness(Set<PlFormula> formulas)
      Sets the rank of every interpretation i that does not satisfy the given set of formulas to RankingFunction.INFINITY.
      Parameters:
      formulas - a set of first-order formulas.
    • rank

      public Integer rank(PlFormula formula) throws IllegalArgumentException
      Gets the rank of the given formula. Throws an IllegalArgumentException when the language of the formula does not correspond to the language of the interpretations this ranking function is defined on. Otherwise the rank of a formula is defined as the minimal rank of its satisfying interpretations.
      Parameters:
      formula - a formula.
      Returns:
      the rank of the given formula.
      Throws:
      IllegalArgumentException - if the languages of the formula does not correspond to the language of the interpretations this ranking function is defined on.
    • normalize

      public void normalize()
      Normalizes this OCF, i.e. appropriately shifts the ranks such that the minimal rank equals zero.
    • isNormalized

      public boolean isNormalized()
      Checkes whether this OCF is normalized, i.e. whether its minimal rank value is zero.
      Returns:
      "true" if this OCF is normalized
    • getPossibleWorlds

      public Set<PossibleWorld> getPossibleWorlds()
      Returns all interpretations that are mapped to a rank unequal to INFINITY.
      Returns:
      all interpretations that are mapped to a rank unequal to INFINITY.
    • getPlausibleWorlds

      public Set<PossibleWorld> getPlausibleWorlds()
      Returns all interpretations that are mapped to 0
      Returns:
      all interpretations that are mapped to 0
    • getSignature

      public PlSignature getSignature()
      Returns the signature of the first-order language this ranking function is defined on.
      Returns:
      the signature of the first-order language this ranking function is defined on.
    • verifies

      public static boolean verifies(PossibleWorld w, Conditional c)
      Checks whether the given possible world w verifies the given conditional (B|A), i.e. whether w satisfies A and B
      Parameters:
      w - a possible world
      c - a conditional.
      Returns:
      "true" if the given possible world verifies the given conditional.
    • falsifies

      public static boolean falsifies(PossibleWorld w, Conditional c)
      Checks whether the given possible world w falsifies the given conditional (B|A), i.e. whether w satisfies A and not B
      Parameters:
      w - a possible world
      c - a conditional.
      Returns:
      "true" if the given possible world falsifies the given conditional.
    • satisfies

      public static boolean satisfies(PossibleWorld w, Conditional c)
      Checks whether the given possible world w satisfies the given conditional (B|A), i.e. whether w does not falsify c.
      Parameters:
      w - a possible world
      c - a conditional.
      Returns:
      "true" if the given possible world satisfies the given conditional.
    • toString

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

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