public abstract class Predicate extends Object implements Serializable
Terms
to form Atoms
.
A Predicate is uniquely identified by its name (and all predicate names are converted to upper case).
Predicates cannot be constructed directly.
Instead, they are constructed via the appropriate gegetthod in each subclass.Modifier | Constructor and Description |
---|---|
protected |
Predicate(String name,
ConstantType[] types) |
protected |
Predicate(String name,
ConstantType[] types,
boolean checkName) |
Modifier and Type | Method and Description |
---|---|
static void |
clearForTesting()
Clear out all active predicates.
|
void |
close()
Close the predicate and free related resrouces.
|
boolean |
equals(Object oth) |
static Predicate |
get(String name) |
static Collection<Predicate> |
getAll() |
ConstantType |
getArgumentType(int position)
Returns the ArgumentType which a
Term must have to be a valid
argument for a particular argument position of this Predicate. |
int |
getArity()
Returns the number of
Terms that are related when using this Predicate. |
String |
getName()
Returns the name of this Predicate.
|
int |
hashCode() |
static void |
registerPredicate(Predicate predicate) |
String |
toString() |
protected Predicate(String name, ConstantType[] types)
protected Predicate(String name, ConstantType[] types, boolean checkName)
public String getName()
public int getArity()
Terms
that are related when using this Predicate.
In other words, the arity of a Predicate is the number of arguments it accepts.
For example, the Predicate Related(A, B) has an arity of 2.public ConstantType getArgumentType(int position)
Term
must have to be a valid
argument for a particular argument position of this Predicate.public void close()
public static void registerPredicate(Predicate predicate)
public static Collection<Predicate> getAll()
public static void clearForTesting()
Copyright © 2022 University of California, Santa Cruz. All rights reserved.