Hostname: page-component-8448b6f56d-xtgtn Total loading time: 0 Render date: 2024-04-23T20:51:46.541Z Has data issue: false hasContentIssue false

An operational semantics for Scheme1

Published online by Cambridge University Press:  01 January 2008

JACOB MATTHEWS
Affiliation:
University of Chicago (email: jacobm@cs.uchicago.edu, robby@cs.uchicago.edu)
ROBERT BRUCE FINDLER
Affiliation:
University of Chicago (email: jacobm@cs.uchicago.edu, robby@cs.uchicago.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

This paper presents an operational semantics for the core of Scheme. Our specification improves over the denotational semantics from the Revised5 Report on Scheme specification in four ways. First, it covers a larger part of the language, specifically eval, quote, dynamic-wind, and the top level. Second, it models multiple values in a way that does not require changes to unrelated parts of the language. Third, it provides a faithful model of Scheme's undefined order of evaluation. Finally, we have implemented our specification in PLT Redex, a domain-specific language for writing operational semantics. The implementation allows others to experiment with our specification and allows us to build a specification test suite, which improves our confidence that our system is a faithful model of Scheme. In addition to a specification of Scheme, this paper contributes three novel modeling techniques for Felleisen Hieb-style rewriting semantics. All three techniques are applicable to a wider range of problems than modeling Scheme, and they combine seamlessly in our model, suggesting that they would scale to complete models of other languages.

Type
Articles
Copyright
Copyright © Cambridge University Press 2007

References

Clinger, W. D. (1998, June) Proper tail recursion and space efficiency. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pp 66–67.CrossRefGoogle Scholar
Clinger, W. D. & Hansen, L. T. (1994) Lambda, the ultimate label, or a simple optimizing compiler for Scheme. ACM symposium on Lisp and Functional Programming. SIGPLAN Lisp Pointers 7(3) (July–September 1994). Available at: http://www.ccs.neu.edu/home/will/Larceny/. Accessed date: July 6, 2007.Google Scholar
Dybvig, K., Clinger, W., Flatt, M., Sperber, M. & van Straaten, A. (2006, June). The R6RS status report. Available at: http://www.schemers.org/Documents/Standards/Charter/. Accessed date: July 6, 2007.Google Scholar
Dybvig, R. K. (2005) Chez Scheme version 7 user's guide. Cadence Research Systems. Available at: http://www.scheme.com/. Accessed date: July 6, 2007.Google Scholar
Feeley, M. (2006) Gambit-C, version 4.0 beta 17. Available at: http://www.iro.umontreal.ca/gambit/. Accessed date: July 6, 2007.Google Scholar
Felleisen, M. (1987) The Calculi of lambda-v-cs Conversion: A Syntactic Theory of Control and State in Imperative Higher-Order Programming Languages. Ph.D. thesis, Indiana University.Google Scholar
Felleisen, M. (1988) Lambda-v-CS: and extended lambda-calculus for Scheme. In Proceedings of the Conference on LISP and Functional Programming.CrossRefGoogle Scholar
Felleisen, M. & Flatt, M. (2006) Programming languages and lambda calculi. Unpublished manuscript. Available at: http://www.cs.utah.edu/plt/publications/pllc.pdf. Accessed date: July 6, 2007.Google Scholar
Felleisen, M. & Hieb, R. (1992) The revised report on the syntactic theories of sequential control and state. Theor. Comput. Sci., 102, 235271. Original version in: Technical Report 89-100, Rice University, June 1989.CrossRefGoogle Scholar
Felleisen, M., Friedman, D. P., Kohlbecker, E. & Duba, B. (1987) A syntactic theory of sequential control. Theor. Comput. Sci., 52 (3)205237.CrossRefGoogle Scholar
Flanagan, C. & Felleisen, M. (1999) The semantics of future and an application. J. Funct. Program. 9, 131.CrossRefGoogle Scholar
Flatt, M. (2006). PLT MzScheme: Language manual. Technical Report PLT-TR2006-1-v352. PLT Scheme Inc. Available at: http://www.plt-scheme.org/techreports/. Accessed date: July 6, 2007.Google Scholar
Flatt, M., Krishnamurthi, S. & Felleisen, M. (1999) A programmer's reduction semantics for classes and mixins. Formal Syntax Semant. Java, 1523, 241269. Preliminary version appeared in Proceedings of Principles of Programming Languages, 1998. Revised version is Rice University technical report TR 97-293, June 1999.CrossRefGoogle Scholar
Gasbichler, M., Knauel, E., Sperber, M. & Kelsey, R. A. (2003) How to add threads to a sequential language without getting tangled up. In Workshop on Scheme and Functional Programming.Google Scholar
GNU. (2006). MIT/GNU Scheme 7.7.90+. Available at: http://www.gnu.org/software/mit-scheme/ Accessed date: July 6, 2007.Google Scholar
Harper, R. & Lillibridge, M. (1993) Explicit polymorphism and CPS conversion. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL)CrossRefGoogle Scholar
Harper, R. & Stone, C. (1996) A Type-Theoretic Account of Standard ml 1996 (version 2). Tech. rept. CMU-CS-96-136R. School of Computer Science, Carnegie Mellon University.Google Scholar
Haynes, C. T. & Friedman, D. P. (1987) Embedding continuations in procedural objects. In ACM Transactions on Programming Languages and Systems, 9 (4), 582598.CrossRefGoogle Scholar
Herman, D. & Meunier, P. (2004) Improving the static analysis of embedded languages via partial evaluation. In ACM SIGPLAN International Conference on Functional Programming (ICFP). New York: ACM Press, pp. 1627.Google Scholar
Kelsey, R., Rees, J. & Sperber, M. (2005) Scheme 48. Available at: http://s48.org/. Accessed date: July 6, 2007.Google Scholar
Kelsey, R., Clinger, W. & (Editors), Jonathan, R. (1998) Revised5 report of the algorithmic language Scheme. ACM SIGPLAN Notices, 33 (9), 2676.Google Scholar
Lee, D. K., Crary, K. & Harper, R. (2006) Mechanizing the Metatheory of Standard ML. Tech. rept. CMU-CS-06-138. Carnegie Mellon University. Available at: http://www.cs.cmu.edu/crary/papers/2006/tslf.pdf. Accessed date: July 6, 2007.Google Scholar
Mason, I. & Talcott, C. (1991) Equivalence in functional languages with effects. J. Funct. Program. 1 (July), 287327.CrossRefGoogle Scholar
Matthews, J. (2005) Operational semantics for Scheme via term rewriting. Tech. rept. TR-2005-02. University of Chicago.Google Scholar
Matthews, J. & Findler, R. B. (2005) An operational semantics for R5RS Scheme. In Workshop on Scheme and Functional Programming.Google Scholar
Matthews, J. & Findler, R. B. (2007) Operational semantics for multi-language programs. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL).CrossRefGoogle Scholar
Matthews, J., Finder, R. B., Flatt, M. & Felleisen, M. (2004) A visual environment for developing context-sensitive term rewriting systems. In Proceedings of the International Conference on Rewriting Techniques and Applications (RTA).CrossRefGoogle Scholar
Miller, S. G. & Radestock, M. (2006) SISC for seasoned schemers. Available at: http://sisc.sourceforge.net/. Accessed date: July 6, 2007.Google Scholar
Muller, R. (1992) M-LISP: A representation-independent dialect of LISP with reduction semantics. ACM Transact. Program. Lang. Syst. 14 (4).Google Scholar
Neubauer, M. & Sperber, M. (2001) Down with Emacs Lisp: Dynamic scope analysis. In ACM SIGPLAN International Conference on Functional Programming (ICFP).CrossRefGoogle Scholar
Oliva, D. P., Ramsdell, J. D. & Wand, M. (1995) The VLISP verified prescheme compiler. Lisp and Symbol. Comput. 8 (1/2).CrossRefGoogle Scholar
Project, GNU. (2005) Guile reference manual. Available at: http://www.gnu.org/software/guile/. Accessed date: July 6, 2007.Google Scholar
Ramsdell, J. D. (1992) An operational semantics for Scheme. Lisp Point. 2 (April–June).Google Scholar
Reppy, J. (1999) Concurrent Programming in ML. Cambridge University Press.CrossRefGoogle Scholar
Serrano, M. (2006) Bigloo: A Practical Scheme compiler. Available at: http://www-sop.inria.fr/mimosa/fp/Bigloo/. Accessed date: July 6, 2007.Google Scholar
Sitaram, D. (2003) Porting Scheme programs. In Scheme and Functional Programming Workshop.Google Scholar
Sussman, G. J. & Guy, L. S. Jr. (1975) Scheme: An interpreter for extended lambda calculus. Tech. rept. AI Lab Memo AIM-349. MIT AI Lab.Google Scholar
van Straaten, A. (2002) An executable denotational semantics for scheme. Available at: http://www.appsolutions.com/SchemeDS. Accessed date: July 6, 2007.Google Scholar
Winkelmann, F. L. (2006) Chicken: A practical and portable scheme system. Available at: http://www.call-with-current-continuation.org/. Accessed date: July 6, 2007.Google Scholar
Wright, A. & Felleisen, M. (1994) A syntactic approach to type soundness. Inform. Comput. 38–94. First appeared as Technical Report TR160, Rice University, 1991.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.