skip to main content
research-article
Open Access

On contract satisfaction in a higher-order world

Published:23 November 2011Publication History
Skip Abstract Section

Abstract

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.

References

  1. Ahmed, A. 2006. Step-indexed syntactic logical relations for recursive and quantified types. In Proceedings of the 15th European Symposium on Programming (ESOP). 69--83. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Barnett, M., Leino, K. R. M., and Schulte, W. 2004. The Spec# programming system: an overview. In Construction and Analysis of Safe, Secure and Interoperable Smart Devices, 49--69. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Beugnard, A., Jézéquel, J.-M., Plouzeau, N., and Watkins, D. 1999. Making components contract aware. IEEE Computer 32, 7, 38--45. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Blume, M. and McAllester, D. 2006. Sound and complete models of contracts. J. Funct. Prog. 16, 4--5, 375--414. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Bravetti, M. and Zavattaro, G. 2007. Towards a unifying theory for choreography conformance and contract compliance. In Preproceedings of the 6th Symposium on Software Composition. 34--50. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Carpineti, S., Castagna, G., Laneve, C., and Padovani, L. 2006. A formal account of contracts for web services. In Proceedings of the 3rd International Workshop on Web Services and Formal Methods (WS-FM). 148--162. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Castagna, G., Gesbert, N., and Padovani, L. 2008. A theory of contracts for web services. In Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL). 261--272. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Castagna, G. and Padovani, L. 2009. Contracts for mobile processes. In Proceedings of the 20th International Conference in Concurrency Theory (CONCUR). 211--228. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Chitil, O., McNeill, D., and Runciman, C. 2003. Lazy assertions. In Revised Papers of the 15th International Workshop on Implementation of Functional Languages (IFL). 1--19. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. de Alfaro, L. and Henzinger, T. A. 2001. Interface automata. In Proceedings of the 8th European Software Engineering Conference held jointly with 9th ACM SIGSOFT International Symposium on Foundations of Software Egineering (ESEC/FSE). 109--120. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Degen, M., Thiemann, P., and Wehr, S. 2010. Eager and delayed contract monitoring for call-by-value and call-by-name evaluation. J. Logic Algeb. Prog. 79, 7(Oct.), 515--549.Google ScholarGoogle ScholarCross RefCross Ref
  12. Detlefs, D. L., Leino, K. R. M., Nelson, G., and Saxe, J. B. 1998. Extended static checking. Tech. rep. 158, Compaq SRC Research Report.Google ScholarGoogle Scholar
  13. Felleisen, M., Findler, R. B., and Flatt, M. 2009. Semantics Engineering with PLT Redex. MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Findler, R. B. and Blume, M. 2006. Contracts as pairs of projections. In Proceedings of the 8th International Symposium on Functional and Logic Programming (FLOPS). 226--241. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Findler, R. B. and Felleisen, M. 2002. Contracts for higher-order functions. In Proceedings of the 7th ACM SIGPLAN International Conference on Functional Programming (ICFP). 48--59. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Findler, R. B., Felleisen, M., and Blume, M. 2004. An investigation of contracts as projections. Tech. rep. TR-2004-02, Computer Science Department, University of Chicago.Google ScholarGoogle Scholar
  17. Findler, R. B., Guo, S., and Rogers, A. 2007. Lazy contract checking for immutable data structures. In Revised Papers of the 16th International Workshop on Implementation of Functional Languages (IFL). 111--128. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Findler, R. B., Latendresse, M., and Felleisen, M. 2001. Behavioral contracts and behavioral subtyping. In Proceedings of the 8th European Software Engineering Conference held jointly with 9th ACM SIGSOFT International Symposium on Foundations of Software Egineering (ESEC/FSE). 229--236. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Flanagan, C., Leino, K. R. M., Lillibridge, M., Nelson, G., Saxe, J. B., and Stata, R. 2002. Extended static checking for Java. In Proceedings of the ACM SIGPLAN 2002 Conference on Proramming Language Design and Implementation (PLDI). 234--245. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Flatt, M. and PLT. 2010. Reference: Racket. Tech. rep. PLT-TR-2010-1, PLT Inc. http://racket-lang.org/tr1/.Google ScholarGoogle Scholar
  21. Greenberg, M., Pierce, B. C., and Weirich, S. 2010. Contracts made manifest. In Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL). 353--364. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Gronski, J. and Flanagan, C. 2007. Unifying hybrid types and contracts. In Proceedings of the 8th Symposium on Trends in Functional Programming (TFP). 54--69.Google ScholarGoogle Scholar
  23. Hennessy, M. 1988. Algebraic Theory of Processes. MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Hinze, R., Jeuring, J., and Löh, A. 2006. Typed contracts for functional programming. In Proceedings of the 8th International Symposium on Functional and Logic Programming (FLOPS). 208--235. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Knowles, K., Tomb, A., Gronski, J., Freund, S. N., and Flanagan, C. 2006. SAGE: Unified hybrid checking for first-class types, general refinement types, and dynamic. http://sage.soe.ucsc.edu/sage-tr.pdf.Google ScholarGoogle Scholar
  26. Koutavas, V. 2008. Reasoning about imperative and higher-order programs. Ph.D. thesis, Northeastern University. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Meyer, B. 1988. Object-oriented Software Construction. Prentice-Hall. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Meyer, B. 1991. Design by contract. In Advances in Object-Oriented Software Engineering, Prentice-Hall, 1--50.Google ScholarGoogle Scholar
  29. Meyer, B. 1992a. Applying design by contract. IEEE Computer 25, 10, 40--51. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Meyer, B. 1992b. Eiffel: The Language. Prentice-Hall. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Morris, J. H. 1968. Lambda-calculus models of programming languages. Ph.D. thesis, Massachusetts Institute of Technology.Google ScholarGoogle Scholar
  32. Plotkin, G. D. 1975. Call-by-name, call-by-value, and the λ-calculus. Theoret. Comput. Sci. 1, 2, 125--159.Google ScholarGoogle ScholarCross RefCross Ref
  33. Plotkin, G. D. 1977. LCF considered as a programming language. Theoret. Comput. Sci. 5, 3, 223--255.Google ScholarGoogle ScholarCross RefCross Ref
  34. Rosenblum, D. S. 1995. A practical approach to programming with assertion. IEEE Trans. Softw. Eng. 21, 1, 15--31. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Sabry, A. and Felleisen, M. 1993. Reasoning about programs in continuation passing-style. Lisp Symb. Comput. 6, 3/4, 289--360. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Scott, D. S. 1976. Data types as lattices. SIAM J. Comput. 5, 3, 522--587.Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Xu, D., Peyton Jones, S., and Claessen, K. 2009. Static contract checking for Haskell. In Proceedings of the 36th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL). 41--52. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. On contract satisfaction in a higher-order world

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM Transactions on Programming Languages and Systems
        ACM Transactions on Programming Languages and Systems  Volume 33, Issue 5
        November 2011
        115 pages
        ISSN:0164-0925
        EISSN:1558-4593
        DOI:10.1145/2039346
        Issue’s Table of Contents

        Copyright © 2011 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 23 November 2011
        • Accepted: 1 June 2011
        • Revised: 1 January 2011
        • Received: 1 May 2010
        Published in toplas Volume 33, Issue 5

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader