Normalization by Evaluation in the Delay Monad
2016
Abstract
We present an Agda formalization of a normalization proof for simply-typed lambda terms. The normalizer consists of two coinductively defined functions in the delay monad: One is a standard evaluator of lambda terms to closures, the other a type-directed reifier from values to η-long β-normal forms. Their composition, normalization-by-evaluation, is shown to be a total function a posteriori, using a standard logical-relations argument. The normalizer is then shown to be sound and complete. The completeness proof proof is dependent on termination. We also discuss a variation on this normalizer where environments used by the evaluator contain delayed values which can be proven complete independently of termination using weak bisimilarity. This approach would be a realisation of an aim of this work to present a modular proof of normalization where termination, soundness and completeness are independent. The successful formalization serves as a proof-of-concept for coinductive programmi...
References (5)
- Andreas Abel and James Chapman. Normalization by evaluation in the delay monad: Formaliza- tion. http://github.com/andreasabel/continuous-normalization.
- Andreas Abel and James Chapman. Normalization by evaluation in the delay monad: A case study for coinduction via copatterns and sized types. In Paul Levy and Neel Krishnaswami, editors, Pro- ceedings 5th Workshop on Mathematically Structured Functional Programming, Grenoble, France, 12 April 2014, volume 153 of Electronic Proceedings in Theoretical Computer Science, pages 51-67. Open Publishing Association, 2014.
- Andreas Abel and Brigitte Pientka. Well-founded recursion with copatterns and sized types. Journal of Functional Programming, 26:61, 2016. ICFP 2013 special issue.
- AgdaTeam. The Agda Wiki, 2016.
- Venanzio Capretta. General recursion via coinductive types. Logical Methods in Computer Science, 1(2), 2005.