Class Constant

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

public class Constant extends Term
A constant represents a specific unique thing.
Author:
Stephen G. Ware
  • Constructor Details

    • Constant

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

    • 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
    • substitute

      public Constant substitute(Substitution substitution)
      Description copied from interface: Formula
      Returns a version of this formula such that any elements that appear in the given substitution are replaced.
      Specified by:
      substitute in interface Formula
      Overrides:
      substitute in class Term
      Parameters:
      substitution - the substitution
      Returns:
      a formula with replacements from the substitution