ACM Home Page
Please provide us with feedback. Feedback
A sound (and complete) model of contracts
Full text PdfPdf (183 KB)
Source International Conference on Functional Programming archive
Proceedings of the ninth ACM SIGPLAN international conference on Functional programming table of contents
Snow Bird, UT, USA
SESSION: Session VI table of contents
Pages: 189 - 200  
Year of Publication: 2004
ISBN:1-58113-905-5
Also published in ...
Authors
Matthias Blume  Toyota Technological Institute at Chicago
David McAllester  Toyota Technological Institute at Chicago
Sponsors
ACM: Association for Computing Machinery
SIGPLAN: ACM Special Interest Group on Programming Languages
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 5,   Downloads (12 Months): 25,   Citation Count: 1
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/1016850.1016876
What is a DOI?

ABSTRACT

Even in statically typed languages it is useful to have certain invariants checked dynamically. Findler and Felleisen gave an algorithm for dynamically checking expressive higher-order types called contracts. If we postulate soundness (in the sense that whenever a term is accused of violating its contract it really does fail to satisfy it), then their algorithm implies a semantics for contracts. Unfortunately, the implicit nature of the resulting model makes it rather unwieldy.In this paper we demonstrate that a direct approach yields essentially the same semantics without having to refer to contract-checking in its definition. The so-defined model largely coincides with intuition, but it does expose some peculiarities in its interpretation of predicate contracts where a notion of safety (which we define in the paper) "leaks" into the semantics of Findler and Felleisen's original unrestricted predicate contracts.This counter-intuitive aspect of the semantics can be avoided by changing the language, replacing unrestricted predicate contracts with a restricted version. The corresponding loss in expressive power can be recovered by also providing a way of explicitly expressing safety as a contract-either in ad-hoc fashion or, e.g., by including general recursive contracts.


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
 
2
 
3
 
4
5
 
6
 
7
R. B. Findler, M. Blume, and M. Felleisen. An investigation of contracts as projections. Technical Report TR-2004-02, University of Chicago Computer Science Department, 2004.
 
8
9
10
 
11
S. P. Jones. Haskell 98 Language and Libraries. Cambridge University Press, 2003.
 
12
X. Leroy. The ZINC experiment: an economical implementation of the ML language. Technical Report No. 117, INRIA, Feb. 1990.
 
13
 
14
H. G. Rice. Classes of recursively enumerable sets and their decision problems. Trans. Amer. Math. Soc., 74:358--366, 1953.
 
15
D. S. Scott. Continuous lattices. In F. W. Lawvere, editor, Toposes, Algebraic Geometry and Logic, volume 274 of Lecture Notes in Mathematics, pages 97--136. Springer, 1972.


Collaborative Colleagues:
Matthias Blume: colleagues
David McAllester: colleagues