Class PredicateSym

java.lang.Object
edu.harvard.seas.pl.abcdatalog.ast.PredicateSym

public class PredicateSym extends Object
A basic predicate symbol in Datalog.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final int
    Arity of any atom formed from this predicate symbol.
    protected final String
    Identifier of the predicate symbol (i.e.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    PredicateSym(String sym, int arity)
    Constructs a predicate symbol from an identifier and a non-negative arity.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(String sym, int arity)
    Returns a predicate symbol with the given string identifier and arity.
    int
    Returns the arity of this predicate symbol.
    Returns the string identifier of this predicate symbol.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • sym

      protected final String sym
      Identifier of the predicate symbol (i.e. the symbol itself).
    • arity

      protected final int arity
      Arity of any atom formed from this predicate symbol.
  • Constructor Details

    • PredicateSym

      protected PredicateSym(String sym, int arity)
      Constructs a predicate symbol from an identifier and a non-negative arity.
      Parameters:
      sym - identifier
      arity - non-negative arity
  • Method Details

    • create

      public static PredicateSym create(String sym, int arity)
      Returns a predicate symbol with the given string identifier and arity.
      Parameters:
      sym - the string identifier
      arity - the arity
      Returns:
      the predicate symbol
    • getSym

      public String 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

      public String toString()
      Overrides:
      toString in class Object