10.1145/2034773.2034800acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Temporal higher-order contracts

Authors Info & Claims
Published:19 September 2011Publication History

ABSTRACT

Behavioral contracts are embraced by software engineers because they document module interfaces, detect interface violations, and help identify faulty modules (packages, classes, functions, etc). This paper extends prior higher-order contract systems to also express and enforce temporal properties, which are common in software systems with imperative state, but which are mostly left implicit or are at best informally specified. The paper presents both a programmatic contract API as well as a temporal contract language, and reports on experience and performance results from implementing these contracts in Racket.

Our development formalizes module behavior as a trace of events such as function calls and returns. Our contract system provides both non-interference (where contracts cannot influence correct executions) and also a notion of completeness (where contracts can enforce any decidable, prefix-closed predicate on event traces).

Supplemental Material

_talk4.mp4

References

  1. Samson Abramsky, Dan R. Ghica, Andrzej S. Murawski, and C.-H. Luke Ong. Applying game semantics to compositional software modeling and verification. In TACAS, pages 421--435, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  2. Samson Abramsky, Kohei Honda, and Guy McCusker. A fully abstract game semantics for general references. In LICS, pages 334--344, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Samson Abramsky, Radha Jagadeesan, and Pasquale Malacaria. Full abstraction for PCF. Information and Computation, 163:409--470, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Samson Abramsky and Guy McCusker. Call-by-value games. In CSL, pages 1--17, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Mike Barnett, K. Rustan M. Leino, and Wolfram Schulte. The Spec# programming system: An overview. In Construction and Analysis of Safe, Secure and Interoperable Smart Devices, pages 49--69, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Howard Barringer, Allen Goldberg, Klaus Havelund, and Koushik Sen. Rule-based runtime verification. In VMCAI, pages 44--57, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  7. Howard Barringer, David Rydeheard, and Klaus Havelund. Rule Systems for Run-time Monitoring: from EAGLE to RULER. J Logic Computation, November 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Eric Bodden. J-LO - A tool for runtime-checking temporal assertions. Diploma thesis, RWTH Aachen University, November 2005.Google ScholarGoogle Scholar
  9. Janusz A. Brzozowski. Derivatives of regular expressions. J. ACM, 11:481--494, October 1964. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Manuela Carrillo-Castellon, Jesús García Molina, Ernesto Pimentel, and Israel Repiso. Design by contract in smalltalk. JOOP, 9(7):23--28, 1996.Google ScholarGoogle Scholar
  11. Robert Cartwright, Pierre-Louis Curien, and Matthias Felleisen. Fully abstract semantics for observably sequential languages. Inf. Comput., 111(2):297--401, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Luca de Alfaro and Thomas A. Henzinger. Interface automata. In Foundations of Software Engineering, pages 109--120, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Luca de Alfaro and Mariëlle Stoelinga. Interfaces: A game-theoretic framework for reasoning about component-based systems. Electr. Notes Theor. Comput. Sci., 97:3--23, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  14. David L. Detlefs, K. Rustan M. Leino, Greg Nelson, and James B. Saxe. Extended static checking. Research Report 159, Compaq Systems Research Center, December 1998.Google ScholarGoogle Scholar
  15. C. Dimoulas, R. Findler, C. Flanagan, and M. Felleisen. Correct blame for contracts: No more scapegoating. In POPL, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Matthias Felleisen, Robert Bruce Findler, and Matthew Flatt. Semantics Engineering with PLT Redex. The MIT Press, 1st edition, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Matthias Felleisen and Daniel P. Friedman. A calculus for assignments in higher-order languages. In POPL, pages 314--325, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. R. Findler and M. Felleisen. Contracts for higher-order functions. In ICFP, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Robert Findler and Matthias Blume. Contracts as pairs of projections. Functional and Logic Programming, pages 226--241, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Robert Bruce Findler, Matthias Blume, and Matthias Felleisen. An investigation of contracts as projections. Technical report, University of Chicago, 2004.Google ScholarGoogle Scholar
  21. Matthew Flatt and Robert Bruce Findler. Kill-safe synchronization abstractions. In Programming Language Design and Implementation, pages 47--58, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Matthew Flatt and PLT. Reference: Racket. Technical Report PLT-TR-2010-1, PLT Inc., 2010. http://racket-lang.org/tr1/.Google ScholarGoogle Scholar
  23. Simon F. Goldsmith, Robert O'Callahan, and Alex Aiken. Relational queries over program traces. OOPSLA, pages 385--402, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Michael Greenberg, Benjamin C. Pierce, and Stephanie Weirich. Contracts made manifest. In POPL, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Klaus Havelund and Grigore Rosu. An overview of the runtime verification tool Java PathExplorer. In Formal Methods in System Design, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Ralf Hinze, Johan Jeuring, and Andres Löh. Typed contracts for functional programming. In Functional and Logic Programming (FLOPS), pages 208--225. Springer-Verlag, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J. M. E. Hyland and C.-H. Luke Ong. On full abstraction for PCF: I, II, and III. Inf. Comput., 163(2):285--408, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Murat Karaorman, Urs Hölzle, and John Bruno. jContractor: A reflective Java library to support design by contract, 1998.Google ScholarGoogle Scholar
  29. Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Lopes, Jean-Marc Loingtier, and John Irwin. Aspect-oriented programming. In ECOOP, chapter 10, pages 220--242. 1997.Google ScholarGoogle ScholarCross RefCross Ref
  30. J. Laird. A fully abstract game semantics of local exceptions. In Logic in Computer Science, Washington, DC, USA, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Blume Matthias and David McAllester. Sound and complete models of contracts. J. Funct. Program., 16:375--414, July 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. K McFarlane. Design by contract framework.Google ScholarGoogle Scholar
  33. Patrick O'Neil Meredith, Dongyun Jin, Dennis Griffith, Feng Chen, and Grigore Roşu. An overview of the MOP runtime verification framework. International Journal on Software Techniques for Technology Transfer, 2011. to appear.Google ScholarGoogle Scholar
  34. B. Meyer. Object-oriented Software Construction. Prentice-Hall, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. B. Meyer. Design by contract. In Advances in Object-Oriented Software Engineering, pages 1--50. Prentice-Hall, 1991.Google ScholarGoogle Scholar
  36. B. Meyer. Eiffel: The Language. Prentice-Hall, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Mark Samuel Miller. Robust composition: towards a unified approach to access control and concurrency control. PhD thesis, Johns Hopkins University, Baltimore, MD, USA, 2006.Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Scott Owens, John Reppy, and Aaron Turon. Regular-expression derivatives re-examined. J. Funct. Program., 19:173--190, March 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Chris Allan Pavel, Chris Allan, Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Oege De Moor, Damien Sereni, Ganesh Sittampalam, and Julian Tibble. Adding trace matching with free variables to AspectJ. In OOPSLA, pages 345--364. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Amir Pnueli. The temporal logic of programs. In Foundations of Computer Science, pages 46--57, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. John C. Reynolds. The essence of ALGOL, pages 67--88. Birkhauser Boston Inc., Cambridge, MA, USA, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. David S. Rosenblum. A practical approach to programming with assertions. IEEE Transactions on Software Engineering, 21, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Jesse Tov and Riccardo Pucella. Stateful contracts for affine types. Programming Languages and Systems, pages 550--569, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. T. Tuglular, C. A. Muftuoglu, F. Belli, and M. Linschulte. Event-based input validation using design-by-contract patterns. In Software Reliability Engineering, pages 195--204, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Dana N. Xu, Simon L. Peyton Jones, and Koen Claessen. Static contract checking for Haskell. In POPL, pages 41--52, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Temporal higher-order contracts

        Comments

        Login options

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

        Sign in

        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!