Class PredicateSym
java.lang.Object
edu.harvard.seas.pl.abcdatalog.ast.PredicateSym
A basic predicate symbol in Datalog.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
PredicateSym
(String sym, int arity) Constructs a predicate symbol from an identifier and a non-negative arity. -
Method Summary
Modifier and TypeMethodDescriptionstatic PredicateSym
Returns a predicate symbol with the given string identifier and arity.int
getArity()
Returns the arity of this predicate symbol.getSym()
Returns the string identifier of this predicate symbol.toString()
-
Field Details
-
sym
Identifier of the predicate symbol (i.e. the symbol itself). -
arity
protected final int arityArity of any atom formed from this predicate symbol.
-
-
Constructor Details
-
PredicateSym
Constructs a predicate symbol from an identifier and a non-negative arity.- Parameters:
sym
- identifierarity
- non-negative arity
-
-
Method Details
-
create
Returns a predicate symbol with the given string identifier and arity.- Parameters:
sym
- the string identifierarity
- the arity- Returns:
- the predicate symbol
-
getSym
Returns the string identifier of this predicate symbol.- Returns:
- the string identifier
-
getArity
public int getArity()Returns the arity of this predicate symbol.- Returns:
- the arity
-
toString
-