Class RewriteSequenceSearch

java.lang.Object
es.ucm.maude.bindings.RewriteSequenceSearch
All Implemented Interfaces:
Iterable<Term>, Iterator<Term>

public class RewriteSequenceSearch extends Object implements Iterable<Term>, Iterator<Term>
An iterator through the solutions of a search.
  • Method Details

    • delete

      public void delete()
    • iterator

      public Iterator<Term> iterator()
      Specified by:
      iterator in interface Iterable<Term>
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<Term>
    • next

      public Term next()
      Specified by:
      next in interface Iterator<Term>
    • getRewriteCount

      public int getRewriteCount()
      Get the number of rewrites until this term has been found.
    • getSubstitution

      public Substitution getSubstitution()
      Get the matching substitution of the solution into the pattern.
    • getRule

      public Rule getRule(int stateNr)
      Get the rule leading to the given state.

      Parameters:
      stateNr - The number of a state in the search graph
      or -1 for the current one.
    • getRule

      public Rule getRule()
      Get the rule leading to the given state.

    • getStateTerm

      public Term getStateTerm(int stateNr)
      Get the term of a given state.

      Parameters:
      stateNr - The number of a state in the search graph.
    • __next

      public Term __next()
      Get the next match.

      Returns:
      A term or a null pointer if there is no more matches.
    • getStateNr

      public int getStateNr()
      Get an internal state number that allows reconstructing
      the path to this term.
    • getStateParent

      public int getStateParent(int stateNr)
      Get the parent state.

      Parameters:
      stateNr - The number of a state in the search graph.

      Returns:
      The number of the parent or -1 for the root.