Skip to main content

Type inference in Z

  • Type Systems
  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 428))

Abstract

Generic definitions provide an important part of the power of the Z notation, allowing the standard toolkit of mathematical notation to be built up from a very small set of primitives, and permitting application-oriented theories to be constructed with an appropriate degree of abstraction and generality. Although there is a notation for supplying explicitly the actual generic parameters when a generic constant is used, it greatly improves the readability of a Z document if the actual parameters are left to be inferred from the context, especially since every symbol from the basic mathematical toolkit would otherwise need explicit generic type parameters. In this paper we present and justify a method by which a type-checking program can carry out this inference of implicit generic parameters and check that the context determines them unambiguously. In the appendix we show the text of a type-checker for Z written in standard ML.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  • Milner, A.J.R.G (1978) A Theory of Type Polymorphism in Programming Languages. Journal of Computer and System Science, 17, 348–357.

    Google Scholar 

  • Spivey, J.M. (1988) Understanding Z: a Specification Language and its Formal Semantics. Cambridge Tracts in Theoretical Computer Science, 3.

    Google Scholar 

  • Sufrin, B.A. (ed) (1986) The Z Handbook. Programming Research Group.

    Google Scholar 

  • Sufrin, B.A. (1987) The Zebra Typechecker. Programming Research Group.

    Google Scholar 

  • Reed, J.N. and Sinclair, J.E. (1989) An algorithm for type checking Z. Programming Research Group, 1987.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

D. Bjørner C. A. R. Hoare H. Langmaack

Rights and permissions

Reprints and permissions

Copyright information

© 1990 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Spivey, J.M., Sufrin, B.A. (1990). Type inference in Z. In: Bjørner, D., Hoare, C.A.R., Langmaack, H. (eds) VDM '90 VDM and Z — Formal Methods in Software Development. VDM 1990. Lecture Notes in Computer Science, vol 428. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-52513-0_22

Download citation

  • DOI: https://doi.org/10.1007/3-540-52513-0_22

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-52513-4

  • Online ISBN: 978-3-540-47006-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics