Abstract
In this paper, the Z notation is used to develop a small theory of terms and substitutions within which a simple unification algorithm can be specified and proved correct. Particular emphasis is placed on the use of Z's mathematical data types to simplify the development and structure of this theory. The correctness of an abstract version of the algorithm is proved first; this version operates on substitutions by composition. Then data refinement is used to show that the substitutions can be represented by ‘binding functions’ that make composition a particularly efficient operation. The approach taken in this paper is compared with the approaches of three previous papers based on VDM.
The contribution of this paper is to show how data refinement can be used to explain the design decisions behind a non-trivial program, and to provide a point of comparison between Z and VDM approaches to the same problem.
Similar content being viewed by others
References
Clement, T.: Combining transformation and posit- and-prove in a VDM development, in S. Prehn and W. J. Toetenel (eds),VDM '91: formal software development methods, pp. 63–80, 1991.
Fitzgerald, J. S.: Unification: specification and development, Chapter 5 of [JoS90].
Gries, D.:The science of programming, Springer-Verlag, 1981.
Huet, G., and Oppen, D.: Equations and rewrite rules: a survey, in R. V. Book (ed),Formal language theory: perspectives and open problems, Academic Press, pp. 349–405, 1980.
Jones, C. B.:Systematic software development using VDM, Prentice-Hall International, 1986.
Jones, C. B. and Shaw, R. C. (eds):Case studies in systematic software development, Prentice-Hall International, 1990.
Manna, Z. and Waldinger, R.: Deductive synthesis of the unification algorithm,Science of Computer Programming, 1, 5–48 (1981).
Paulson, L. C.: Verifying the unification algorithm in LCF,Science of Computer Programming, 5, 143–169 (1985).
Robinson, J. A.: A machine-oriented logic based on the resolution principle,J. ACM, 12, 23–41 (1965).
Spivey, J. M.:The Z notation: a reference manual, Prentice-Hall International, Second edition, 1992.
Vadera, S.: Building a theory of unification, Chapter 6 of [JoS90].
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Spivey, J.M. Unification: A case-study in data refinement. Formal Aspects of Computing 7, 150–168 (1995). https://doi.org/10.1007/BF01211603
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/BF01211603