On contract satisfaction in a higher-order world

Behavioral software contracts have become a popular mechanism for specifying and ensuring logical claims about a program's flow of values. While contracts for first-order functions come with a natural interpretation and are well understood, the various incarnations of higher-order contracts adopt, implicitly or explicitly, different views concerning the meaning of contract satisfaction. In this article, we define various notions of contract satisfaction in terms of observational equivalence and compare them with each other and notions in the literature. Specifically, we introduce a small model language with higher-order contracts and use it to formalize different notions of contract satisfaction. Each of them demands that the contract parties satisfy certain observational equivalences.

[1]  G.D. Plotkin,et al.  LCF Considered as a Programming Language , 1977, Theor. Comput. Sci..

[2]  Jean-Marc Jézéquel,et al.  Making Components Contract Aware , 1999, Computer.

[3]  Greg Nelson,et al.  Extended static checking for Java , 2002, PLDI '02.

[4]  Stephen N. Freund,et al.  Sage: Unified Hybrid Checking for First-Class Types, General Refinement Types, and Dynamic (Extended Report) , 2007 .

[5]  Matthias Felleisen,et al.  Behavioral contracts and behavioral subtyping , 2001, ESEC/FSE-9.

[6]  James H. Morris,et al.  Lambda-calculus models of programming languages. , 1969 .

[7]  Cosimo Laneve,et al.  A Formal Account of Contracts for Web Services , 2006, WS-FM.

[8]  Robert Bruce Findler,et al.  Contracts as Pairs of Projections , 2006, FLOPS.

[9]  K. Rustan M. Leino,et al.  The Spec# Programming System: An Overview , 2004, CASSIS.

[10]  Amal Ahmed,et al.  Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types , 2006, ESOP.

[11]  Luca Padovani,et al.  A theory of contracts for Web services , 2007, TOPL.

[12]  Amr Sabry,et al.  Reasoning about programs in continuation-passing style , 1992, LFP '92.

[13]  Matthew Hennessy,et al.  Algebraic theory of processes , 1988, MIT Press series in the foundations of computing.

[14]  Matthias Felleisen,et al.  Contracts for higher-order functions , 2002, ICFP '02.

[15]  Mario Bravetti,et al.  Towards a Unifying Theory for Choreography Conformance and Contract Compliance , 2007, SC@ETAPS.

[16]  Ralf Hinze,et al.  Typed Contracts for Functional Programming , 2006, FLOPS.

[17]  MeyerBertrand,et al.  Design by Contract , 1997 .

[18]  Mitchell Wand,et al.  Reasoning about imperative and higher-order programs , 2008 .

[19]  Dana S. Scott,et al.  Data Types as Lattices , 1976, SIAM J. Comput..

[20]  Cormac Flanagan,et al.  Unifying Hybrid Types and Contracts , 2007, Trends in Functional Programming.

[21]  K. Rustan M. Leino,et al.  Extended static checking , 1998, PROCOMET.

[22]  Bertrand Meyer,et al.  Eiffel: The Language , 1991 .

[23]  Na Xu Static contract checking for Haskell , 2009, POPL '09.

[24]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[25]  Bertrand Meyer,et al.  Applying 'design by contract' , 1992, Computer.

[26]  Benjamin C. Pierce,et al.  Contracts made manifest , 2010, POPL '10.

[27]  Luca Padovani,et al.  Contracts for Mobile Processes , 2009, CONCUR.

[28]  Peter Thiemann,et al.  Eager and delayed contract monitoring for call-by-value and call-by-name evaluation , 2010, J. Log. Algebraic Methods Program..

[29]  Matthias Felleisen,et al.  Semantics Engineering with PLT Redex , 2009 .

[30]  Thomas A. Henzinger,et al.  Interface automata , 2001, ESEC/FSE-9.

[31]  Anne Rogers,et al.  Lazy Contract Checking for Immutable Data Structures , 2008, IFL.

[32]  Colin Runciman,et al.  Lazy Assertions , 2003, IFL.

[33]  David S. Rosenblum A Practical Approach to Programming With Assertions , 1995, IEEE Trans. Software Eng..

[34]  Matthias Felleisen,et al.  An Investigation of Contracts as Projections , 2004 .

[35]  dizayn İç dekor Design by Contract , 2010 .

[36]  David A. McAllester,et al.  Sound and complete models of contracts , 2006, Journal of Functional Programming.