|
ABSTRACT
Assertions play an important role in the construction of robust software. Their use in programming languages dates back to the 1970s. Eiffel, an object-oriented programming language, wholeheartedly adopted assertions and developed the "Design by Contract" philosophy. Indeed, the entire object-oriented community recognizes the value of assertion-based contracts on methods.In contrast, languages with higher-order functions do not support assertion-based contracts. Because predicates on functions are, in general, undecidable, specifying such predicates appears to be meaningless. Instead, the functional languages community developed type systems that statically approximate interesting predicates.In this paper, we show how to support higher-order function contracts in a theoretically well-founded and practically viable manner. Specifically, we introduce λcon, a typed lambda calculus with assertions for higher-order functions. The calculus models the assertion monitoring system that we employ in DrScheme. We establish basic properties of the model (type soundness, etc.) and illustrate the usefulness of contract checking with examples from DrScheme's code base.We believe that the development of an assertion system for higher-order functions serves two purposes. On one hand, the system has strong practical potential because existing type systems simply cannot express many assertions that programmers would like to state. On the other hand, an inspection of a large base of invariants may provide inspiration for the direction of practical future type system research.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
AT&T Bell Labratories. Standard ML of New Jersey, 1993.
|
 |
2
|
|
| |
3
|
Felleisen, M., R. B. Findler, M. Flatt and S. Krishnamurthi. How to Design Programs. MIT Press, 2001.
|
| |
4
|
|
| |
5
|
Robert Bruce Findler , Cormac Flanagan , Matthew Flatt , Shriram Krishnamurthi , Matthias Felleisen, DrScheme: A Pedagogic Programming Environment for Scheme, Proceedings of the9th International Symposium on Programming Languages: Implementations, Logics, and Programs: Including a Special Trach on Declarative Programming Languages in Education, p.369-388, September 03-05, 1997
|
| |
6
|
Findler, R. B. and M. Felleisen. Contracts for higher-order functions. Technical Report NU-CCS-02-05, Northeastern University, 2002.
|
 |
7
|
|
| |
8
|
Flatt, M. PLT MzScheme: Language manual. Technical Report TR97-280, Rice University, 1997. http://www.plt-scheme.org/software/mzscheme/.
|
 |
9
|
|
| |
10
|
|
| |
11
|
Gomes, B., D. Stoutamire, B. Vaysman and H. Klawitter. A Language Manual for Sather 1.1, August 1996.
|
| |
12
|
|
 |
13
|
|
 |
14
|
|
| |
15
|
Jones, M. P., A. Reid and The Yale Haskell Group. The Hugs 98 User Manual, 1999.
|
 |
16
|
N. I. Adams, IV , D. H. Bartley , G. Brooks , R. K. Dybvig , D. P. Friedman , R. Halstead , C. Hanson , C. T. Haynes , E. Kohlbecker , D. Oxley , K. M. Pitman , G. J. Rozas , G. L. Steele, Jr. , G. J. Sussman , M. Wand , H. Abelson, Revised5 report on the algorithmic language scheme, ACM SIGPLAN Notices, v.33 n.9, p.26-76, Sept. 1, 1998
[doi> 10.1145/290229.290234]
|
| |
17
|
Kölling, M. and J. Rosenberg. Blue: Language Specification, version 0.94, 1997.
|
 |
18
|
Xavier Leroy, Manifest types, modules, and separate compilation, Proceedings of the 21st ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.109-122, January 16-19, 1994, Portland, Oregon, United States
[doi> 10.1145/174675.176926]
|
| |
19
|
Leroy, X. The Objective Caml system, Documentation and User's guide, 1997.
|
| |
20
|
|
| |
21
|
Luckham, D. C. and F. von Henke. An overview of Anna, a specification language for Ada. In IEEE Software, volume 2, pages 9--23, March 1985.
|
| |
22
|
|
| |
23
|
|
 |
24
|
|
 |
25
|
|
 |
26
|
|
| |
27
|
|
| |
28
|
Serrano, M. Bigloo: A practical Scheme compiler, 1992--2002.
|
| |
29
|
|
 |
30
|
|
| |
31
|
|
| |
32
|
Szyperski, C. Component Software. Addison-Wesley, 1998.
|
| |
33
|
The GHC Team. The Glasgow Haskell Compiler User's Guide, 1999.
|
| |
34
|
|
CITED BY 26
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sam Tobin-Hochstadt , Matthias Felleisen, Interlanguage migration: from scripts to programs, Companion to the 21st ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, October 22-26, 2006, Portland, Oregon, USA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Arjun Guha , Jacob Matthews , Robert Bruce Findler , Shriram Krishnamurthi, Relationally-parametric polymorphic contracts, Proceedings of the 2007 symposium on Dynamic languages, October 22-22, 2007, Montreal, Quebec, Canada
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Amal Ahmed , Robert Bruce Findler , Jacob Matthews , Philip Wadler, Blame for all, Proceedings for the 1st workshop on Script to Program Evolution, p.1-13, July 06-06, 2009, Genova, Italy
|
|
|
|
|
|
|
|
|
|
|
|
|
|