The Safe Lambda Calculus

Safety is a syntactic condition of higher-order grammars that constrains occurrences of variables in the production rules according to their type-theoretic order. In this paper, we introduce the safe lambda calculus, which is obtained by transposing (and generalizing) the safety condition to the setting of the simply-typed lambda calculus. In contrast to the original definition of safety, our calculus does not constrain types (to be homogeneous). We show that in the safe lambda calculus, there is no need to rename bound variables when performing substitution, as variable capture is guaranteed not to happen.We also propose an adequate notion of β-reduction that preserves safety. In the same vein as Schwichtenberg's 1976 characterization of the simply-typed lambda calculus, we show that the numeric functions representable in the safe lambda calculus are exactly the multivariate polynomials; thus conditional is not definable. Finally we give a game-semantic analysis of safety: We show that safe terms are denoted by P-incrementally justified strategies. Consequently pointers in the game semantics of safe λ-terms are only necessary from order 4 onwards.

[1]  Géraud Sénizergues,et al.  L(A) = L(B) ? decidability results from complete formal systems , 2001 .

[2]  Dan R. Ghica,et al.  Reasoning about Idealized ALGOL Using Regular Languages , 2000, ICALP.

[3]  Klaus Aehlig,et al.  Safety Is not a Restriction at Level 2 for String Languages , 2005, FoSSaCS.

[4]  C.-H. Luke Ong,et al.  On Full Abstraction for PCF: I, II, and III , 2000, Inf. Comput..

[5]  Ralph Loader Notes on Simply Typed Lambda Calculus , 1998 .

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

[7]  Pawel Urzyczyn,et al.  Higher-Order Pushdown Trees Are Easy , 2002, FoSSaCS.

[8]  Pierre-Louis Curien,et al.  Sequential Algorithms on Concrete Data Structures , 1982, Theor. Comput. Sci..

[9]  Radha Jagadeesan,et al.  Full Abstraction for PCF , 2000, Inf. Comput..

[10]  Radha Jagadeesan,et al.  Full Abstraction for PCF , 1994, Inf. Comput..

[11]  C.-H. Luke Ong An approach to deciding the observational equivalence of Algol-like languages , 2004, Ann. Pure Appl. Log..

[12]  Guy McCusker Games and Full Abstraction for a Functional Metalanguage with Recursive Types , 1998, Distinguished Dissertations.

[13]  Helmut Schwichtenberg,et al.  Definierbare Funktionen imλ-Kalkül mit Typen , 1975, Archive for Mathematical Logic.

[14]  Marek Zaionc,et al.  Word Operation Definable in the Typed lambda-Calculus , 1987, Theor. Comput. Sci..

[15]  Daniel Leivant,et al.  Functions Over Free Algebras Definable in the Simply Typed lambda Calculus , 1993, Theor. Comput. Sci..

[16]  H. Schwichtenberg,et al.  Definierbare Funktionen im Lambda-Kalkül mit Typen , 1976 .

[17]  Dan R. Ghica,et al.  Data-Abstraction Refinement: A Game Semantic Approach , 2005, SAS.

[18]  Marek Zaionc On the "lambda"-definable tree operations , 1988, Algebraic Logic and Universal Algebra in Computer Science.

[19]  William W. Tait,et al.  Intensional interpretations of functionals of finite type I , 1967, Journal of Symbolic Logic.

[20]  Marek Zaionc,et al.  lambda-Definability on Free Algebras , 1991, Ann. Pure Appl. Log..

[21]  C.-H. Luke Ong,et al.  On Model-Checking Trees Generated by Higher-Order Recursion Schemes , 2006, 21st Annual IEEE Symposium on Logic in Computer Science (LICS'06).

[22]  Andreas Blass,et al.  A Game Semantics for Linear Logic , 1992, Ann. Pure Appl. Log..

[23]  Richard Statman,et al.  Intuitionistic Propositional Logic is Polynomial-Space Complete , 1979, Theor. Comput. Sci..

[24]  John C. Reynolds,et al.  The essence of ALGOL , 1997 .

[25]  Didier Caucal On Infinite Terms Having a Decidable Monadic Theory , 2002, MFCS.

[26]  Harry G. Mairson,et al.  Database Query Languages Embedded in the Typed Lambda Calculus , 1996, Inf. Comput..

[27]  Daniel Leivant,et al.  Lambda Calculus Characterizations of Poly-Time , 1993, Fundam. Informaticae.

[28]  Alfred V. Aho,et al.  Indexed Grammars—An Extension of Context-Free Grammars , 1967, SWAT.

[29]  Andrzej S. Murawski,et al.  Third-Order Idealized Algol with Iteration Is Decidable , 2005, FoSSaCS.

[30]  Hanno Nickau Hereditarily Sequential Functionals , 1994, LFCS.

[31]  Werner Damm,et al.  An Automata-Theoretical Characterization of the OI-Hierarchy , 1986, Inf. Control..

[32]  Richard Statman,et al.  The Typed lambda-Calculus is not Elementary Recursive , 1979, Theor. Comput. Sci..

[33]  Daniel Leivant,et al.  The Expressiveness of Simple and Second-Order Type Structures , 1983, JACM.

[34]  Harry G. Mairson A Simple Proof of a Theorem of Statman , 1992, Theor. Comput. Sci..

[35]  Aleksy Schubert The Complexity of beta-Reduction in Low Orders , 2001, TLCA.

[36]  Marvin Minsky,et al.  Computation : finite and infinite machines , 2016 .

[37]  Andrzej S. Murawski On program equivalence in languages with ground-type references , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[38]  Werner Damm,et al.  The IO- and OI-Hierarchies , 1982, Theor. Comput. Sci..

[39]  Marek Zaionc,et al.  Lambda Representation of Operations Between Fifferent Term Algebras , 1994, CSL.

[40]  Naoki Kobayashi Types and higher-order recursion schemes for verification of higher-order programs , 2009, POPL '09.