Abstract
This paper demonstrates how reduction to normal form can help in the design of a correct compiler for Dijkstra's guarded command language. The compilation strategy is to transform a source program, by a series of algebraic manipulations, into a normal form that describes the behaviour of a stored-program computer. Each transformation eliminates high-level language constructs in favour of lower-level constructs. The correctness of the compiler follows from the correctness of each of the algebraic transformations.
Similar content being viewed by others
References
Back, R.J.R., von Wright, J.: Refinement calculus, part 1: sequential nondeterministic programs. (Lect. Notes Comput. Sci., vol. 430, pp. 42–67) Berlin Heidelberg New York: Springer 1990
Back, R.J.R.: Refinement calculus, part 2: Parallel and reactive programs. (Lect. Notes Comput. Sci., vol. 430, pp. 68–94) Berlin Heidelberg New York: Springer 1990
Dijkstra, E.W.: Guarded commands, non-determinacy, and formal derivation of programs. Commun. ACM18(8), 453–457 (1975)
Gardiner, P., Pandya, P.K.: Reasoning algebraically about recursion. Sci. Comput. Programming18, 271–280 (1992)
Goguen, J., et al.: Introducing OBJ. Technical Report, SRI International 1993
Gries, D.: The science of programming. New York: Springer 1981
Hoare, C.A.R.: An axiomatic basis for computer programming. Commun. ACM12 (10), 576–583 (1969)
Hoare, C.A.R., Jifeng, He: The weakest prespecification. Inf. Process. Lett.24(2), 127–132 (1987)
Hoare, C.A.R., Jifeng, He, Sanders, J.W.: Prespecification in data refinement. Inf. Process. Lett.25(2), 71–76 (1987)
Hoare, C.A.R., et al.: Laws of programming. Commun. ACM30(8), 672–686 (1987)
Hoare, C.A.R.: Refinement algebra proves the correctness of compiling specification. In: Morgan, C.C., Woodcock, J.C.P. (eds.) 3rd Refinement Workshop, pp. 34–48. Berlin Heidelberg New York: Springer 1991
He, J., Hoare, C.A.R., Sanders, J.W.: Data refinement refined. (Lect. Notes Comput. Sci. vol. 213, pp. 187–196) Berlin Heidelberg New York: Springer 1986
Jones, C.B.: Software development, a rigorous approach. Englewood Cliffs, NJ: Prentice-Hall 1980
Morgan, C.C.: Data refinement by miracles. Inf. Process. Lett.26, 243–246 (1988)
Morgan, C.C.: Programming from specifications. Englewood Cliffs, NJ: Prentice Hall 1990
Morris, J.M.: A theoretical basis for stepwise refinement and the programming calculus. Sci. Comput. Programming9, 287–306 (1987)
Nelson, G.: A generalization of Dijkstra's calculus. Tech. Rep 16, Digital System Research Center, Palo Alto 1987
Nelson, G., Manasse, M.: The proof of a second step of a factored compiler. (Lecture Notes for International Summer School on Programming and Mathematical Method), Marktoberdorf, Germany, 1990
Sampaio, A.: An algebraic approach to compiler design. DPhil Thesis, Oxford University, Computing Laboratory 1993
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Hoare, C.A.R., Jifeng, H. & Sampaio, A. Normal form approach to compiler design. Acta Informatica 30, 701–739 (1993). https://doi.org/10.1007/BF01191809
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF01191809