Class Symbol

java.lang.Object
edu.tufts.hrilab.fol.Symbol
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
Constant, Term, Variable

public class Symbol extends Object implements Cloneable, Serializable
Representation of symbol logical form.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Get name as String.
      Returns:
    • setName

      @Deprecated public void setName(String n)
      Deprecated.
      Set name.
      Parameters:
      n -
    • getType

      public String getType()
      Get type as String.
      Returns:
    • hasType

      public boolean hasType()
      Returns if type has been set.
      Returns:
    • equalsIgnoreType

      public boolean equalsIgnoreType(Object o)
      Compare without checking semantic type information.
      Parameters:
      o -
      Returns:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Constructs a String representation that includes type information, if available. If no type information is available it will be ignored. Strings will be of the form: "name:type(arg0:typ0,..., argN:typeN)".
      Overrides:
      toString in class Object
      Returns:
    • toUntypedString

      public String toUntypedString()
      Constructs a String representation that does not include type information.
      Returns:
      String of the form "name(arg0,..., argN)"
    • toUnnegatedForm

      public Symbol toUnnegatedForm()
      Returns a FOL instance that is not negated (i.e., drops outer "not" if it exists). This doesn't apply to the Symbol class which can't be negated, but is here as a convenience so that Term/Predicate instances passed as Symbols (e.g., via getArgs) don't need to be cast to Term/Predicate.
      Returns:
      Un-negated form of this FOL class.
    • clone

      public Symbol clone()
      Overrides:
      clone in class Object
    • hasArgs

      public boolean hasArgs()
      Checks if this symbol has arguments.
      Returns:
      always false since Symbol doesn't support arguments
    • isVariable

      public boolean isVariable()
    • isConstant

      public boolean isConstant()
    • isTerm

      public boolean isTerm()
    • isPredicate

      public boolean isPredicate()