# Implementation of modular algebraic specifications

## Abstract

The foundation of implementation of algebraic specifications in a modular way is investigated. Given an algebraic specification with visible and hidden signature an *observing* signature is defined. This is a part of the visible signature which is used to observe the behaviour of the implementation.

Two correctness criteria are given for the implementation with respect to the observing signature. An algebraic correctness criterion guarantees initial algebraic semantics for the specification as seen through the observing signature, while allowing freedom for other parts of the signature, to the extent that even final semantics may be used there. A functional correctness criterion allows one to prove the correctness of the implementation for one observing function in Hoare logic. The union over all observing functions of such implementations provides an actual implementation in any programming language with semantics as described above.

*Note:* Partial support has been received from the European Communities under ESPRIT project no. 348 (Generation of Interactive Programming Environments - GIPE).

## Keywords

Congruence Class Abstract Data Type Input Term Hoare Logic Retrieval Function## References

- [Bac86]
- [Bak84]C. Baker-Finch (1984). “Acceptable models of algebraic semantics,”
*Australian Computer Science Communications*, vol. 6, no. 1, pp. 5–1/10, Proceedings of the Seventh Australian Computer Science Conference, Adelaide, ed. C.J. Barter.Google Scholar - [BHK85]J.A. Bergstra, J. Heering, and P. Klint (1985). “Algebraic definition of a simple programming language,” Report CS-R8504, Centre for Mathematics and Computer Science, Amsterdam.Google Scholar
- [BHK86]J.A. Bergstra, J. Heering, and P. Klint (1986). “Module algebra,” Report CS-R8617, Centre for Mathematics and Computer Science, Amsterdam.Google Scholar
- [BHK87]J.A. Bergstra, J. Heering, and P. Klint (1987). “ASF — an algebraic specification formalism,” Report CS-R8705, Centre for Mathematics and Computer Science, Amsterdam.Google Scholar
- [BK86]J.A. Bergstra and J.W. Klop (1986). “Conditional rewrite rules: confluence and termination,”
*Journal of Computer and System Sciences*, vol. 32, no. 3, pp. 323–362.CrossRefGoogle Scholar - [BT82]J.A. Bergstra and J.V. Tucker (1982). “The completeness of the algebraic specification methods for computable data types,”
*Information and Control*, vol. 54, no. 3, pp. 186–200.Google Scholar - [BT83]J.A. Bergstra and J.V. Tucker (1983). “Initial and final algebra semantics for data type specifications: two characterization theorems,”
*SIAM Journal on Computing*, vol. 12, no. 2, pp. 366–387.Google Scholar - [BDMW81]M. Broy, W. Dosch, B. Möller, and M. Wirsing (1981). “GOTOs — a study in the algebraic specification of programming languages,” in
*GI-11. Jahrestagung*, ed. W. Brauer, Informatik-Fachberichte, vol. 50, pp. 109–121, Springer-Verlag.Google Scholar - [Die86]N.W.P. van Diepen (1986). “A study in algebraic specification: a language with goto-statements,” Report CS-R8627, Centre for Mathematics and Computer Science, Amsterdam.Google Scholar
- [DE84]K. Drosten and H.-D. Ehrich (1984). “Translating algebraic specifications to Prolog programs,” Informatik-Bericht Nr. 84-08, Technische Universität Braunschweig.Google Scholar
- [FGJM85]K. Futatsugi, J.A. Goguen, J.-P. Jouannaud and J. Meseguer (1985). “Principles of OBJ2”, in
*Conference Record of the Twelfth Annual ACM Symposium on Principles of Programming Languages*, pp. 52–66, ACM.Google Scholar - [GM82]J.A. Goguen and J. Meseguer (1982), “Universal realization, persistent interconnection and implementation of abstract modules,” in
*Proceedings 9th International Conference on Automata, Languages and Programming*, eds. M. Nielsen & E.M. Schmidt, Lecture Notes in Computer Science, vol. 140, pp. 265–281, Springer-Verlag.Google Scholar - [GM84]J.A. Goguen and J. Meseguer (1984). “Equality, types, modules, and (why not?) generics for logic programming,”
*Journal of Logic Programming*, vol. 2, pp. 179–210.Google Scholar - [GMP83]J.A. Goguen, J. Meseguer and D. Plaisted (1983). “Programming with parameterized abstract objects in OBJ”, in
*Theory and Practice of Software Technology*, eds. D. Ferrari, M. Bolognani & J.A. Goguen, pp. 163–193, North-Holland.Google Scholar - [HO80]G. Huet and D.C. Oppen (1980). “Equations and rewrite rules: a survey,” in
*Formal Language Theory, Perspectives and Open Problems*, ed. R.V. Book, pp. 349–405, Academic Press.Google Scholar - [JW78]K. Jensen and N. Wirth (1978).
*Pascal: User Manual and Report*(second edition), Springer-Verlag.Google Scholar - [Jon80]
- [Kam83]S. Kamin (1983). “Final data types and their specification,”
*ACM Transactions on Programming Languages and Systems*, vol. 5, no. 1, pp. 97–123.Google Scholar - [LS84]J. Loeckx and K. Sieber (1984).
*The Foundation of Program Verification*, Wiley-Teubner.Google Scholar - [MG85]J. Meseguer and J.A. Goguen (1985). “Initiality, induction, and computability,” in
*Algebraic Methods in Semantics*, eds. M. Nivat & J.C. Reynolds, pp. 459–541, Cambridge University Press.Google Scholar - [ODo85]
- [ST85]D. Sannella and A. Tarlecki (1985). “On observational equivalence and algebraic specification,” in
*Mathematical Foundations of Software Development. Proceedings International Joint Conference on Theory and Practice of Software Development, TAPSOFT '85*, eds. H. Ehrig, C. Floyd, M. Nivat & J. Thatcher, Lecture Notes in Computer Science, vol. 185, pp. 308–322, Springer-Verlag.Google Scholar - [Wan79]M. Wand (1979). “Final algebra semantics and data type extensions,”
*Journal of Computer and System Sciences*, vol. 19, pp. 27–44.CrossRefGoogle Scholar