A Functional-Logic Perspective on Parsing

Parsing has been a traditional workbench for showing the virtues of declarative programming. Both logic and functional programming claim the ability of writing parsers in a natural and concise way. We address here the task from a functional-logic perspective. By modelling parsers as non-deterministic functions we achieve a very natural manner of building parsers, which combines the nicest properties of the functional and logic approaches. In particular, we are able to define parsers within our framework in a style very close to that of functional programming parsers, but using simpler concepts. Moreover, we have moved beyond usual declarative approaches to parsers, since the functional-logic parsers presented here can be considered as truly data values. As an example of this feature we define a function that detects ambiguous grammars.

[1]  Ralf Hinze,et al.  Haskell 98 — A Non−strict‚ Purely Functional Language , 1999 .

[2]  Lee Naish A Higher Order Rewriting Logic for Functional Logic Programming , 1997 .

[3]  Philip Wadler,et al.  Monads for functional programming , 1995, NATO ASI PDC.

[4]  Rene Leermakers,et al.  The Functional Treatment of Parsing , 1993 .

[5]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[6]  Michael Hanus,et al.  The Integration of Functions into Logic Programming: From Theory to Practice , 1994, J. Log. Program..

[7]  Michael Hanus,et al.  The integration of functions into logic programming: a survey , 1994 .

[8]  Johan Jeuring,et al.  Merging Monads and Folds for Functional Programming , 1995, Advanced Functional Programming.

[9]  Francisco Javier López-Fraguas,et al.  An Approach to Declarative Programming Based on a Rewriting Logic , 1999, J. Log. Program..

[10]  Rita Loogen,et al.  A Demand Driven Computation Strategy for Lazy Narrowing , 1993, PLILP.

[11]  J. C. Gonz Alez-Moreno,et al.  An Approach to Declarative Programming Based on a Rewriting Logic , 2022 .

[12]  Mario Rodríguez-Artalejo,et al.  A Higher Order Rewriting Logic for Functional Logic Programming , 1997, ICLP.

[13]  Richard S. Bird,et al.  FUNCTIONAL PEARL On building trees with minimum height , 1997, Journal of Functional Programming.

[14]  Philip Wadler Monads for Functional Programming , 1995, Advanced Functional Programming.

[15]  Donald Sanella What Does the Future Hold for Theoretical Computer Science , 1997 .

[16]  Juan Carlos González Moreno A Correctness Proof for Warren's HO into FO Translation , 1993, GULP.

[17]  Graham Hutton,et al.  Higher-order functions for parsing , 1992, Journal of Functional Programming.

[18]  Rafael Caballero,et al.  Extensions: A Technique for Structuring Functional-Logic Programs , 1999, Ershov Memorial Conference.

[19]  Graham Hutton,et al.  Monadic parsing in Haskell , 1998, Journal of Functional Programming.

[20]  Jeroen D. Fokker,et al.  Functional Parsers , 1995, Advanced Functional Programming.

[21]  Philip Wadler,et al.  Packrat parsing:: simple, powerful, lazy, linear time, functional pearl , 2002, ICFP '02.

[22]  Christian Prehofer,et al.  Solving higher order equations: from logic to programming , 2012 .

[23]  Francisco Javier López-Fraguas,et al.  TOY: A Multiparadigm Declarative System , 1999, RTA.

[24]  Puri Arenas,et al.  A Semantic Framework for Functional Logic Programming with Algebraic Polymorphic Types , 1997, TAPSOFT.

[25]  Pierre Deransart,et al.  Programming Languages Implementation and Logic Programming , 1989, Lecture Notes in Computer Science.

[26]  Leon Sterling,et al.  The Art of Prolog , 1987, IEEE Expert.