Circularity and Lambda Abstraction: From Bird to Pettorossi and back

We present a transformation between lazy circular programs à la Bird and strict circular programs à la Pettorossi. Circular programs à la Bird rely on lazy recursive binding: they involve circular unknowns and make sense equationally. Circular programs à la Pettorossi rely on the inductive construction of functions and their eventual application: they involve no circular unknowns and make sense operationally. Our derivation connects these equational and operational approaches: given a lazy circular program à la Bird, we decouple the circular unknowns from what is done to them, which we lambda-abstract with functions. The circular unknowns then become dead variables, which we eliminate. The result is a strict circular program à la Pettorossi. This transformation is reversible: given a strict circular program à la Pettorossi, we introduce circular unknowns as dead variables, and we apply the functions to them. The result is a lazy circular program à la Bird. We illustrate the two transformations by mapping a tree to an isomorphic one with new leaves, reading a binary number as suggested by Knuth, and backpatching.