Correctness of copy in calculi with letrec

  • Authors:
  • Manfred Schmidt-Schauß

  • Affiliations:
  • FB Informatik und Mathematik, Institut für Informatik, J.W. Goethe-Universität, Frankfurt, Germany

  • Venue:
  • RTA'07 Proceedings of the 18th international conference on Term rewriting and applications
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

Call-by-need lambda calculi with letrec provide a rewriting-based operational semantics for (lazy) call-by-name functional languages. These calculi model the sharing behavior during evaluation more closely than let-based calculi that use a fixpoint combinator. However, currently the knowledge about correctness w.r.t. observational equivalence of modifying the sharing in letrec-based calculi is full of gaps. In this paper we develop a new proof method based on a calculus on infinite trees, generalizing the parallel 1-reduction, for showing correctness of instantiation operations. We demonstrate the method in the small calculus LR? and show that copying at compile-time can be done without restrictions. We also show that the call-by-need and call-by-name strategies are equivalent w.r.t. contextual equivalence. A consequence is correctness of all the transformations like instantiation, inlining, specialization and common subexpression elimination in LRλ. The result for LRλ also gives an answer to unresolved problems in several papers and thus contributes to the knowledge about deterministic calculi with letrec. The method also works for a calculus with case and constructors, and also with parallel or. We are also confident that the method scales up for proving correctness of copy-related transformations in nondeterministic lambda calculi if restricted to "deterministic" subterms.