Package ca.uqac.lif.cep.fol
Class PredicateTuple
java.lang.Object
ca.uqac.lif.cep.fol.PredicateTuple
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 Summary
FieldsModifier and TypeFieldDescriptionprotected Predicate.PredicateArgumentThe arguments of this predicate tupleprotected StringThe name of the predicate this tuple definesprotected booleanThe value associated to these arguments -
Constructor Summary
ConstructorsConstructorDescriptionPredicateTuple(String name, boolean value, Object[] arguments) Creates a new predicate tuple -
Method Summary
Modifier and TypeMethodDescriptiongetArgument(int index) Retrieves the n-th argument of the tuplegetName()Gets the name of the predicate this tuple definesstatic PredicateTupleCreates a predicate tuple out of an object.toString()
-
Field Details
-
m_arguments
The arguments of this predicate tuple -
m_value
protected boolean m_valueThe value associated to these arguments -
m_name
The name of the predicate this tuple defines
-
-
Constructor Details
-
PredicateTuple
Creates a new predicate tuple- Parameters:
name- The name of the predicate this tuple definesvalue- The value associated to the argumentsarguments- The arguments of this predicate tuple
-
-
Method Details
-
getName
Gets the name of the predicate this tuple defines- Returns:
- The name
-
getArgument
Retrieves the n-th argument of the tuple- Parameters:
index- The position to retrieve- Returns:
- The value, or
nullif index is out of bounds
-
toPredicateTuple
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
-