Class HashSubstitution

java.lang.Object
edu.uky.ai.logic.HashSubstitution
All Implemented Interfaces:
Substitution, Cloneable

public class HashSubstitution extends Object implements Substitution, Cloneable
A substitution which uses a HashMap to keep track of substitutions.
Author:
Stephen G. Ware
  • Constructor Details

    • HashSubstitution

      protected HashSubstitution(HashSubstitution toClone)
      Constructs a new hash substitution which is a clone of the given substitution.
      Parameters:
      toClone - the substitution to clone
    • HashSubstitution

      public HashSubstitution()
      Constructs a new, empty hash substitution.
  • Method Details

    • get

      public Formula get(Formula original)
      Description copied from interface: Substitution
      Defines what a given formula should be replaced with.
      Specified by:
      get in interface Substitution
      Parameters:
      original - the formula which may be replaced
      Returns:
      the replacement formula, or the original formula if no replacement is defined
    • set

      public void set(Formula original, Formula replacement)
      Specifies that a given formula should be replaced with another formula.
      Parameters:
      original - the formula to be replaced
      replacement - the formula that will replace it
    • clone

      public HashSubstitution clone()
      Overrides:
      clone in class Object