Abstract
The Object Constraint Language (OCL) is a high-level, object-oriented language for contractual system specifications. Despite its expressivity, OCL does not provide primitives for a compact specification of invariability. In this paper, problems with invariability specification are listed and some weaknesses of existing solutions are pointed out. The question of invariability specification is addressed and a simple but expressive extension of OCL is proposed. It allows a view-oriented specification of invariability constraints, whereby we restrict the notion of view to reducts based on order-sorted algebras. The semantics of this extension is defined in terms of standard OCL.
Article PDF
Similar content being viewed by others
Avoid common mistakes on your manuscript.
References
Abrial, J.: B#: toward a synthesis between Z and B. In: Bert, D., et al. (eds.) ZB’03—Formal Specification and Development in Z and B. International Conference of B and Z Users, Turku, Finland. LNCS, vol. 2651, pp. 168–177. Springer (2003)
Abrial, J., Cansell, D., Méry, D.: Refinement and reachability in Event B. In: Treharne, H., King, S., Henson, M., Schneider, S. (eds.) Formal Specification and Development in Z and B. 4th International Conference of B and Z Users. LNCS, vol. 3455, pp. 222–241. Springer (2005)
Ackermann, J., Turowski, K.: A library of OCL specification patterns for behavioral specification of software components. In: CAiSE’06, LNCS, vol. 4001, pp. 255–269. Springer (2006)
Baar, T.: OCL and graph-transformations—a symbiotic alliance to alleviate the frame problem. In: Proc. of MoDELS’05 Satellite Workshop on Tool Support for OCL and Related Formalisms, Montego Bay, Jamaica, October 4, pp. 83–99 (2005)
Baar, T., et. al.: Tool support for OCL and related formalisms needs and trends. In: Bruel, J.M. (ed.) Satellite Events at the MoDELS’05 Conference. LNCS, vol. 3844 (2006)
Bergstra J., Tucker J.: Algebraic specifications of computable and semicomputable data types. Theor. Comput. Sci. 50, 137–181 (1987)
Bidoit, M., Hennicker, R., Tort, F., Wirsing, M.: Correct realizations of interface constraints with OCL. In: France, R., Rumpe, B. (eds.) The UML—Beyond the Standard, UML’99. LNCS, vol. 1723, pp. 399–415. Springer (1999)
Borgida, A., Reiter, R., Mylopoulos, J.: On the frame problem in procedure specifications. In: 15’th Int. Conf. on Software Engineering, Baltimore. IEEE Computer Society Press (1993)
Brucker, A.D.: An interactive proof environment for object-oriented specifications. PhD thesis, Dissertation No. 17097, ETH Zurich (2007)
Barnett M., DeLine R., Fhndrich M., Leino K.R., Schulte W.: Verification of object-oriented programs with invariants. J. Object Technol. 3(6), 27–56 (2004)
Brucker, A., Krieger, M., Wolff, B.: Extending OCL with null-references. In: Models in Software Engineering. LNCS, vol. 6002, pp. 261–275. Springer (2009)
Cabot, J.: From declarative to imperative UML/OCL operation specifications. In: Conceptual Modeling—ER 2007. LNCS, vol. 4801, pp. 198–213. Springer (2008)
Cengarle M., Knapp A.: OCL 1.4/1.5 vs. OCL 2.0 expressions: formal semantics and expressiveness. Softw. Syst. Model. 3(1), 9–30 (2004)
Chang C., Keisler J.: Model Theory. North-Holland, New York (1990)
Cheesman J., Daniels J.: UML Components. Addison-Wesley, Boston (2000)
Darvas, A., Müller, P.: Reasoning about method calls in JML specifications. In: Proceedings of the 7th Workshop on Formal Techniques for Java-like Programs (FTfJP’05), Glasgow, Scotland (2005)
DOT.: Dresdener OCL Toolkit. http://dresden-ocl.sourceforge.net/
D’Souza D., Wills A.: Object, Components, Frameworks with UML: The Catalysis Approach. Addison-Wesley, Reading (1998)
Dunne, S.: Understanding object-Z operations as generalised substitutions. In: International Conference on Integrated Formal Methods (IFM 2004). LNCS, vol. 2999. Springer (2004)
Evans A., France R., LanoK. Rumpe B.: Meta-modelling semantics of UML. In: Kilov, H. (eds) Behavioural Specifications for Businesses and Systems, Chap. 4., Kluwer, Dordrecht (1999)
Finkelstein A., Kramer J., Nuseibeh B., Finkelstein L., Goedicke M.: Viewpoints: a framework for integrating multiple perspectives in system development. Int. J. Softw. Eng. Knowl. Eng. 2, 31–58 (1991)
Fitzgerald J.S., Larsen P.G., Mukherjee P., Plat N., Verhoef M.: Validated Designs for Object-Oriented Systems. Springer, Berlin (2005)
Gogolla, M., Richters, M.: Use: A UML-Based Specification Environment. http://www.db.informatik.uni-bremen.de/projects/USE/
Goguen J., Burstall R.: Institutions: abstract model theory for specification and programming. J. Assoc. Comput. Mach. 39(1), 95–146 (1992)
Goguen, J., Meseguer, J.: Order sorted algebra. Theor. Comput. Sci. 105(2), 167–215. Elsevier, Amsterdam (1992)
Hennicker R., Knapp A., Baumeister H.: Semantics of OCL operation specifications. ENTCS 102(2), 111–132 (2004)
Hitz M., Kappel G.: UML@Work. Dpunkt Verlag, Heidelberg (1999)
Hoare T.: An axiomatic basis for computer programming. CACM 12(10), 576–580 (1969)
Kassios, I.T.: Dynamic frames: support for framing. Dependencies and sharing without restrictions. In: Misra, J., Nipkow, T., Sekerinski, E. (eds.) Formal Methods’06. LNCS, vol. 4085, pp. 268–283. Springer (2006)
Kosiuczenko, P.: Specification of invariability in OCL. In: Nierstrasz, O., et al. (eds.) MoDELS’06, LNCS, vol. 4199, pp. 676–691. Springer, Berlin (2006)
Kozankiewicz, H., Stencel, K., Subieta, K.: Optimization of queries invoking views by query tail absorption. In: ADVIS’06, LNCS, vol. 4243, pp. 129–138 (2006)
Mitchell R., McKim J.: Design by Contract by Example. Addison-Wesley, Boston (2001)
Meyer B.: Object-Oriented Software Construction. Prentice-Hall, Upper Saddle River (1998)
Meyer B.: Applying design by contract. Computer 25(10), 40–51 (1992)
Milner R., Tofte M., Harper R.: The Definition of Standard ML. MIT Press, New York (1990)
Minsky, M.: A framework for representing knowledge. Technical Report 306, Artificial Intelligence Laboratory, MIT (1974)
Müller P., Poetzsch-Heffter A., Leavens G.T.: Modular invariants for layered object structures. Sci. Comput. Program. 62(3), 253–286 (2006)
O’Hearn, P., Yang, H., Reynolds, J.C.: Separation and information hiding. In: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 268–280. ACM, Berlin (2004)
OMG.: MDA Guide, Version 1.0.1, Jun 2003
OMG.: OCL Specification, Version 2.2. Formal/2010-02-01 (2010)
OMG.: Unified Modeling Language Specification, Version 1.5. Formal/03-03-01 (2003)
OMG.: Unified Modeling Language Specification, Version 2.2. Formal/2009-02-02 (2009)
Parnas D.: On the criteria to be used in decomposing systems into modules. Commun. ACM 5(12), 1053–1058 (1972)
Richters, M.: A Precise approach to validating UML models and OCL constraints. PhD thesis, University Bremen (2002)
Rumbaugh J., Jacobson J., Booch G.: The Unified Modeling Language Reference Manual, 2nd edn. Addison-Wesley, Boston (2004)
Schoeller, B.: Eiffel0: An Object-Oriented Language with Dynamic Frame Contracts. Technical Report Nr. 542, ETH Zurich (2006)
Schubert L.: Monotonic solution of the frame problem in the situation calculus. In: Kyburg, H., Loui, R., Carlson, G. (eds) Knowledge Representation and Defeasible Reasoning, pp. 23–67. Kluwer, Dordrecht (1990)
Szyperski C.: Component Software, 2nd edn. Addison-Wesley, Harlow (2002)
Spivey J.M.: The Z Notation: A Reference Manual, 2nd edn. Prentice-Hall, Upper Saddle River (1992)
Warmer J., Kleppe A.: Object Constraint Language: Getting Your Models Ready for MDA. Addison Wesley Professional, Boston (2003)
Wirsing, M.: Algebraic specification. In: Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, vol. B. Formal Models and Semantics, pp. 675–788. Elsevier (1991)
Yu, Y., Manolios, P., Lamport, L.: Model Checking TLA+ Specifications. In: Pierre, L., Kropf, T. (eds.) Correct Hardware Design and Verification Methods (CHARME’99). LNCS, vol. 1703, pp. 54–66. Springer, Berlin (1999)
Open Access
This article is distributed under the terms of the Creative Commons Attribution Noncommercial License which permits any noncommercial use, distribution, and reproduction in any medium, provided the original author(s) and source are credited.
Author information
Authors and Affiliations
Additional information
Communicated by Prof. Martin Gogolla.
Rights and permissions
Open Access This is an open access article distributed under the terms of the Creative Commons Attribution Noncommercial License (https://creativecommons.org/licenses/by-nc/2.0), which permits any noncommercial use, distribution, and reproduction in any medium, provided the original author(s) and source are credited.
About this article
Cite this article
Kosiuczenko, P. Specification of invariability in OCL. Softw Syst Model 12, 415–434 (2013). https://doi.org/10.1007/s10270-011-0215-y
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10270-011-0215-y