On Automating Inference of OCL Constraints from Counterexamples and Examples

Part of the Advances in Intelligent Systems and Computing book series (AISC, volume 326)


Within model-based approaches, defining domains and domain restrictions for conceptual models or metamodels is significant. Recently, a domain is often presented as a class diagram, and domain restrictions are expressed using the Object Constraint Language (OCL). An effective method to define a domain is based on a description of the domain at the instance and example level. So far such a method has often focused on the generation of structure aspects, but have omitted the inference of OCL restrictions that could complement the domain structure and improve the precision of the domain. This paper proposes an approach to automating the inference of OCL restrictions from a domain description in terms of counter- and examples. Candidates are generated by a problem solving, and irrelevant ones are eliminated using the user feedback on generated counter- and examples. Our approach is realized with the support tool InferOCL.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Sutcliffe, A.G., Maiden, N.A.M., Minocha, S., Manuel, D.: Supporting Scenario-Based Requirements Engineering. IEEE Trans. Software Eng. 24(12), 1072–1088 (1998)Google Scholar
  2. 2.
    Warmer, J., Kleppe, A.: The Object Constraint Language: Getting Your Models Ready for MDA, 2nd edn. Addison-Wesley Professional (2003)Google Scholar
  3. 3.
    Gogolla, M., Büttner, F., Richters, M.: USE: A UML-Based Specification Environment for Validating UML and OCL. Science of Computer Programming 69(1-3), 27–34 (2007)Google Scholar
  4. 4.
    Cabot, J., Claris, R., Riera, D.: UMLtoCSP: A Tool for the Formal Verification of UML/OCL Models Using Constraint Programming. In: Kurt Stirewalt, R.E., Alexander Egyed, B.F. (eds.) Proc. 22th Int. Conf. Automated Software Engineering (ASE), pp. 547–548. ACM, New York (2007)Google Scholar
  5. 5.
    Anastasakis, K., Bordbar, B., Georg, G., Ray, I.: UML2Alloy: A Challenging Model Transformation. In: Engels, G., Opdyke, B., Schmidt, D.C., Weil, F. (eds.) MODELS 2007. LNCS, vol. 4735, pp. 436–450. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  6. 6.
    Kuhlmann, M., Gogolla, M.: From UML and OCL to Relational Logic and Back. In: France, R.B., Kazmeier, J., Breu, R., Atkinson, C. (eds.) MODELS 2012. LNCS, vol. 7590, pp. 415–431. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  7. 7.
    Faunes, M., Cadavid, J.J., Baudry, B., Sahraoui, H.A., Combemale, B.: Automatically searching for metamodel well-formedness rules in examples and counter-examples. In: Moreira, A., Schätz, B., Gray, J., Vallecillo, A., Clarke, P. (eds.) MODELS 2013. LNCS, vol. 8107, pp. 187–202. Springer, Heidelberg (2013)Google Scholar
  8. 8.
    Dang, D.H., Cabot, J.: Automating Inference of OCL Business Rules from User Scenarios. In: Proc. 20th Asia-Pacific Conf. Software Engineering (APSEC), pp. 156–163. IEEE (2013)Google Scholar
  9. 9.
    ECLiPSe: The ECLiPSe Constraint Programming System. Version 6.1 (June 2013)Google Scholar
  10. 10.
    Ferraiolo, D., Kuhn, D.: Role-Based Access Control. In: Proc. 15th National Computer Security Conf., pp. 554–563 (1992)Google Scholar
  11. 11.
    Kuhlmann, M., Sohr, K., Gogolla, M.: Comprehensive Two-Level Analysis of Static and Dynamic RBAC Constraints with UML and OCL. In: Baik, J., Massacci, F., Zulkernine, M. (eds.) Proc. 5th Int. Conf. Secure Software Integration and Reliability Improvement (SSIRI), pp. 108–117. IEEE (2011)Google Scholar
  12. 12.
    Javed, F., Mernik, M., Gray, J., Bryant, B.R.: MARS: A Metamodel Recovery System Using Grammar Inference. Information & Software Technology 50(9-10), 948–968 (2008)CrossRefGoogle Scholar
  13. 13.
    Gogolla, M., Bohling, J., Richters, M.: Validating UML and OCL Models in USE by Automatic Snapshot Generation. Software and System Modeling 4(4), 386–398 (2005)CrossRefGoogle Scholar
  14. 14.
    Pau, R., Cabot, J.: Paraphrasing OCL Expressions with SBVR. In: Kapetanios, E., Sugumaran, V., Spiliopoulou, M. (eds.) NLDB 2008. LNCS, vol. 5039, pp. 311–316. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  15. 15.
    Cabot, J., Teniente, E.: Transformation Techniques for OCL Constraints. Science of Computer Programming 68(3), 152–168 (2007)MathSciNetCrossRefGoogle Scholar
  16. 16.
    Angluin, D.: Learning Regular Sets from Queries and Counterexamples. Information and Computation 75(2), 87–106 (1987)MathSciNetCrossRefMATHGoogle Scholar
  17. 17.
    Bessière, C., Coletta, R., Koriche, F., O’Sullivan, B.: A SAT-Based Version Space Algorithm for Acquiring Constraint Satisfaction Problems. In: Gama, J., Camacho, R., Brazdil, P.B., Jorge, A.M., Torgo, L. (eds.) ECML 2005. LNCS (LNAI), vol. 3720, pp. 23–34. Springer, Heidelberg (2005)Google Scholar
  18. 18.
    Bajwa, I., Bordbar, B., Lee, M.: OCL Constraints Generation from Natural Language Specification. In: Proc. 14th Int. Conf. Enterprise Distributed Object Computing Conference (EDOC), pp. 204–213. IEEE (2010)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  1. 1.VNU - University of Engineering and TechnologyHanoiVietnam
  2. 2.AtlanMod, cole des Mines de Nantes - INRIA, LINANantesFrance

Personalised recommendations