skip to main content
research-article

Automatic and efficient simulation of operation contracts

Published:10 October 2010Publication History
Skip Abstract Section

Abstract

Operation contracts consisting of pre- and postconditions are a well-known means of specifying operations. In this paper we deal with the problem of operation contract simulation, i.e., determining operation results satisfying the postconditions based on input data supplied by the user; simulating operation contracts is an important technique for requirements validation and prototyping. Current approaches to operation contract simulation exhibit poor performance for large sets of input data or require additional guidance from the user. We show how these problems can be alleviated and describe an efficient as well as fully automatic approach. It is implemented in our tool OCLexec that generates from UML/OCL operation contracts corresponding Java implementations which call a constraint solver at runtime. The generated code can serve as a prototype. A case study demonstrates that our approach can handle problem instances of considerable size.

References

  1. }}K. Anastasakis, B. Bordbar, G. Georg, and I. Ray. UML2Alloy: A challenging model transformation. In G. Engels, B. Opdyke, D. C. Schmidt, and F. Weil, editors. Proc. 10th Int. Conf. Model Driven Engineering Language and Systems (MoDELS'07), volume 4735 of Lect. Notes Comp. Sci., pages 436--450. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. }}J. Blanchette and T. Nipkow. Nitpick: A counterexample generator for higher-order logic based on relational model finder. In M. Kaufmann and L. Paulson, editors, Interactive Theories Proving, volume 6172 of Lect. Notes Comp. Sci., pages 131--146. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. }}F. Bouquet, B. Legeard, and F. Peureux. CLPS-B -- a constraint solver to animate a B specification. Int. J. Softw. Tools Tech. Trans., 60 (2): 143--157, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}F. Bouquet, F. Dadeau, B. Legeard, and M. Utting. Symbolic animation of JML specifications. In Proc. 13th Int. Conf. Formal Methods 2000 (FM'05), volume 3582 of Lect. Notes Comp. Sci., pages 75--90. Springer, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. }}A. D. Brucker and B. Wolff. Semantics, calculi, and analysis for object-oriented specifications. Acta Inf., 460 (4):0 255--284, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. }}A. D. Brucker, J. Doser, and B. Wolff. An MDA framework supporting OCL. ECEASST, 5, 2006.Google ScholarGoogle Scholar
  7. }}R. E. Bryant, D. Kroening, J. Ouaknine, S. A. Seshia, O. Strichman, and B. A. Brady. An abstraction-based decision procedure for bit-vector arithmetic. STTT, 110 (2):0 95--104, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. }}L. Burdy, Y. Cheon, D. R. Cok, M. D. Ernst, J. R. Kiniry, G. T. Leavens, K. R. M. Leino, and E. Poll. An overview of JML tools and applications. STTT, 70 (3):0 212--232, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. }}J. Cabot, R. Clariso, and D. Riera. Verifying UML/OCL operation contracts. In M. Leuschel and H. Wehrheim, editors, IFM, volume 5423 of Lect. Notes Comp. Sci., pages 40--55. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}M. Cadoli and A. Schaerf. Compiling problem specifications into SAT. Artif. Intell., 1620 (1--2):0 89--120, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. }}N. Catano and T. Wahls. Executing JML specifications of Java card applications: a case study. In S. Y. Shin and S. Ossowski, editors, SAC, pages 404--408. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. }}K. Claessen and N. Sörensson. New techniques that improve MACE-style finite model finding. In Proc. Wsh. Model Computation -- Principles, Algorithms. Applications, Miami, Florida, 2003.Google ScholarGoogle Scholar
  13. }}L. M. de Moura and N. Bjorner. Z3: An efficient SMT solver. In C. R. Ramakrishnan and J. Rehof, editors, TACAS, volume 4963 of Lect. Notes Comp. Sci., pages 337--340. Springer, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. }}A. Dick, P. Krause, and J. Cozens. Computer aided transformation of Z into Prolog. In J. Nicholls, editor, Proc. 4th Z User. Workshop, Workshops in Computing, pages 71--85, Oxford, 1989. Springer.Google ScholarGoogle Scholar
  15. }}V. Doma and R. A. Nicholl. EZ: A system for automatic prototyping of Z specifications. In S. Prehn and W. J. Toetenel, editors, Proc. 4th Int. Symp. VDM Europe (VDM'91), volume 551 of Lect. Notes Comp. Sci. pages 189--203, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. }}N. Eén and N. Sörensson. An extensible SAT-solver. In E. Giunchiglia and A. Tacchella, editors, Sel. Rev. Paper. 6th Int. Conf. Theory and Applications of Satisfiability Testing (SAT'03), volume 2919 of Lect. Notes Comp. Sci., pages 502--518. Springer, 2004.Google ScholarGoogle Scholar
  17. }}D. Gale and L. S. Shapley. College admissions and the stability of marriage. The American Mathematical Monthly, 690 (1): 9--15, 1962.Google ScholarGoogle ScholarCross RefCross Ref
  18. }}M. Gogolla, F. Büttner, and M. Richters. USE: A UML-based specification environment for validating UML and OCL. Sci. Comp. Prog., 690 (1--3):0 27--34, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. }}G. Gottlob, C. Koch, and R. Pichler. Efficient algorithms for processing XPath queries. In VLDB, pages 95--106. Morgan Kaufmann, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. }}J. Gray and S. Schach. Constraint animation using an object-oriented declarative language. In A. J. Turner, editor, Proc. 38th ACM Southeast Reg. Conf., pages 1--10. ACM, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. }}W. Grieskamp. A computation model for Z based on concurrent constraint resolution. In J. P. Bowen, S. Dunne, A. Galloway, and S. King, editors. Proc. 1st Int. Conf. B and Z Users (ZB'00), volume 1878 on Lect. Notes Comp. Sci., pages 414--432. Springer, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. }}D. Jackson. Software Abstractions: Logic, Language, and Analysis. The MIT Press, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. }}S. Khurshid, D. Marinov, and D. Jackson. An analyzable annotation language. In OOPSLA, pages 231--245, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. }}P. Kosiuczenko. Specification of invariability in OCL. In O. Nierstrasz, J. Whittle, D. Harel, and G. Reggio, editors. MoDELS, volume 4199 of Lect. Notes Comp. Sci., pages 676--691. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. }}B. Krause and T. Wahls. jmle: A tool for executing JML specifications via constraint programming. In L. Brim, B. R. Haverkort, M. Leucker, and J. van de Pol, editors. Rev. Sel. Papers 5th Int. Wsh. Parallel and Distribute. Methods for Verification (PDMC'06), volume 4346 of Lect. Notes Comp. Sci., pages 293--296. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. }}M. P. Krieger and A. Knapp. Executing underspecified OCL operation contracts with a SAT solver. ECEASST, 15, 2008. Proceedings of the 8th International Workshop on OCL Concepts and Tools.Google ScholarGoogle Scholar
  27. }}M. Leuschel and M. Butler. ProB: An automated analysis toolset for the B method. Int. J. Softw. Tools Tech. Trans., 100 (2): 185--203, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. }}W. McCune. MACE 2.0 reference manual and guide. Comp. Res. Rep., 6, 2001. http://arxiv.org/abs/cs.LO/0106042.Google ScholarGoogle Scholar
  29. }}I. Niemelä. Logic programs with stable model semantics as a constraint programming paradigm. Ann. Math. Artif. Intell., 250 (3--4): 241--273, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. }}Object Management Group. Object constraint language specification, version 2.2. Specification, OMG, 2010. http://www.omg.org/spec/OCL/2.2.Google ScholarGoogle Scholar
  31. }}I. Oliver and S. Kent. Validation of object oriented models using animation. In Proc. 25th Conf. EUROMICRO, pages 2237--2242. IEEE Computer Society, 1999.Google ScholarGoogle ScholarCross RefCross Ref
  32. }}T. Servat. BRAMA: A new graphic animation tool for B models. In J. Julliand and O. Kouchnarenko, editors, Proc. 7th Int. Conf. B Users (B'07), volume 4355 of Lect. Note. Comp. Sci., pages 274--276. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. }}I. Shlyakhter, M. Sridharan, R. Seater, and D. Jackson. Exploiting subformula sharing in automatic analysis of quantified formulas. In E. Giunchiglia and A. Tacchella, editors, Sel. Rev. Paper. 6th Int. Conf. Theory and Applications of Satisfiability Testing (SAT'03), volume 2919 of Lect. Notes Comp. Sci. Springer, May 2004.Google ScholarGoogle Scholar
  34. }}N. Tamura, A. Taga, S. Kitagawa, and M. Banbara. Compiling finite linear CSP into SAT. Constraints, 140 (2):0 254--272, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. }}E. Torlak and D. Jackson. Kodkod: A relational model finder. In O. Grumberg and M. Huth, editors, Proc. 13th Int. Conf. Tools and Algorithms for the Construction and Analysis of System. (TACAS'07), volume 4424 of Lect. Notes Comp. Sci., pages 632--647. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. }}M. Utting. Data structures for Z testing tools. In G. Schellhorn and W. Reif, editors, Proc. 4th Wsh. Tools for System Design and Verification (FM-TOOLS'00). Technical Report 2000-07, Universitat Ulm, 2000.Google ScholarGoogle Scholar
  37. }}M. Veanes, P. Grigorenko, P. de Halleux, and N. Tillmann. Symbolic query exploration. In K. Breitman and A. Cavalcanti, editors, ICFEM, volume 588 of Lect. Notes Comp. Sci., pages 49--68. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Automatic and efficient simulation of operation contracts

    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 46, Issue 2
      GPCE '10
      Febuary 2011
      185 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1942788
      Issue’s Table of Contents
      • cover image ACM Conferences
        GPCE '10: Proceedings of the ninth international conference on Generative programming and component engineering
        October 2010
        198 pages
        ISBN:9781450301541
        DOI:10.1145/1868294
        • General Chair:
        • Eelco Visser,
        • Program Chair:
        • Jaakko Järvi

      Copyright © 2010 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 10 October 2010

      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!