Normal-order reduction grammars

We present an algorithm which, for given $n$, generates an unambiguous regular tree grammar defining the set of combinatory logic terms, over the set $\{S,K\}$ of primitive combinators, requiring exactly $n$ normal-order reduction steps to normalize. As a consequence of Curry and Feys's standardization theorem, our reduction grammars form a complete syntactic characterization of normalizing combinatory logic terms. Using them, we provide a recursive method of constructing ordinary generating functions counting the number of $S K$-combinators reducing in $n$ normal-order reduction steps. Finally, we investigate the size of generated grammars, giving a primitive recursive upper bound.

[1]  Alexandra Silva,et al.  Generalizing determinization from automata to coalgebras , 2013, Log. Methods Comput. Sci..

[2]  Christophe Raffalli,et al.  Asymptotically almost all \lambda-terms are strongly normalizing , 2009 .

[3]  Bernhard Gittenberger,et al.  On the Number of Unary-Binary Tree-Like Structures with Restrictions on the Unary Height , 2015, 1510.01167.

[4]  Gregor Engels,et al.  SOFSEM 2016: Theory and Practice of Computer Science , 2016, Lecture Notes in Computer Science.

[5]  Milton Abramowitz,et al.  Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables , 1964 .

[6]  Hubert Comon,et al.  Tree automata techniques and applications , 1997 .

[7]  Haskell B. Curry Grundlagen der kombinatorischen Logik , 1930 .

[8]  D. A. Turner,et al.  A new implementation technique for applicative languages , 1979, Softw. Pract. Exp..

[9]  William C. Frederick,et al.  A Combinatory Logic , 1995 .

[10]  RENÉ DAVID,et al.  ASYMPTOTICALLY ALMOST ALL λ-TERMS ARE STRONGLY NORMALIZING , 2013 .

[11]  Thorsten Gerber,et al.  Handbook Of Mathematical Functions , 2016 .

[12]  Pierre Lescanne,et al.  Counting and generating lambda terms , 2012, Journal of Functional Programming.

[13]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[14]  Maribel Fernández The Lambda Calculus , 2009 .

[15]  Pierre Lescanne,et al.  Boltzmann samplers for random generation of lambda terms , 2014, ArXiv.

[16]  David Turner An overview of Miranda , 1986, SIGP.

[17]  Koen Claessen,et al.  Testing an optimising compiler by generating random lambda terms , 2011, AST '11.

[18]  M. Schönfinkel Über die Bausteine der mathematischen Logik , 1924 .

[19]  Philippe Flajolet,et al.  Analytic Combinatorics , 2009 .

[20]  Zbigniew Golebiewski,et al.  On the Number of Lambda Terms With Prescribed Size of Their De Bruijn Representation , 2016, STACS.