Chapter

Combinatorial Pattern Matching

Volume 2676 of the series Lecture Notes in Computer Science pp 295-314

Date:

More Efficient Left-to-Right Pattern Matching in Non-sequential Equational Programs

  • Nadia NedjahAffiliated withDepartment of Systems Engineering and Computation, Faculty of Engineering, State University of Rio de Janeiro
  • , Luiza de Macedo MourelleAffiliated withDepartment of Systems Engineering and Computation, Faculty of Engineering, State University of Rio de Janeiro

* Final gross prices may vary according to local VAT.

Get Access

Abstract

Pattern matching is a fundamental feature in many applications such as functional programming, logic programming, theorem proving, term rewriting and rule-based expert systems. Usually, patterns are pre-processed into a deterministic finite automaton. Using such an automaton allows one to determine the matched pattern(s) by a single scan of the input term. The matching automaton is typically based on left-to-right traversal of patterns. In this paper, we propose a method to build such an automaton. Then, we propose an incremental method to build a deterministic concise automaton for non-necessarily sequential rewriting systems. With ambiguous patterns a subject term may be an instance of more than one pattern. To select the pattern to use, a priority rule is usually engaged. The pre-processing of the patterns adds new patterns, which are instances of the original ones. When the original patterns are ambiguous, some of the instances supplied may be irrelevant for the matching process. They may cause an unnecessary increase in the space requirements of the automaton and may also reduce the time efficiency of the matching process. Here, we devise a new pre-processing operation that recognises and avoids such irrelevant instances. Hence improves space and time requirements for the matching automaton.