Interface ConstOnlySubstitution

All Superinterfaces:
Substitution
All Known Implementing Classes:
ClauseSubstitution, SimpleConstSubstitution

public interface ConstOnlySubstitution extends Substitution
A mapping from variables to constants. This is a restriction of a more general substitution, which is from variables to terms.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Attempts to add a mapping to the substitution.
    Retrieves the mapping of a variable.

    Methods inherited from interface edu.harvard.seas.pl.abcdatalog.util.substitution.Substitution

    apply
  • Method Details

    • get

      Retrieves the mapping of a variable.
      Specified by:
      get in interface Substitution
      Parameters:
      x - the variable
      Returns:
      the constant that the variable is bound to, or null if the variable is not in the substitution
    • add

      boolean add(Variable x, Constant c)
      Attempts to add a mapping to the substitution. Returns true if the mapping was made successfully (i.e., if the variable was not already mapped to another constant).
      Parameters:
      x - the variable
      c - the constant
      Returns:
      whether the mapping was successfully added