Class Variable

java.lang.Object
edu.uky.ai.logic.Term
edu.uky.ai.logic.Variable
All Implemented Interfaces:
Formula, Comparable<Formula>

public class Variable extends Term
A variable represents a placeholder for a Term.
Author:
Stephen G. Ware
  • Constructor Details

    • Variable

      public Variable(String type, String name)
      Constructs a new variable with the given type and name.
      Parameters:
      type - the type of the variable
      name - the name of the variable
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Term
    • isGround

      public boolean isGround()
      Description copied from interface: Formula
      Checks whether this formula contains any variables.
      Returns:
      true if the formula is ground, false otherwise
    • makeUnique

      public Variable makeUnique()
      Returns a new variable object with the same type and a name which is similar to this variable's name but guaranteed to be unique (i.e. no other variable has the same name).
      Returns:
      a uniquely named variable of the same type