Class LatticePartialOrder<T extends Formula,R extends BeliefBase>

Type Parameters:
T - some formula
All Implemented Interfaces:
Comparator<T>, Interpretation<R,T>

public class LatticePartialOrder<T extends Formula,R extends BeliefBase> extends GeneralComparator<T,R>
This class models comparable element ranking by representing the acceptability of comparable elements in a graph-based structure.
Author:
Matthias Thimm
  • Constructor Details

    • LatticePartialOrder

      public LatticePartialOrder(Collection<T> args)
      Creates a new argument ranking with the given comparable elements which are initially all incomparable.
      Parameters:
      args - a set of arguments
  • Method Details

    • getOrder

      public Order<T> getOrder()
      Returns:
      the order
    • getArgs

      public Collection<T> getArgs()
      Returns:
      the arguments
    • setStrictlyLessOrEquallyAcceptableThan

      public void setStrictlyLessOrEquallyAcceptableThan(T a, T b)
      Defines comparable element "a" to be strictly less or equally acceptable than comparable element "b".
      Parameters:
      a - some comparable element
      b - some comparable element
    • isStrictlyLessOrEquallyAcceptableThan

      public boolean isStrictlyLessOrEquallyAcceptableThan(T a, T b)
      Description copied from class: GeneralComparator
      Returns "true" iff a is strictly less acceptable than b or a is equally acceptable as b or a and b are not comparable, i.e. a >= b (or a ~ b)
      Specified by:
      isStrictlyLessOrEquallyAcceptableThan in class GeneralComparator<T extends Formula,R extends BeliefBase>
      Parameters:
      a - some comparable element
      b - some comparable element
      Returns:
      "true" iff a is strictly less acceptable than b or a is equally acceptable as b
    • isIncomparable

      public boolean isIncomparable(T a, T b)
      Description copied from class: GeneralComparator
      Returns "true" iff a and b are incomparable (i.e. this ranking is a partial ranking).
      Specified by:
      isIncomparable in class GeneralComparator<T extends Formula,R extends BeliefBase>
      Parameters:
      a - comparable element
      b - comparable element
      Returns:
      "true" iff a and b are incomparable
    • containsIncomparableArguments

      public boolean containsIncomparableArguments()
      Specified by:
      containsIncomparableArguments in class GeneralComparator<T extends Formula,R extends BeliefBase>
      Returns:
      true if this ranking contains incomparable arguments, false otherwise
    • isSame

      public boolean isSame(LatticePartialOrder<T,R> ra)
      Parameters:
      ra - some artial order
      Returns:
      if they are the same
    • toString

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

      public boolean satisfies(T 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(R 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.