ABSTRACT
Behavioral software contracts express properties concerning the flow of values across component (modules, classes, etc) interfaces. These properties are often beyond the reach of theorem provers and are therefore monitored at run-time. When the monitor discovers a contract violation, it raises an exception that simultaneously pinpoints the contract violator and explains the nature of the violation.
Currently contract monitoring assumes static module interfaces. Specifically, the contract compiler partitions a contract into disjoint obligations for the static modules that communicate to an interface. At run-time, the information is used for catching and explaining contract violations. While static modules suffice for many situations, first-class modules - such as the units provided by PLT Scheme - support the dynamic and multiple linking that is often required in open software systems. The problem is, of course, that in such a world, it becomes impossible to tell from the source program alone which components have agreed to which contracts.
In this paper, we develop the semantic framework of monitoring contracts for dynamic modules. We establish the internal consistency of the semantics, and we sketch an implementation based on our experience of equipping PLT Scheme with such contracts.
- Eric Allen, David Chase, Joe Hallett, Victor Luchangco, Jan-Willem Maessen, Sukyoung Ryu, Guy L. Steele Jr., and Sam Tobin-Hochstadt. The Fortress Language Specification. Sun Microsystems, 2008.Google Scholar
- Antoine Beugnard, Jean-Marc Jézéquel, Noël Plouzeau, and Damien Watkins. Making components contract aware. In IEEE Software, pages 38--45, June 1999. Google Scholar
- Matthias Felleisen, Robert Bruce Findler, and Matthew Flatt. Semantics Engineering with PLT Redex. MIT Press, 2009a. Google Scholar
- Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi. A functional I/O system, or fun for freshman kids. In ACM SIGPLAN International Conference on Functional Programming, page to appear, September 2009b. Google Scholar
- Robert Bruce Findler and Matthias Blume. Contracts as pairs of projections. In Eighth International Symposium on Functional and Logic Programming, volume 3945 of LNCS, pages 226--241. Springer, April 2006. Google Scholar
- Robert Bruce Findler and Matthias Felleisen. Contracts for higher-order functions. In ACM SIGPLAN International Conference on Functional Programming, pages 48--59, October 2002. Google Scholar
- Robert Bruce Findler and Matthew Flatt. Modular object-oriented programming with units and mixins. In ACM SIGPLAN International Conference on Functional Programming, pages 94--104, September 1998. Google Scholar
- Robert Bruce Findler, Cormac Flanagan, Matthew Flatt, Shriram Krishnamurthi, and Matthias Felleisen. DrScheme: A pedagogic programming environment for Scheme. In Programming Languages: Implementations, Logics, and Programs, volume 1292 of LNCS, pages 369--388. Springer, September 1997. Google Scholar
- Matthew Flatt and Matthias Felleisen. Units: Cool modules for HOT languages. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 236--248, June 1998. Google Scholar
- Matthew Flatt, Shriram Krishnamurthi, and Matthias Felleisen. Classes and mixins. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 171--183, January 1998. Google Scholar
- Matthew Flatt, Robert Bruce Findler, and Matthias Felleisen. Scheme with classes, mixins, and traits. In Asian Symposium on Programming Languages and Systems, pages 270--289, November 2006. Google Scholar
- Matthew Flatt et al. Reference: PLT Scheme. Reference Manual PLT-TR2009-reference-v4.1.4, PLT Scheme Inc., January 2009. http://plt-scheme.org/techreports/.Google Scholar
- Paul T. Graunke, Shriram Krishnamurthi, Steve van der Hoeven, and Matthias Felleisen. Programming the Web with high-level programming languages. In European Symposium on Programming, volume 2028 of LNCS, pages 122--136. Springer, April 2001. Google Scholar
- Xavier Leroy. Manifest types, modules, and separate compilation. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 109--122, January 1994. Google Scholar
- Bertrand Meyer. Applying design by contract. IEEE Computer, 25(10): 40--51, October 1992. Google Scholar
- Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, 1990. Google Scholar
Digital Library
- Martin Odersky. The Scala Language Specification. Ecole Polytechnique Fédérale de Lausanne, 2009.Google Scholar
- Scott Owens and Matthew Flatt. From structures and functors to modules and units. In ACM SIGPLAN International Conference on Functional Programming, pages 87--98, September 2006. Google Scholar
- David L. Parnas. On the criteria to be used in decomposing systems into modules. Communications of the ACM, 15:1053--1058, 1972. Google Scholar
Digital Library
- Gordon D. Plotkin. Call-by-name, call-by-value, and the λ-calculus. Theoretical Computer Science, pages 125--159, 1975.Google Scholar
- Nathanael Schärli, Stéphane Ducasse, Oscar Nierstrasz, and Andrew Black. Traits: Composable units of behavior. In European Conference on Object-Oriented Programming, volume 2743 of LNCS, pages 248--274. Springer, July 2003.Google Scholar
- Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, pages 38--94, 1994. First appeared as Technical Report TR160, Rice University, 1991.Google Scholar
Index Terms
Contracts for first-class modules
Recommendations
Contracts for first-class classes
DLS '10: Proceedings of the 6th symposium on Dynamic languagesFirst-class classes add expressive power to class-based object-oriented languages. Most importantly, programmers can abstract over common scenarios with first-class classes. When it comes to behavioral software contracts, however, first-class classes ...
Contracts for first-class modules
DLS '09Behavioral software contracts express properties concerning the flow of values across component (modules, classes, etc) interfaces. These properties are often beyond the reach of theorem provers and are therefore monitored at run-time. When the monitor ...
Modelling Legal Contracts as Processes
DEXA '00: Proceedings of the 11th International Workshop on Database and Expert Systems ApplicationsThis paper concentrates on the representation of legal relations that occur between parties once they have entered a contractual agreement and their evolution as the agreement progresses through time. Contracts are regarded as processes and they are ...







Comments