Abstract
We consider the implementation of SRDL, a small algebraic specification language with particular emphasis on structural recursion which is for abstract data types the analogue of primitive recursion. We demonstrate how the regular behaviour of structural recursion can be exploited for generating better code. Technically, this is achieved by generalizing loop iteration on integers to bottom-up iteration on trees. Here, it is possible to replace the function stack of activation records by simpler control stacks. On the machine level, this tree walk is performed by a generalization of the Schorr-Waite algorithm to n-ary trees, causing only a small overhead in execution time but no additional memory requirements. The resulting code is faster and requires less storage than usual call by value code.
Preview
Unable to display preview. Download preview PDF.
References
R.M. Burstall, D.B. MacQueen, D.T. Sannella, HOPE — An Experimental Applicative Language, Univ. Edinburgh, Dept. of Comp.Sci., Report CSR-62-80
M.J.C. Gordon, A.J.R.G. Milner, L. Morris, M. Newey, C. Wadsworth, A Metalanguage for Interactive Proofs in LCF, 5th ACM Symp. Princ. of Prog.Lang., Tucson 1978
D. Gries, The Schorr-Waite Graph Marking Algorithm, Acta Informatica 11 (1979), 223–232
K. Indermark, Functional compiler description, Banach Center Publications 21 (1988), Polish Academy of Sciences, Warsaw
K. Indermark, H. Klaeren, Compiling Fibonacci-like Recursion, SIGPLAN Notices 22 (1987), No. 6, 101–108
H. Klaeren, Algebraische Spezifikation — Eine Einführung, Springer Lehrbuch Informatik, 1983
H. Klaeren, A Constructive Method for Abstract Algebraic Software Specification, Theoretical Computer Science, 30 (1984), 139–204
H. Klaeren, Ein algebraischer Ansatz zur Rekursionselimination, Habilitationsschrift, RWTH Aachen, 1988
H. Klaeren, ModAs/86 User Manual, Berichte des Lehrstuhls für Informatik II, RWTH Aachen, 1988
H. Klaeren, K. Indermark, A New Implementation Technique for Recursive Function Definitions, Aachener Informatik-Berichte Nr. 87-10
J. Loeckx, A Formal Description of the Specification Language OBSCURE, Universität des Saarlandes, FB 10, Bericht A85/15
H.C. Mayr, P.C. Lockemann, K.R. Dittrich, Operational Replacement Schemes — A Practice-Oriented Approach to the Specification of Abstract Data Types, Universität Karlsruhe, Fakultät für Informatik, Bericht 11/80
A. Schubert, Modularisierung algebraischer Spezifikationen zum Einsatz im System-und Programmentwurf, Diplomarbeit, RWTH Aachen, 1986
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1989 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Klaeren, H., Indermark, K. (1989). Efficient implementation of an algebraic specification language. In: Wirsing, M., Bergstra, J.A. (eds) Algebraic Methods: Theory, Tools and Applications. Algebraic Methods 1987. Lecture Notes in Computer Science, vol 394. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0015036
Download citation
DOI: https://doi.org/10.1007/BFb0015036
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-51698-9
Online ISBN: 978-3-540-46758-8
eBook Packages: Springer Book Archive