Skip to main content
Log in

Consistency-preserving refactoring of refinement structures in Event-B models

  • Original Article
  • Published:
Formal Aspects of Computing

Abstract

Event-B has been attracting much interest because it supports a flexible refinement mechanism that reduces the complexity of constructing and verifying models of complicated target systems by taking into account multiple abstraction layers of the models. Although most previous studies on Event-B focused on model construction, the constructed models need to be maintained. Moreover, parts of existing models are often reused to construct other models. In this paper, a method is introduced that improves the maintainability and reusability of existing Event-B models. It automatically reconstructs the refinement structure of existing models by constructing models about different sets of variables than that used in the original models, while maintaining the consistencies checked in the original models. The method automatically decomposes each refinement step into multiple steps by taking certain predicates from existing models and deriving additional predicates from the consistency conditions of existing models to create new models consistent with the original ones. By combining the decomposing of refinement steps with the composing of refinement steps, this method automatically restructures a refinement step in accordance with given sets of variables to be taken into account in refinement steps of the refactored models. The results of case studies in which large refinement steps in existing models were decomposed and existing models were restructured to extract reusable parts for constructing other models demonstrated that the proposed method facilitates effective use of the refinement mechanism of Event-B.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Abrial J-R, Butler M, Hallerstede S, Hoang TS, Mehta F, Voisin L. (2010) Rodin: an Open Toolset for Modelling and Reasoning in Event-B. International Journal on Software Tools for Technology Transfer 12(6): 447–466

    Article  Google Scholar 

  2. Abrial J-R (2005) The B-book: assigning programs to meanings. Cambridge University Press, Cambridge

    MATH  Google Scholar 

  3. Abrial J-R (2010) Modeling in Event-B: system and software engineering. Cambridge University Press, Cambridge

    Book  MATH  Google Scholar 

  4. Advance Project. Advanced design and verification environment for cyber-physical system engineering. http://www.advanceict.eu/

  5. Arcaini P, Gargantini A, Riccobene E (2016) Smt-based automatic proof of asm model refinement. In: SEFM 2016, pp 253–269

  6. Abrial J-R, Hallerstede S (2007) Refinement, decomposition, and instantiation of discrete models: application to Event-B. Fundam Inform 77(1-2): 1–28

    MathSciNet  MATH  Google Scholar 

  7. Albarghouthi A, McMillan KL (2013) Beautiful interpolants. In: CAV 2013. Springer, Berlin, pp 313–329

  8. Back RJR (1990) Refinement calculus, part II: parallel and reactive programs. In: Stepwise refinement of distributed systems models, formalisms, correctness. Springer, Berlin, pp 67–93

  9. Back RJR (1993) Refinement of parallel and reactive programs. In: Program design calculi. Springer, Berlin, pp 73–92

  10. Banach R, Butler M (2013) Cruise control in hybrid Event-B. In: ICTAC 2013. Springer, Berlin, pp 76–93

  11. Bryans JW, Fitzgerald JS, Romanovsky A, Roth A (2010) Patterns for modelling time and consistency in business information systems. In: ICECCS 2010, Mar 2010, pp 105–114

  12. Back RJR, Kurki-Suonio R (1989) Decentralization of process nets with centralized control. Distrib Comput 3(2): 73–87

    Article  Google Scholar 

  13. Börger E (2003) The ASM refinement method. Formal Asp Comput 15(2): 237–257

    Article  MATH  Google Scholar 

  14. Börger E, Stark Robert F (2003) Abstract state machines: a method for high-level system design and analysis. Springer, Berlin

    Book  MATH  Google Scholar 

  15. Butler M (2009) Decomposition structures for Event-B. In: IFM 2009, vol 5423. Springer, Heidelberg, pp 20–38

  16. Back RJR, von Wright J (1994) Trace refinement of action systems. In: CONCUR 1994. Springer, Berlin, pp 367–384

  17. Back R-J, von Wright J (2012) Refinement calculus: a systematic introduction. Springer, Berlin

    MATH  Google Scholar 

  18. Clarke E, Grumberg O, Jha S, Lu Y, Veith H (2000) Counter example-Guided Abstraction Refinement. In: CAV 2000, vol 1855. Springer, Heidelberg, pp 154–169

  19. Chlipala A (2011) Certified programming with dependent types. MIT Press, New York

    MATH  Google Scholar 

  20. Craig W (1957) Three uses of the Herbrand–Gentzen theorem in relating model theory and proof theory. J Symb Logic 22(3): 269–285

    Article  MathSciNet  MATH  Google Scholar 

  21. Correa A, Werner C, Barros M (2007) An empirical study of the impact of OCL smells and refactorings on the understandability of OCL specifications. In: MoDELS 2007, vol 4735. Springer, Heidelberg, pp 76–90

  22. Degiovanni R, Alrajeh D, Aguirre N, Uchitel S (2014) Automated goal operationalisation based on interpolation and sat solving. In: ICSE 2014. ACM, New York, pp 129–139

  23. Deploy Project. http://www.deploy-project.eu/

  24. de Moura L, Bjørner N (2008) Z3: an efficient smt solver. In: TACAS 2008. Springer, Berlin, pp 337–340

  25. Fowler M, Beck K (1999) Refactoring: improving the design of existing code. Addison-Wesley, Reading

    Google Scholar 

  26. Goodspeed B (2016) Formal methods for secure software construction. Master’s thesis, Saint Mary’s University

  27. Hoang TS, Abrial J-R (2011) Reasoning about liveness properties in Event-b. In: ICFEM 2011. Springer, pp 456–471

  28. Hoang TS, Fürst A, Abrial J-R (2013) Event-B patterns and their tool support. Softw Syst Model 12(2): 229–244

    Article  Google Scholar 

  29. Iliasov A, Troubitsyna E, Laibinis L, Romanovsky A, Varpaaniemi K, Ilic D, Latvala T (2010) Supporting reuse in Event B development: modularisation approach. In: ABZ 2010. Springer, Berlin, pp 174–188

  30. Jackson D (2002) Alloy: a lightweight object modelling notation. ACM Trans Softw Eng Methodol 11(2): 256–290

    Article  Google Scholar 

  31. Jones CB (1986) Systematic software development using VDM, vol 2. Citeseer

  32. Kobayashi T, Ishikawa F, Honiden S (2016) Refactoring refinement structure of Event-B machines. In: FM 2016. Springer, pp 444–459

  33. Lamport L (May 1994) The temporal logic of actions. ACM Trans Program Lang Syst 16(3):872-923

  34. Leuschel M, Butler M (2003) ProB: A model checker for B. In: FME 2003. Springer, Berlin, pp 855–874

  35. Li Z, Miao H (2013) Introducing agents in multi-agent system with superposition refinement. In: SNPD 2013, pp 342–347

  36. Meyer B (Oct 1992) Applying ‘design by contract’. Computer 25(10):40–51

  37. McComb T, Smith G (2008) A minimal set of refactoring rules for Object-Z. In: FMOODS 2008, vol 5051. Springer, Heidelberg, pp 170–184

  38. Requet A (2008) BART: a tool for automatic refinement. In: ABZ 2008. Springer, Berlin, pp 345–345

  39. Rodin user documentation. Refactoring framework. http://wiki.event-b.org/index.php/Refactoring_Framework

  40. Rohit G, Paulo B (2004) Refactoring alloy specifications. Electron Notes Theor Comput Sci 95: 227–243

    Article  Google Scholar 

  41. Romanovsky A, Thomas M (2013) Industrial deployment of system engineering methods. Springer, Berlin

    Book  Google Scholar 

  42. Spivey JM, Abrial J-R (1992) The Z notation. Prentice Hall, Hemel Hempstead

  43. Su W, Abrial J-R, Zhu H (2014) Formalizing hybrid systems with Event-B and the Rodin platform. Sci Comput Program 94(Part 2):164–202

  44. Silva R, Butler M (2009) Supporting reuse of Event-B developments through generic instantiation. In: ICFEM 2009. Springer, Berlin, pp 466–484

  45. Shahir HY, Farahbod R, Glässer U (2012) Refactoring abstract state machine models. In: ABZ 2012, vol 7316, pp 345–348. Springer, Heidelberg

  46. Susan S, Fiona P, Ian T. (2002) Refactoring in maintenance and development of Z specifications and proofs. ENTCS 70(3): 50–69

    MATH  Google Scholar 

  47. Sanaz Y, Michael B, Abdolbaghi R (2010) Evaluation of a Guideline by formal modelling of cruise control system in Event-B. In: NFM 2010, Apr 2010. NASA, pp 182–191

  48. Tarasyuk A, Pereverzeva I, Troubitsyna E, Latvala T (2015) The formal derivation of mode logic for autonomous satellite flight formation. In: SAFECOMP 2015, vol 9337. Springer, Heidelberg, pp 29–43

  49. Tarasyuk A., Troubitsyna E., Laibinis L. (2015) Integrating stochastic reasoning into Event-B development. Formal Asp Comput 27(1): 53–77

    Article  MathSciNet  MATH  Google Scholar 

  50. Whiteside IJ (2013) Refactoring proofs. PhD thesis, The University of Edinburgh

Download references

Acknowledgements

We thank Michael Butler and three anonymous referees for valuable critical comments on the previous versions of this paper. This work was supported by JST ACT-I Grant Number JPMJPR17UA and JSPS KAKENHI Grant Number 17H07323.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tsutomu Kobayashi.

Additional information

Michael Butler

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Kobayashi, T., Ishikawa, F. & Honiden, S. Consistency-preserving refactoring of refinement structures in Event-B models. Form Asp Comp 31, 287–320 (2019). https://doi.org/10.1007/s00165-019-00478-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00165-019-00478-z

Keywords

Navigation