Translating Z to Alloy

  • Petra Malik
  • Lindsay Groves
  • Clare Lenihan
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5977)


Few tools are available to help with the difficult task of validating that a Z specification captures its intended meaning. One tool that has been proven to be useful for validating specifications is the Alloy Analyzer, an interactive tool for checking and visualising Alloy models. However, Z specifications need to be translated to Alloy notation to make use of the Alloy Analyzer. These translations have been performed manually so far, which is a cumbersome and error-prone activity. The aim of this paper is to explore to what extent this process can be automated.

The paper identifies a subset of Z that can be straightforwardly translated to Alloy, and the translation for this subset is formalised. More complex constructs, like schemas, are harder to translate. The paper gives a brief overview of the problems, and discusses alternative translation approaches.


Transformation Rule Intended Meaning Alloy Analyzer Translation Approach Translation Function 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Arthan, R.: Proofpower,
  2. 2.
    Aydal, E.G., Utting, M., Woodcock, J.: A comparison of state-based modelling tools for model validation. In: Proceedings of Objects, Components, Models and Patterns, 46th International Conference, TOOLS EUROPE 2008, Zurich, Switzerland, June 30 - July 4, 2008. LNBIP, vol. 11. Springer, Heidelberg (2008)Google Scholar
  3. 3.
    Bolton, C.: Using the Alloy analyzer to verify data refinement in Z. Electronic Notes in Theoretical Computer Science 137, 23–44 (2005)CrossRefGoogle Scholar
  4. 4.
    Börger, E., Butler, M., Bowen, J.P., Boca, P. (eds.): ABZ 2008. LNCS, vol. 5238. Springer, Heidelberg (2008)zbMATHGoogle Scholar
  5. 5.
    Derrick, J., North, S., Simons, T.: Issues in implementing a model checker for Z. In: Liu, Z., He, J. (eds.) ICFEM 2006. LNCS, vol. 4260, pp. 678–696. Springer, Heidelberg (2006)Google Scholar
  6. 6.
    Estler, H.-C., Wehrheim, H.: Alloy as a refactoring checker? Electronic Notes in Theoretical Computer Science 214, 331–357 (2008)CrossRefGoogle Scholar
  7. 7.
    Hewitt, M.A., O’Halloran, C.M., Sennett, C.T.: Experiences with PiZA, an animator for Z. In: Till, D., Bowen, J.P., Hinchey, M.G. (eds.) ZUM 1997. LNCS, vol. 1212, pp. 37–51. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  8. 8.
    ISO/IEC 13568. Information Technology—Z Formal Specification Notation—Syntax, Type System and Semantics. ISO/IEC (2002); First Edition 2002-07-01Google Scholar
  9. 9.
    Jackson, D.: Software Abstractions: Logic, Language, and Analysis. The MIT Press, Cambridge (2006)Google Scholar
  10. 10.
    Kang, E., Jackson, D.: Formal modeling and analysis of a flash filesystem in Alloy. In: Börger, et al. (eds.) [4], pp. 294–308Google Scholar
  11. 11.
    Leuschel, M., Butler, M.: ProB: an automated analysis toolset for the B method. Int. J. Softw. Tools Technol. Transf. 10(2), 185–203 (2008)CrossRefGoogle Scholar
  12. 12.
    Malik, P., Utting, M.: CZT: A framework for Z tools. In: Treharne, et al. (eds.) [21], pp. 65–84Google Scholar
  13. 13.
    ORA Canada. Z/EVES version 1.5: An overview. In: Hutter, D., Traverso, P. (eds.) FM-Trends 1998. LNCS, vol. 1641, pp. 367–376. Springer, Heidelberg (1999)Google Scholar
  14. 14.
    Plagge, D., Leuschel, M.: Validating Z specifications using the ProB animator and model checker. In: Davies, J., Gibbons, J. (eds.) IFM 2007. LNCS, vol. 4591, pp. 480–500. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  15. 15.
    Ramananandro, T.: Mondex, an electronic purse: specification and refinement checks with the Alloy model-finding method. Formal Aspects of Computing 20(1), 21–39 (2008)CrossRefGoogle Scholar
  16. 16.
    Reeve, G., Reeves, S.: Experiences using Z animation tools. Technical Report 01/3/2001, Department of Computer Science, University of Waikato (2001)Google Scholar
  17. 17.
    Smith, G., Wildman, L.: Model checking Z specifications using SAL. In: Treharne, et al. (eds.) [21]Google Scholar
  18. 18.
    Spivey, J.M.: The Z Notation: A Reference Manual. Prentice Hall International (UK) Ltd., Hertfordshire (1992)Google Scholar
  19. 19.
    Spivey, M.: The fuzz type-checker for Z,
  20. 20.
    Torlak, E., Jackson, D.: Kodkod: A relational model finder. In: Grumberg, O., Huth, M. (eds.) TACAS 2007. LNCS, vol. 4424, pp. 632–647. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  21. 21.
    Treharne, H., King, S., Henson, M.C., Schneider, S. (eds.): ZB 2005. LNCS, vol. 3455. Springer, Heidelberg (2005)zbMATHGoogle Scholar
  22. 22.
    Utting, M., Malik, P.: Unit testing of Z specifications. In: Börger, et al. (eds.) [4], pp. 309–322Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Petra Malik
    • 1
  • Lindsay Groves
    • 1
  • Clare Lenihan
    • 1
  1. 1.Victoria UniversityWellingtonNew Zealand

Personalised recommendations