Theorem Proving Methods

Algebraic and Logic Programming

Volume 1298 of the series Lecture Notes in Computer Science pp 273-286

Date:

Optimal left-to-right pattern-matching automata

  • Nadia NedjahAffiliated withComputation Dept., UMIST
  • , Colin D. WalterAffiliated withComputation Dept., UMIST
  • , Stephen E. EldridgeAffiliated withComputation Dept., UMIST

* Final gross prices may vary according to local VAT.

Get Access

Abstract

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.

Keywords

Term rewriting system pattern-matching tree automaton dag automaton