Class PredicateTuple

java.lang.Object
ca.uqac.lif.cep.fol.PredicateTuple

public class PredicateTuple extends Object
An assertion defining the truth value of a predicate for a concrete list of arguments.

For example, the predicate tuple p(b,0) = TRUE stipulates that predicate p, when given the arguments "b" (a constant) and 0, returns the value TRUE.

  • Field Details

    • m_arguments

      protected Predicate.PredicateArgument m_arguments
      The arguments of this predicate tuple
    • m_value

      protected boolean m_value
      The value associated to these arguments
    • m_name

      protected String m_name
      The name of the predicate this tuple defines
  • Constructor Details

    • PredicateTuple

      public PredicateTuple(String name, boolean value, Object[] arguments)
      Creates a new predicate tuple
      Parameters:
      name - The name of the predicate this tuple defines
      value - The value associated to the arguments
      arguments - The arguments of this predicate tuple
  • Method Details

    • getName

      public String getName()
      Gets the name of the predicate this tuple defines
      Returns:
      The name
    • getArgument

      public Object getArgument(int index)
      Retrieves the n-th argument of the tuple
      Parameters:
      index - The position to retrieve
      Returns:
      The value, or null if index is out of bounds
    • toPredicateTuple

      public static PredicateTuple toPredicateTuple(Object x)
      Creates a predicate tuple out of an object.
      Parameters:
      x - An array or an ordered collection of objects. Null elements and strings consisting only of whitespace, will be ignored when creating the tuple.
      Returns:
      The tuple
    • toString

      public String toString()
      Overrides:
      toString in class Object