skip to main content
research-article

Expressing contract monitors as patterns of communication

Published:29 August 2015Publication History
Skip Abstract Section

Abstract

We present a new approach to contract semantics which expresses myriad monitoring strategies using a small core of foundational communication primitives. This approach allows multiple existing contract monitoring approaches, ranging from Findler and Felleisen’s original model of higher-order contracts to semi-eager, parallel, or asynchronous monitors, to be expressed in a single language built on well-understood constructs. We prove that this approach accurately simulates the original semantics of higher-order contracts. A straightforward implementation in Racket demonstrates the practicality of our approach which not only enriches existing Racket monitoring strategies, but also support a new style of monitoring in which collections of contracts collaborate to establish a global invariant.

References

  1. A. Ahmed, R. B. Findler, J. G. Siek, and P. Wadler. Blame for all. In POPL, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. Armstrong, S. Virding, and M. Williams. Erlang Users Guide and Reference Manual. Version 3.2. Ellemtel Utveklings AB, 1991.Google ScholarGoogle Scholar
  3. H. C. Baker, Jr. and C. Hewitt. The incremental garbage collection of processes. In SAIPL, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. Blume and D. McAllester. Sound and complete models of contracts. J. Funct. Program., 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. O. Chitil. Practical typed lazy contracts. In ICFP, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. O. Chitil, D. McNeill, and C. Runciman. Lazy assertions. In IFL, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. Degen, P. Thiemann, and S. Wehr. True lies: Lazy contracts for lazy languages (faithfulness is better than laziness). In ATPS, 2009.Google ScholarGoogle Scholar
  8. M. Degen, P. Thiemann, and S. Wehr. Eager and delayed contract monitoring for call-by-value and call-by-name evaluation. J. Log. Algebr. Program., 79(7), 2010.Google ScholarGoogle ScholarCross RefCross Ref
  9. C. Dimoulas and M. Felleisen. On contract satisfaction in a higherorder world. TOPLAS, 33(5), Nov. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. C. Dimoulas, R. Pucella, and M. Felleisen. Future contracts. In PPDP, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. C. Dimoulas, S. Tobin-Hochstadt, and M. Felleisen. Complete monitoring for behavioral contracts. In ESOP, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Dimoulas, R. B. Findler, and M. Felleisen. Option contracts. In OOPSLA, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. T. Disney, C. Flanagan, and J. McCarthy. Temporal higher-order contracts. In ICFP, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. F. Ergün, S. Kannan, S. R. Kumar, R. Rubinfeld, and M. Viswanathan. Spot-checkers. In STOC, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. B. Findler and M. Blume. Contracts as pairs of projections. In FLOPS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. R. B. Findler and M. Felleisen. Contracts for higher-order functions. In ICFP, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. R. B. Findler, M. Blume, and M. Felleisen. An investigation of contracts as projections. University of Chicago Technical Report TR02-402, 2002.Google ScholarGoogle Scholar
  18. R. B. Findler, S.-Y. Guo, and A. Rogers. Lazy contract checking for immutable data structures. In IFL, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. M. Flatt and PLT. Reference: Racket. Technical Report PLT-TR-2010- 1, PLT Inc., 2010. http://racket-lang.org/tr1/.Google ScholarGoogle Scholar
  20. M. Greenberg, B. C. Pierce, and S. Weirich. Contracts made manifest. Journal of Functional Programming, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. R. H. Halstead, Jr. Implementation of multilisp: Lisp on a multiprocessor. LFP, 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. R. Hinze, J. Jeuring, and A. Löh. Typed contracts for functional programming. In FLOPS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. K. Honda, V. T. Vasconcelos, and M. Kubo. Language primitives and type discipline for structured communication-based programming. In ESOP, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. A. Jeffrey. Semantics for core concurrent ml using computation types. In HOOTS. Cambridge University Press, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. B. Meyer. Eiffel: the language. Prentice-Hall, Inc., 1992. ISBN 0-13- 247925-7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. R. Milner. Functions as processes. Mathematical Structures in Computer Science, 2, 6 1992.Google ScholarGoogle ScholarCross RefCross Ref
  27. C. Morgan. Programming from specifications. 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. D. L. Parnas. A technique for software module specification with examples. Commun. ACM, 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. J. H. Reppy. Concurrent ML: Design, application and semantics, 1993.Google ScholarGoogle Scholar
  30. J. H. Reppy. Concurrent Programming in ML. Cambridge University Press, 1999. ISBN 0521480892. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. D. Sangiorgi and D. Walker. The Pi-Calculus: A Theory of Mobile Processes. Cambridge University Press, 2003.Google ScholarGoogle Scholar
  32. T. S. Strickland and M. Felleisen. Contracts for first-class classes. In DLS, Oct. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. T. S. Strickland, S. Tobin-Hochstadt, R. B. Findler, and M. Flatt. Chaperones and impersonators: run-time support for reasonable interposition. In OOPSLA, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. K. Takeuchi, K. Honda, and M. Kubo. An interaction-based language and its typing system. In PARLE, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Expressing contract monitors as patterns of communication

        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 SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 50, Issue 9
          ICFP '15
          September 2015
          436 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/2858949
          • Editor:
          • Andy Gill
          Issue’s Table of Contents
          • cover image ACM Conferences
            ICFP 2015: Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming
            August 2015
            436 pages
            ISBN:9781450336697
            DOI:10.1145/2784731

          Copyright © 2015 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 29 August 2015

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!