Skip to main content
×
Home

An operational semantics for Scheme1

  • JACOB MATTHEWS (a1) and ROBERT BRUCE FINDLER (a1)
Abstract
Abstract

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.

Copyright
References
Hide All
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.
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.
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.
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.
Feeley M. (2006) Gambit-C, version 4.0 beta 17. Available at: http://www.iro.umontreal.ca/gambit/. Accessed date: July 6, 2007.
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.
Felleisen M. (1988) Lambda-v-CS: and extended lambda-calculus for Scheme. In Proceedings of the Conference on LISP and Functional Programming.
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.
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.
Felleisen M., Friedman D. P., Kohlbecker E. & Duba B. (1987) A syntactic theory of sequential control. Theor. Comput. Sci., 52 (3)205237.
Flanagan C. & Felleisen M. (1999) The semantics of future and an application. J. Funct. Program. 9, 131.
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.
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.
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.
GNU. (2006). MIT/GNU Scheme 7.7.90+. Available at: http://www.gnu.org/software/mit-scheme/ Accessed date: July 6, 2007.
Harper R. & Lillibridge M. (1993) Explicit polymorphism and CPS conversion. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL)
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.
Haynes C. T. & Friedman D. P. (1987) Embedding continuations in procedural objects. In ACM Transactions on Programming Languages and Systems, 9 (4), 582598.
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.
Kelsey R., Rees J. & Sperber M. (2005) Scheme 48. Available at: http://s48.org/. Accessed date: July 6, 2007.
Kelsey R., Clinger W. & (Editors), Jonathan R. (1998) Revised5 report of the algorithmic language Scheme. ACM SIGPLAN Notices, 33 (9), 2676.
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.
Mason I. & Talcott C. (1991) Equivalence in functional languages with effects. J. Funct. Program. 1 (July), 287327.
Matthews J. (2005) Operational semantics for Scheme via term rewriting. Tech. rept. TR-2005-02. University of Chicago.
Matthews J. & Findler R. B. (2005) An operational semantics for R5RS Scheme. In Workshop on Scheme and Functional Programming.
Matthews J. & Findler R. B. (2007) Operational semantics for multi-language programs. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL).
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).
Miller S. G. & Radestock M. (2006) SISC for seasoned schemers. Available at: http://sisc.sourceforge.net/. Accessed date: July 6, 2007.
Muller R. (1992) M-LISP: A representation-independent dialect of LISP with reduction semantics. ACM Transact. Program. Lang. Syst. 14 (4).
Neubauer M. & Sperber M. (2001) Down with Emacs Lisp: Dynamic scope analysis. In ACM SIGPLAN International Conference on Functional Programming (ICFP).
Oliva D. P., Ramsdell J. D. & Wand M. (1995) The VLISP verified prescheme compiler. Lisp and Symbol. Comput. 8 (1/2).
Project GNU. (2005) Guile reference manual. Available at: http://www.gnu.org/software/guile/. Accessed date: July 6, 2007.
Ramsdell J. D. (1992) An operational semantics for Scheme. Lisp Point. 2 (April–June).
Reppy J. (1999) Concurrent Programming in ML. Cambridge University Press.
Serrano M. (2006) Bigloo: A Practical Scheme compiler. Available at: http://www-sop.inria.fr/mimosa/fp/Bigloo/. Accessed date: July 6, 2007.
Sitaram D. (2003) Porting Scheme programs. In Scheme and Functional Programming Workshop.
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.
van Straaten A. (2002) An executable denotational semantics for scheme. Available at: http://www.appsolutions.com/SchemeDS. Accessed date: July 6, 2007.
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.
Wright A. & Felleisen M. (1994) A syntactic approach to type soundness. Inform. Comput. 38–94. First appeared as Technical Report TR160, Rice University, 1991.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 4 *
Loading metrics...

Abstract views

Total abstract views: 122 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 22nd November 2017. This data will be updated every 24 hours.