On a uniform representation of combinators, arithmetic, lambda terms and types

A uniform representation, as binary trees with empty leaves, is given to expressions built with Rosser's X-combinator, natural numbers, lambda terms and simple types. Type inference, normalization of combinator expressions and lambda terms in de Bruijn notation, ranking/unranking algorithms and tree-based natural numbers are described as a literate Prolog program. With sound unification and compact expression of combinatorial generation algorithms, logic programming is shown to conveniently host a declarative playground where interesting properties and behaviors emerge from the interaction of heterogenous but deeply connected computational objects.

[1]  Paul Tarau Arithmetic and Boolean Operations on Recursively Run-Length Compressed Natural Numbers , 2014, Sci. Ann. Comput. Sci..

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

[3]  John Tromp Binary Lambda Calculus and Combinatory Logic , 2006, Kolmogorov Complexity and Applications.

[4]  J. Zukas Introduction to the Modern Theory of Dynamical Systems , 1998 .

[5]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

[6]  Simon Peyton Jones,et al.  The Implementation of Functional Programming Languages (Prentice-hall International Series in Computer Science) , 1987 .

[7]  Richard Statman,et al.  Lambda Calculus with Types , 2013, Perspectives in logic.

[8]  René David,et al.  Some properties of random lambda terms , 2009, Log. Methods Comput. Sci..

[9]  Paul Tarau,et al.  Compact serialization of Prolog terms (with catalan skeletons, cantor tupling and Gödel numberings) , 2013, Theory and Practice of Logic Programming.

[10]  Pawel M. Idziak,et al.  How big is BCI fragment of BCK logic , 2013, J. Log. Comput..

[11]  Mayer Goldberg A construction of one-point bases in extended lambda calculi , 2004, Inf. Process. Lett..

[12]  Paul Tarau,et al.  A Generic Numbering System based on Catalan Families of Combinatorial Objects , 2014, ArXiv.

[13]  John Lamping An algorithm for optimal lambda calculus reduction , 1989, POPL '90.

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

[15]  Paul Tarau On Logic Programming Representations of Lambda Terms: de Bruijn Indices, Compression, Type Inference, Combinatorial Generation, Normalization , 2015, PADL.

[16]  J. Roger Hindley,et al.  Lambda-Calculus and Combinators: An Introduction , 2008 .

[17]  Paul Tarau,et al.  Bijective Collection Encodings and Boolean Operations with Hereditarily Binary Natural Numbers , 2014, ACM-SIGPLAN International Conference on Principles and Practice of Declarative Programming.

[18]  Danièle Gardy,et al.  Lambda-terms of Bounded Unary Height , 2011, ANALCO.

[19]  Peter Sestoft,et al.  Demonstrating Lambda Calculus Reduction , 2001, MFPS.

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

[21]  Fairouz Kamareddine,et al.  Reviewing the Classical and the de Bruijn Notation for [lambda]-calculus and Pure Type Systems , 2001, J. Log. Comput..

[22]  Christophe Raffalli,et al.  Some properties of random -terms ∗ , 2009 .

[23]  Michael Stay,et al.  Very Simple Chaitin Machines for Concrete AIT , 2005, Fundam. Informaticae.

[24]  Juris Hartmanis,et al.  On Simple Goedel Numberings and Translations , 1974, ICALP.

[25]  N. J. A. Sloane,et al.  The On-Line Encyclopedia of Integer Sequences , 2003, Electron. J. Comb..

[26]  Dimitrios Vytiniotis,et al.  Functional pearl: every bit counts , 2010, ICFP '10.

[27]  de Ng Dick Bruijn,et al.  Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem , 1972 .

[28]  Paul Tarau,et al.  Computing with Catalan Families , 2014, LATA.

[29]  K. Gödel Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I , 1931 .

[30]  Jeroen D. Fokker,et al.  The systematic construction of a one-combinator basis for Lambda-Terms , 1992, Formal Aspects of Computing.

[31]  Ayumi Shinohara,et al.  Functional programs as compressed data , 2012, PEPM '12.

[32]  Charalambos A. Charalambides,et al.  Enumerative combinatorics , 2018, SIGA.

[33]  Cantor Tupling,et al.  Compact Serialization of Prolog Terms ( with Catalan Skeletons , , 2013 .