ACM Home Page
Please provide us with feedback. Feedback
Contracts for higher-order functions
Full text PdfPdf (137 KB)
Source International Conference on Functional Programming archive
Proceedings of the seventh ACM SIGPLAN international conference on Functional programming table of contents
Pittsburgh, PA, USA
Pages: 48 - 59  
Year of Publication: 2002
ISBN:1-58113-487-8
Also published in ...
Authors
Robert Bruce Findler  Northeastern University, Boston, MA
Matthias Felleisen  Northeastern University, Boston, MA
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 10,   Downloads (12 Months): 69,   Citation Count: 26
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/581478.581484
What is a DOI?

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
 
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
 
17
Kölling, M. and J. Rosenberg. Blue: Language Specification, version 0.94, 1997.
18
 
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

Collaborative Colleagues:
Robert Bruce Findler: colleagues
Matthias Felleisen: colleagues