Abstract
This paper describes a verified compiler for PreScheme, the implementation language for thevlisp run-time system. The compiler and proof were divided into three parts: A transformational front end that translates source text into a core language, a syntax-directed compiler that translates the core language into a combinator-based tree-manipulation language, and a linearizer that translates combinator code into code for an abstract stored-program machine with linear memory for both data and code. This factorization enabled different proof techniques to be used for the different phases of the compiler, and also allowed the generation of good code. Finally, the whole process was made possible by carefully defining the semantics ofvlisp PreScheme rather than just adopting Scheme's. We believe that the architecture of the compiler and its correctness proof can easily be applied to compilers for languages other than PreScheme.
Similar content being viewed by others
References
Andrew W. Appel.Compiling with Continuations. Cambridge University Press, Cambridge and New York, 1992.
Henk P. Barendregt.The Lambda Calculus: Its Syntax and Semantics. North-Holland, Amsterdam, 1981.
Robert S. Boyer and J Strother Moore.A Computational Logic. Academic Press, 1979.
Robert S. Boyer and Yuan Yu. Automated correctness proofs of machine code programs for a commercial microprocessor. In D. Kapur, editor,Automated Deduction — CADE-11, pages 416–430. 11th International Conference on Automated Deduction, Springer Verlag, 1992.
William Clinger. The Scheme 311 compiler: An exercise in denotational semantics. In1984 ACM Symposium on Lisp and Functional Programming, pages 356–364, New York, August 1984. The Association for Computing Machinery, Inc.
Bruno Courcelle. Fundamental properties of infinite trees.Theoretical Computer Science, 25:95–169, 1983.
Joshua D. Guttman, John D. Ramsdell, and Vipin Swarup. The VLISP verified Scheme system.Lisp and Symbolic Computation, 8(1/2):33–110, 1995.
Joshua D. Guttman, John D. Ramsdell, and Mitchell Wand. VLISP: A verified implementation of Scheme.Lisp and Symbolic Computation, 8(1/2):5–32, 1995.
John Hannan. Making abstract machines less abstract. In J. Hughes, editor,Functional Programming Languages and Computer Architecture, 5th ACM Conference, volume 523 ofLecture Notes in Computer Science, pages 618–635. Springer-Verlag, Berlin, Heidelberg, and New York, 1991.
IEEE Std 1178–1990.IEEE Standard for the Scheme Programming Language. Institute of Electrical and Electronic Engineers, Inc., New York, NY, 1991.
Richard A. Kelsey. Realistic compilation by program transformation. InConf. Rec. 16th Ann. ACM Symp. on Principles of Programming Languages. ACM, 1989.
Richard A. Kelsey and Jonathan A. Rees. A tractable Scheme implementation.Lisp and Symbolic Computation, 7(4):315–335, 1994.
David Kranz, Richard A. Kelsey, Jonathan A. Rees, Paul Hudak, Jim Philbin, and Norman I. Adams. Orbit: An optimizing compiler for Scheme.SIGPLAN Notices, 21(7):219–233, June 1986. Proceedings of the '86 Symposium on Compiler Construction.
Robert Milne and Christopher Strachey.A Theory of Programming Language Semantics. Chapman and Hall, 1976.
Robin Milner. A theory of type polymorphism in programming.Journal of Computer and System Sciences, 17:348–375, 1978.
Robin Milner, Mads Tofte, and Robert Harper.The Definition of Standard ML. The MIT Press, Cambridge, MA, 1990.
J Strother Moore. Piton: A verified assembly-level language. Technical Report 22, Computational Logic, Inc., Austin, Texas, 1988.
Dino P. Oliva.Advice on Structuring Compiler Back Ends and Proving Them Correct. PhD thesis, Northeastern University, 1993.
Dino P. Oliva and Mitchell Wand. A verified compiler for pure prescheme. Technical Report NU-CCS-92-5, Northeastern University College of Computer Science, February 1992.
Dino P. Oliva and Mitchell Wand. A verified run-time structure for pure prescheme. Technical Report NU-CCS-92-27, Northeastern University College of Computer Science, September 1992.
Laurence C. Paulson.ML for the Working Programmer. Cambridge University Press, Cambridge, Great Britain, 1991.
Gordon D. Plotkin. A structural approach to operational semantics. Technical Report DAIMI FN-19, Aarhus University, 1981.
John D. Ramsdell. The revised VLISP PreScheme front end. M 93B095, The MITRE Corporation, August 1993.
John D. Ramsdell, William M. Farmer, Joshua D. Guttman, Leonard G. Monk, and Vipin Swarup. The VLISP PreScheme front end. M 92B098, The MITRE Corporation, September 1992.
Guy L. Steele. Rabbit: A compiler for Scheme. Technical Report 474, MIT AI Laboratory, 1978.
Joseph E. Stoy.Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. MIT Press, Cambridge, MA, 1977.
Mitchell Wand. Deriving target code as a representation of continuation semantics.ACM Transactions on Programming Languages and Systems, 4(3):496–517, July 1982.
Mitchell Wand. Semantics-directed machine architecture. InConf. Rec. 9th ACM Symposium on Principles of Programming Languages, pages 234–241, 1982.
Mitchell Wand. Loops in combinator-based compilers.Information and Control, 57(2–3):148–164, May/June 1983.
Mitchell Wand. Correctness of procedure representations in higher-order assembly language. In S. Brookes, editor,Proceedings Mathematical Foundations of Programming Semantics '91, volume 598 ofLecture Notes in Computer Science, pages 294–311. Springer-Verlag, Berlin, Heidelberg, and New York, 1992.
Mitchell Wand and Dino P. Oliva. Proving the correctness of storage representations. InProceedings of the 1992 ACM Conference on Lisp and Functional Programming, pages 151–160, New York, 1992. ACM Press.
Mitchell Wand and Zheng-Yu Wang. Conditional lambda-theories and the verification of static properties of programs.Information and Computation, 113:253–277, 1994. Preliminary version appeared inProc. 5th IEEE Symposium on Logic in Computer Science, 1990, pp. 321–332.
Author information
Authors and Affiliations
Additional information
This work was supported by Rome Laboratory of the United States Air Force, contract No. F19628-89-C-0001, through the MITRE Corporation, and by NSF and DARPA under NSF grants CCR-9002253 and CCR-9014603. Author's current address: Department of Computer Science and Engineering, Oregon Graduate Institute, P.O. Box 91000, Portland, OR 97291-1000.
The work reported here was supported by Rome Laboratory of the United States Air Force, contract No. F19628-89-C-0001. Preparation of this paper was generously supported by The MITRE Corporation.
This work was supported by Rome Laboratory of the United States Air Force, contract No. F19628-89-C-0001, through the MITRE Corporation, and by NSF and DARPA under NSF grants CCR-9002253 and CCR-9014603.