Abstract
Besides being of theoretical interest the knowledge about a procedure's calling behavior is valuable for an optimizing compiler. It is well known, however, that such properties like recursivity or reachability of procedures are unfortunately undecidable for programs in ALGOL-like languages and are still worse than P-Space Complete in the ISO-Pascal case.
We extend this language hierarchy (with respect to parameter restrictions) at the lower end to Wirth's Pascal and show that there the recursivity problem for procedures is decidable within polynomial time. In order to establish this (rather unexpected) result we
-
1.
reduce recursivity of a procedure to a reachability problem — with both properties being defined on an infinite tree representation of the program;
-
2.
show the equivalence between reachability in such an infinite tree on the one hand and reachability in the finite graph representation on the other hand;
-
3.
solve then the reachability problem in this graph in O(ns) of a program with n procedures as vertices and s call statements as edges.
Preview
Unable to display preview. Download preview PDF.
8 References
D. Armbruster: A Polynomial Determination of the Most-Recent Property. Theoretical Computer Science 56, 3–15, 1988.
D. Armbruster: Entscheidbarkeit und Bestimmung der Rekursivität von Prozeduren. Dissertation, University of Stuttgart, 1985.
ISO/TC79/SC5N: Specification for Computer Language Pascal. Third draft proposal, 1981-11-04.
H. Langmaack: On Correct Procedure Parameter Transmission in Higher Programming Languages. Acta Informatica 2, 110–142, 1973.
A. R. Meyer: Complexity of Program Flow Analysis for Strictness..., private comminication, August 1985.
D. A. Patterson: Reduced Instruction Set Computers. Comm. of the ACM 28, 1, 8–21, 1985.
K. Walter: Recursion Analysis for Compiler Optimization. Comm. of the ACM 19, 9, 514–516, Sept. 1976.
K. Winklmann: On the Complexity of Some Problems Concerning the Use of Procedures I. Acta Informatica 18, 299–318, 1982.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Armbruster, D. (1991). Polynomial recursion analysis in pascal like programs. In: Ito, T., Meyer, A.R. (eds) Theoretical Aspects of Computer Software. TACS 1991. Lecture Notes in Computer Science, vol 526. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-54415-1_58
Download citation
DOI: https://doi.org/10.1007/3-540-54415-1_58
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-54415-9
Online ISBN: 978-3-540-47617-7
eBook Packages: Springer Book Archive