Class Substitution

java.lang.Object
es.ucm.maude.bindings.Substitution

public class Substitution extends Object
Substitution (mapping from variables to terms).
  • Constructor Details

    • Substitution

      public Substitution(TermVector vars, TermVector values)
      Create a substitution with the given variables and values.

      Parameters:
      vars - Variables in the substitution.
      values - values Values for these variables in the substitution.
  • Method Details

    • delete

      public void delete()
    • size

      public int size()
      Get the number of variables in the substitution.
    • value

      public Term value(Term variable)
      Get the value of a given variable.

      Parameters:
      variable - The variable whose value is looked up.
    • matchedPortion

      public Term matchedPortion()
      Get the matched portion when matching with extension.

      Returns:
      The matched portion or null if the
      whole term matched.
    • find

      public Term find(String name, Sort sort)
      Find the value of a given variable by name.

      Parameters:
      name - Variable name (without sort).
      sort - Sort of the variable (optional).

      Returns:
      The value of the variable or null if not found.
      If the sort of the variable is not given, multiple results
      are possible.
    • find

      public Term find(String name)
      Find the value of a given variable by name.

      Parameters:
      name - Variable name (without sort).


      Returns:
      The value of the variable or null if not found.
      If the sort of the variable is not given, multiple results
      are possible.
    • instantiate

      public Term instantiate(Term term)
      Instantiate a term with this substitution.

      Parameters:
      term - The term to be instantiated.

      Returns:
      The instantiated term.
    • iterator

      public Iterator iterator()
      Get an iterator to the substitution assignments.
    • toString

      public String toString()
      Overrides:
      toString in class Object