The clocked lambda calculus [1] is an extension of the classical lambda calculus.

The classical lambda calculus is based on the \( \beta \)-rule: \[ (\lambda x.M) N \to M[x = N] \]

The clocked lambda calculus introduces a unary symbol \( \tau \) that serves as a witness of \( \beta \)-steps.

Clocked Lambda Calculus

The clocked lambda calculus consists of the following two rules: \[ \begin{aligned} (\lambda x.M) N &\to \tau( M[x = N] ) \\ \tau(M)N &\to \tau(MN) \end{aligned} \]

So the clocked lambda calculus refines lambda calculus such that each \( \beta \)-step produces one symbol \( \tau \). The second rule of the calculus ensures that the \( \tau \)’s can be moved out of the way of \( \beta \)-redex.

Consider Curry’s fixed-point combinator \( Y_0 \): \[ \begin{align} Y_0 & \equiv \lambda f. \omega_f \omega_f \\ \omega_f & \equiv \lambda x. f(xx) \end{align} \]

We have the following reduction: \[ \begin{align} Y_0 f &\to \tau ( \omega_f \omega_f ) \\ &\to \tau ( \tau ( f (\omega_f \omega_f) ) ) \\ &\to \tau ( \tau ( f ( \tau (f (\omega_f \omega_f) )))) \\ &\to \tau ( \tau ( f ( \tau (f (\tau (f (\omega_f \omega_f) )) )))) \\ &\to \cdots \end{align} \]

Consider Turing’s fixed-point combinator \( Y_1 \): \[ \begin{align} Y_1 & \equiv \eta \eta \\ \eta & \equiv \lambda xf. f (xxf) \end{align} \]

We have the following reduction: \[ \begin{align} Y_1 f &\equiv \eta \eta f \\ &\to \tau ( (\lambda f. f (\eta \eta f))) f \\ &\to \tau ( (\lambda f. f (\eta \eta f)) f ) \\ &\to \tau ( \tau ( f (\eta \eta f) ) ) \end{align} \]

The clocked lambda calculus is

  • confluent,
  • infinitary strongly normalizing and
  • infinitary confluent.

Note that the classical lambda calculus does not exhibit the latter two properties.

Clocked Böhm Trees

Clocked Lévy-Longo Trees

So every term has a unique infinitary normal form. These infinitary normal forms constitute enriched Lévy-Longo trees (a variant of Böhm trees), which we call clocked Lévy-Longo trees.

So instead of defining Lévy-Longo trees (Böhm trees) by corecursion, in the clocked lambda calculus they arise naturally by rewriting the terms to their infinitary normal form.

Böhm trees are often used to discriminate lambda terms:

If lambda terms have distinct Böhm trees, then they are not \( \beta \)-convertible.

But what if two terms have the same Böhm trees? For instance all fixed-point combinators have the same Böhm trees (and Lévy-Longo trees), namely: \[ \lambda f. f ( f ( f ( \ldots ))) \] However, they can have different clocked Lévy-Longo trees:

The infinite normal form, the clocked Lévy-Longo tree, of

  • Curry’s fixed-point combinator \( Y_0 \) is \[ \tau^2 ( f ( \tau (f ( \tau (f ( \tau (\ldots ))))))) \]
  • Turing’s fixed-point combinator \( Y_1 \) is \[ \tau^2 ( f ( \tau^2 (f ( \tau^2 (f ( \tau^2 (\ldots ))))))) \]

This can easily be seen from the reductions given above.

So Curry’s and Turing’s fixed-point combinators have distinct clocked Lévy-Longo trees. Moreover, their clock speed (the number of \( \tau \)’s) differs at an infinite number of positions. This suffices to conclude that Curry’s and Turing’s fixed-point combinator are not \( \beta \)-convertible since both Curry’s and Turing’s fixed-point combinators are simple terms.

Clocked Lévy-Longo trees can also be helpful in discriminating general (non-simple) lambda terms. In [2] we use the technique to answer the following question of Gordon Plotkin:

A Question of Gordon Plotkin

Is there a fixed point combinator \( Y \) such that \[ Y ( \lambda z. f zz ) =_\beta Y ( \lambda x. Y ( \lambda y. f xy )) \]

Relevant Papers

In [3] we introduce clocked Böhm trees to discriminate lambda terms with respect to \( \beta \)-convertibility.

In [2] we increase the discrimination power by improving the precision of the clocks, leading to atomic clocked Böhm trees, and we show that the method can be fruitfully applied to general lambda terms by answering the question of Gordon Plotkin mentioned above.

In [1] we introduce the clocked lambda calculus which internalizes the clock. Now the clocked Böhm trees arise naturally by rewriting, as infinite normal forms. In contrast to the standard lambda calculus, the clocked lambda calculus is infinitary confluent and infinitary strongly normalizing.

In [4] we consider fixed-point combinator (fpc) generators, that is, lambda terms \( G \) such that \( Y G \) is a fixed point combinator whenever \( Y \) is. We derive a complete characterization of all simply-typed fpc generators using Barendregt’s Inhabitation Machines.

The term \( \delta = \lambda xy. y(xy) \), also known as Smullyan’s Owl, is a famous fpc generator. It has the peculiar property that a term \( Y \) is a fixed-point combinator if and only if \( Y =_\beta \delta Y \).

This led Richard Statman to the following question:

Statman’s question on the existence of double fixed-point combinators

Is there a fixed-point combinator \( Y \) such that \( Y =_\beta Y \delta \)?

Statman called this combinator \( Y \) a double fixed-point combinator since it would satisfy both \( Y =_\beta \delta Y \) and \( Y =_\beta Y \delta \). This question remains open as the proof by Benedetto Intrigila contains a gap.

In [4] we present a conjecture that vastly generalizes Statman’s question. Our conjecture concerns the relation of the \( \mu \)-operator (also known as letrec) and its implementation by fixed-point combinators:

Conjecture

We conjecture that for any fixed-point combinator \( Y \) and simply-typed \(\lambda\mu\)-terms \( s,t \) it holds that

\[ s =_{ \beta \mu } t \iff s_Y =_{ \beta } t_Y \]

where \(s_Y, t_Y\) are the untyped lambda terms obtained from \(s,t\), respectively, by replacing all occurrences of \( \mu \)-operators with the fixed-point combinator \( Y \).

A confirmation of this conjecture would immediately imply a negative answer to Statman’s question.

References

  1. Clocked Lambda Calculus
    Jörg Endrullis, Dimitri Hendriks, Jan Willem Klop, and Andrew Polonsky
    Mathematical Structures in Computer Science , 27 (5) , pp. 782–806 (2017)
    paper

    Summary

    We introduce the clocked lambda calculus, an extension of the classical lambda calculus with a unary symbol \( \tau \) that serves as a witness of \( \beta \)-steps. This calculus consists of the following two rules: \[ \begin{aligned} (\lambda x.M) N &\to \tau( M[x = N] ) \\ \tau(M)N &\to \tau(MN) \end{aligned} \] The clocked lambda-calculus is infinitary strongly normalizing, infinitary confluent, and the unique infinitary normal forms constitute enriched Böhm trees (more precisely, Lévy-Longo trees), which we call clocked Böhm trees. We show that clocked Böhm trees are suitable for discriminating a rich class of lambda terms having the same Böhm trees.

    See research for an overview of my research on the clocked lambda claculus and fixed-point combinators.

    Bibtex

    @article{clocked:lambda:calculus:2017,
      author = {Endrullis, J\"{o}rg and Hendriks, Dimitri and Klop, Jan Willem and Polonsky, Andrew},
      title = {{Clocked Lambda Calculus}},
      journal = {Mathematical Structures in Computer Science},
      volume = {27},
      number = {5},
      pages = {782--806},
      year = {2017},
      doi = {10.1017/S0960129515000389},
      keywords = {rewriting, infinitary rewriting, lambda calculus},
      type = {journal}
    }
    

    Digital Object Identifier

    10.1017/S0960129515000389
  2. Discriminating Lambda-Terms Using Clocked Boehm Trees
    Jörg Endrullis, Dimitri Hendriks, Jan Willem Klop, and Andrew Polonsky
    Logical Methods in Computer Science , 10 (2) (2014)
    paper

    Summary

    As observed by Intrigila, there are hardly techniques available in the lambda calculus to prove that two lambda terms are not \( \beta \)-convertible. Techniques employing the usual Böhm trees are inadequate when we deal with terms having the same Böhm tree. This is the case in particular for fixed-point combinators, as they all have the same Böhm tree.

    Another interesting equation, whose consideration was suggested by Scott, is BY = BYS, an equation valid in the classical model \( P \omega \) of lambda calculus, and hence valid with respect to Böhm tree-equality, but nevertheless the terms are \( \beta \)-inconvertible.

    To prove such beta-inconvertibilities, we refine the concept of Böhm trees: we introduce clocked Böhm trees's with annotations that convey information of the tempo in which the Böhm trees are produced. Böhm trees are thus enriched with an intrinsic clock behaviour, leading to a refined discrimination method for lambda terms. An analogous approach pertains to Levy-Longo trees and Berarducci trees.

    We illustrate applicability of our refined Böhm trees at the following examples:

    • We show how to \( \beta \)-discriminate a large number of fixed-point combinators.
    • We answer a question of Gordon Plotkin: Is there a fixed point combinator \( Y \) such that \[ Y ( \lambda z. f zz ) =_\beta Y ( \lambda x. Y ( \lambda y. f xy )) \]
    We further increase the discrimination power of the technique by enhancing the precision of the clock, arriving at a notion that we call atomic clocks.

    This paper is an extended version of Modular Construction of Fixed Point Combinators and Clocked Böhm Trees (LICS 2010).

    See research for an overview of my research on the clocked lambda claculus and fixed-point combinators.

    Bibtex

    @article{lambda:clocks:2014,
      author = {Endrullis, J\"{o}rg and Hendriks, Dimitri and Klop, Jan Willem and Polonsky, Andrew},
      title = {{Discriminating Lambda-Terms Using Clocked Boehm Trees}},
      journal = {Logical Methods in Computer Science},
      volume = {10},
      number = {2},
      year = {2014},
      doi = {10.2168/LMCS-10(2:4)2014},
      keywords = {rewriting, infinitary rewriting, lambda calculus},
      type = {journal}
    }
    

    Digital Object Identifier

    10.2168/LMCS-10(2:4)2014
  3. Modular Construction of Fixed Point Combinators and Clocked Böhm Trees
    Jörg Endrullis, Dimitri Hendriks, and Jan Willem Klop
    In: Proc. Symp. on Logic in Computer Science (LICS 2010), pp. 111–119, IEEE Computer Society (2010)
    paper

    Summary

    One of the best-known methods for discriminating lambda terms with respect to \( \beta \)-convertibility is due to Corrado Böhm. Roughly speaking, the Böhm tree of a lambda term is its infinite normal form. If lambda terms have distinct Böhm trees, then they are not \( \beta \)-convertible. But what if their Böhm trees coincide? For example, all fixed-point combinators have the same Böhm tree, namely \[ \lambda x. x(x(x(\ldots))) \]

    We refine Böhm trees with a clock that records how many head reduction steps have been used to rewrite each subterm to head normal form. We show that clocked Böhm trees are suitable for discriminating a rich class of lambda terms (in particular many fixed-point combinators) having the same Böhm trees.

    We refer to Discriminating Lambda-Terms Using Clocked Boehm Trees (LMCS 2014) for an extended journal version of this paper. In the extended version we improve the precision of the clocks to atomic clocks and we answer a question of Gordon Plotkin, showing that the method can be used beyond simple terms.

    See research for an overview of my research on the clocked lambda claculus and fixed-point combinators.

    Bibtex

    @inproceedings{lambda:clocks:2010,
      author = {Endrullis, J\"{o}rg and Hendriks, Dimitri and Klop, Jan Willem},
      title = {{Modular Construction of Fixed Point Combinators and Clocked B\"{o}hm Trees}},
      booktitle = {Proc.\ Symp.\ on Logic in Computer Science (LICS~2010)},
      pages = {111--119},
      publisher = {{IEEE} Computer Society},
      year = {2010},
      doi = {10.1109/LICS.2010.8},
      keywords = {rewriting, infinitary rewriting, lambda calculus},
      type = {conference}
    }
    

    Digital Object Identifier

    10.1109/LICS.2010.8
  4. Clocks for Functional Programs
    Jörg Endrullis, Dimitri Hendriks, Jan Willem Klop, and Andrew Polonsky
    In: The Beauty of Functional Code - Essays Dedicated to Rinus Plasmeijer on the Occasion of His 61st Birthday, pp. 97–126, Springer (2013)
    paper

    Summary

    The contribution of this paper is twofold.

    First, we derive a complete characterization of all simply-typed fixed-point combinator (fpc) generators using Barendregt's Inhabitation Machines. A fpc generator is a lambda term \( G \) such that \( Y G \) is a fpc whenever \( Y \) is. The term \( \delta = \lambda xy. y(xy) \), also known as Smullyan's Owl, is a famous fpc generator. For instance, Turing's fpc \( Y_1 \) can be obtaind from Curry's fpc \( Y_0 \) by postfixing \( \delta \): \[ Y_1 = Y_0 \delta \]

    Second, we present a conjecture that vastly generalises Richard Statman's question on the existance of double fixed-point combinators. Statman asked whether there is a fixed-point combinator \( Y \) such that \( Y =_\beta Y \delta \). This question remains open as the proof by Benedetto Intrigila contains a gap. We have the following conjecture about the relation of the \( \mu \)-opertator and fixed-point combinators:

    Conjecture
    We conjecture that for any fixed-point combinator \( Y \) and simply-typed \( \lambda\mu \)-terms \( s,t \) it holds that \[ s =_{ \beta \mu } t \iff s_Y =_{ \beta } t_Y \] where \(s_Y, t_Y\) are the untyped lambda terms obtained from \(s,t\), respectively, by replacing all occurrences of \( \mu \)-operators with the fixed-point combinator \( Y \).
    This conjecture immediately implies a negative answer to Statman's question.

    See research for an overview of my research on the clocked lambda claculus and fixed-point combinators.

    Bibtex

    @inproceedings{lambda:clocks:functional:programs:2013,
      author = {Endrullis, J\"{o}rg and Hendriks, Dimitri and Klop, Jan Willem and Polonsky, Andrew},
      title = {{Clocks for Functional Programs}},
      booktitle = {The Beauty of Functional Code - Essays Dedicated to Rinus Plasmeijer on the Occasion of His 61st Birthday},
      pages = {97--126},
      year = {2013},
      doi = {10.1007/978-3-642-40355-2\_8},
      series = {LNCS},
      volume = {8106},
      publisher = {Springer},
      keywords = {rewriting, infinitary rewriting, lambda calculus},
      type = {journal}
    }
    

    Digital Object Identifier

    10.1007/978-3-642-40355-2_8