Algebraic and Logic Programming pp 273-286
Optimal left-to-right pattern-matching automata
- Cite this paper as:
- Nedjah N., Walter C.D., Eldridge S.E. (1997) Optimal left-to-right pattern-matching automata. In: Hanus M., Heering J., Meinke K. (eds) Algebraic and Logic Programming. Lecture Notes in Computer Science, vol 1298. Springer, Berlin, Heidelberg
We propose a practical technique to compile pattern-matching for prioritised overlapping patterns in equational languages into a minimal, deterministic, left-to-right, matching automaton. First, we present a method for constructing a tree matching automaton for such patterns. This allows pattern-matching to be performed without any backtracking. Space requirements are reduced by using a directed acyclic graph (dag) automaton that shares all the isomorphic subautomata which are duplicated in the tree automaton. We design an efficient method to identify such subautomata and avoid duplicating their construction while generating the dag automaton. We conclude with some easily computed bounds on the size of the automata, thereby improving on previously known equivalent bounds for the tree automaton.
KeywordsTerm rewriting system pattern-matching tree automaton dag automaton
Unable to display preview. Download preview PDF.