A Sheaf-Theoretic Approach to Pattern Matching and Related Problems

Abstract We present a general theory of pattern matching by adopting an extensional, geometric view of patterns. Representing the geometry of the pattern via a Grothendieck topology, the extension of the matching relation for a constant target and varying pattern forms a sheaf. We derive a generalized version of the Knuth-Morris-Pratt string-matching algorithm by gradually converting this extensional description into an intensional description, i.e., an algorithm. The generality of this approach is illustrated by briefly considering other applications: Earley's algorithm for parsing, Waltz filtering for scene analysis, matching modulo commutativity, and the n-queens problem.

[1]  M. Barr,et al.  Toposes, Triples and Theories , 1984 .

[2]  D. Scott,et al.  Applications of sheaves , 1979 .

[3]  Richard S. Bird,et al.  Formal Derivation of a Pattern Matching Algorithm , 1989, Sci. Comput. Program..

[4]  Theodore P. Baker A Technique for Extending Rapid Exact-Match String Matching to Arrays of More Than One Dimension , 1978, SIAM J. Comput..

[5]  R.S. Bird,et al.  Two Dimensional Pattern Matching , 1977, Inf. Process. Lett..

[6]  Helmuth Partsch,et al.  Another Case Study on Reusability of Transformational Developments Pattern Matching According to Knuth, Morris, and Pratt , 1991, Methods of Programming.

[7]  Robert Paige,et al.  Finite Differencing of Computable Expressions , 1982, TOPL.

[8]  L. Steen,et al.  What is a Sheaf? , 1970 .

[9]  Jaap van der Woude Playing with Patterns, Searching for Strings , 1989, Sci. Comput. Program..

[10]  Edsger W. Dijkstra,et al.  Notes on structured programming , 1970 .

[11]  Donald E. Knuth,et al.  Fast Pattern Matching in Strings , 1977, SIAM J. Comput..

[12]  Niklaus Wirth,et al.  Program development by stepwise refinement , 1971, CACM.

[13]  Jochen Burghardt A Tree Pattern Matching Algorithm with Reasonable Space Requirements , 1988, CAAP.

[14]  David B. Benson The Basic Algebraic Structures in Categories of Derivations , 1975, Inf. Control..

[15]  Yellamraju V. Srinivas Pattern Matching: A Sheaf-Theoretic Approach , 1991, AMAST.

[16]  Michael Barr,et al.  Category theory for computing science , 1995, Prentice Hall International Series in Computer Science.

[17]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[18]  Lawrence L. Larmore,et al.  New applications of failure functions , 1987, JACM.

[19]  M. Demazure Topologies et Faisceaux , 1970 .

[20]  R. Goldblatt Topoi, the Categorial Analysis of Logic , 1979 .

[21]  S. Lane Categories for the Working Mathematician , 1971 .

[22]  Benjamin C. Pierce,et al.  Basic category theory for computer scientists , 1991, Foundations of computing.

[23]  A. Grothendieck,et al.  Théorie des Topos et Cohomologie Etale des Schémas , 1972 .

[24]  Jay Earley,et al.  An efficient context-free parsing algorithm , 1970, Commun. ACM.

[25]  Charles L. Forgy,et al.  Rete: A Fast Algorithm for the Many Patterns/Many Objects Match Problem , 1982, Artif. Intell..

[26]  Alfred V. Aho,et al.  Efficient string matching , 1975, Commun. ACM.

[27]  Douglas R. Smith,et al.  KIDS: A Semiautomatic Program Development System , 1990, IEEE Trans. Software Eng..

[28]  Rod M. Burstall,et al.  Computational category theory , 1988, Prentice Hall International Series in Computer Science.

[29]  Douglas R. Smith Structure and Design of Global Search Algorithms , 2006 .

[30]  David L. Waltz,et al.  Understanding Line drawings of Scenes with Shadows , 1975 .

[31]  W. H. J. Feijen,et al.  Beauty Is Our Business: A Birthday Salute to Edsger W.Dijkstra , 1990 .

[32]  Christoph M. Hoffmann,et al.  Pattern Matching in Trees , 1982, JACM.

[33]  Douglas R. Smith,et al.  Top-Down Synthesis of Divide-and-Conquer Algorithms , 1985, Artif. Intell..

[34]  Joseph M. Morris Programming by expression refinement: the KMP algorithm , 1990 .