Proving Syntactic Properties of Exceptions in an Ordered Logical Framework
We formally prove the stackability and linearity of exception handlers with ML-style semantics using a novel proof technique via an ordered logical framework (OLF). We first transform exceptions into continuation-passing-style (CPS) terms and formalize the exception properties as a judgement on the CPS terms. Then, rather than directly proving that the properties hold for terms, we prove our theorem for the representations of the CPS terms and transform in OLF. We rely upon the correctness of our representations to transfer the results back to the actual CPS terms and transform.
Our work can be seen as two-fold: we present a theoretical justification of using the stack mechanism to implement exceptions of ML-like semantics; and we demonstrate the value of an ordered logical framework as a conceptual tool in the theoretical study of programming languages.
KeywordsCanonical Form Linear Logic Natural Deduction Logical Framework Exception Handler
Unable to display preview. Download preview PDF.
- [App97]Andrew W. Appel. Modern Compiler Implementation in ML/C/Java: Basic Techniques. Cambridge University Press, 1997.Google Scholar
- [BORT01]Josh Berdine, Peter O’Hearn, Uday S. Reddy, and Hayo Thielecke. Linearly used continuations. In Informal Proceedings of The Third ACM SIGPLAN Workshop on Continuations (CW ’01), January 2001. To appear.Google Scholar
- [CP99]Iliano Cervesato and Frank Pfenning. A linear logical framework. Information and Computation, 1999. To appear in the special issue with invited papers from LICS’96, E. Clarke, editor.Google Scholar
- [Dan00]Olivier Danvy. Formalizing implementation strategies for first-class continuations. In Programming Languages and Systems, The Proceedings of the 9th European Symposium On Programming, volume 1782 of Lecture Notes in Computer Science, pages 88–103, 2000.Google Scholar
- [DDP99.]Olivier Danvy, Belmina Dzac, and Frank Pfenning. On proving syntactic properties of cps programs. In Third International Workshop on Higher Order Operational Techniques in Semantics (HOOTS’99), Paris, France, September 1999.Google Scholar
- [DP95]Olivier Danvy and Frank Pfenning. The occurrence of continuation parameters in CPS terms. Technical Report CMU-CS-95-121, Department of Computer Science, Carnegie Mellon University, February 1995.Google Scholar
- [Fel87]Matthias Felleisen. The Calculi of λ-v-CS Conversion: A Syntactic Theory of Control and State in Imperative Higher-Order Programming Languages. PhD thesis, Department of Computer Science, Indiana University, Bloomington, Indiana, August 1987.Google Scholar
- [KYD98]Jungtaek Kim, Kwangkeun Yi, and Olivier Danvy. Assessing the overhead of ml exceptions by selective cps transformation. In The Proceedings of the ACM SIGPLAN Workshop on ML, pages 103–114, September 1998.Google Scholar
- [Pfe96]Frank Pfenning. The practice of logical frameworks. In Hélène Kirchner, editor, Proceedings of the Colloquium on Trees in Algebra and Programming, pages 119–134, Linköping, Sweden, April 1996. Springer-Verlag LNCS 1059. Invited talk.Google Scholar
- [Plo81]Gordon D. Plotkin. A structural approach to operational semantics. Technical report, Aarhus University, September 1981.Google Scholar
- [PP99a]Jeff Polakow and Frank Pfenning. Natural deduction for intuitionistic non-commutative linear logic. In J.-Y. Girard, editor, Proceedings of the Fourth International Conference on Typed Lambda Calculi and Applications (TLCA’99), pages 295–309, l’Aquila, Italy, April 1999. Springer-Verlag LNCS 1581.Google Scholar
- [PP99b]Jeff Polakow and Frank Pfenning. Relating natural deduction and sequent calculus for intuitionistic non-commutative linear logic. In Andre Scedrov and Achim Jung, editors, Proceedings of the 15th Conference on Mathematical Foundations of Programming Semantics, pages 311–328, New Orleans, Louisiana, April 1999. Electronic Notes in Theoretical Computer Science, Volume 20.Google Scholar
- [PP00]Jeff Polakow and Frank Pfenning. Properties of terms in continuation passing style in an ordered logical framework. In Workshop on Logical Frameworks and Meta-Languages (LFM 2000), Santa Barbara, California, June 2000.Google Scholar
- [Ste78]Guy L. Steele Jr. Rabbit: A compiler for Scheme. Technical Report AI-TR-474, Artificial Intelligence Laboratory, Massachusetts Institute of Technology, Cambridge, Massachusetts, May 1978.Google Scholar