Summary
We consider programming languages which allow procedures to be declared dynamically and to be passed as parameters. The influence of these two features on the decidability of “formal parameter correctness”, “formal recursivity”, and other properties relevant for debugging and optimization has been studied in [1, 2, 4–9]. In this paper we study the feasibility of such decision procedures in those cases where decidability has been proven. Thus this paper presents a complexity-theoretic refinement of some of the recursion-theoretic work from [1, 2, 4–9].
In contrast to part I [10], this part is concerned with restricted classes of programs. The main results presented in this part are:
-
1)
Deciding whether or not a program has the “formal most-recent-property” is a P-space-complete problem even for programs with no more than 4 parameters per procedure (Theorem 7).
-
2)
Deciding formal parameter correctness, formal recursivity and reachability of procedures, and the formal macro-property are all P-space complete problems for the class of programs without procedure nesting (Theorem 4). Detecting the presence of recursive procedures is an NP-complete problem for this class of programs (Theorem 4).
-
3)
In finite-mode programs, detecting the presence of formally recursive procedures is an NP-complete problem; deciding whether or not a procedure is formally recursive, deciding whether or not a procedure is formally reachable, and deciding whether or not a program has the formal macro-property are P-space-hard problems; and deciding whether or not a program has the formal most-recent-property is a P-space-complete problem (Theorem 5).
Similar content being viewed by others
References
Kandzia, P.: On the most-recent-property of ALGOL-like programs. Automata, Languages, and Programming-2nd Colloquium. Loeckx, J. (ed.) (Lecture Notes in Computer Science, vol. 14), 1974
Kaufholz, G., Lippe, W.: A note on a paper of H. Langmaack about procedure parameter transmission. Bericht A74/06. Universität des Saarlandes, Saarbrücken, 1974
Kral, J.: The equivalence of modes and the equivalence of finite automata. ALGOL Bulletin 35, 4.5, 35–36 (1973)
Langmaack, H.: On correct procedure parameter transmission in higher programming languages. Acta Informat. 2, 110–142 (1973)
Langmaack, H.: On procedures as open subroutines. I. Acta Informat. 2, 311–333 (1973)
Langmaack, H.: On procedures as open subroutines. II. Acta Informat. 3, 227–241 (1974)
Langmaack, H., Lippe, W.M., Wagner, F.: The formal termination problem for programs with finite ALGOL60 modes. Informat. Proc. Lett. 9, 155–159 (1979)
Lippe, W.: Entscheidbarkeitsprobleme bei der Übersetzung von Programmen mit einparametrigen Prozeduren. 3. Fachtagung über Programmiersprachen. Schlender, B., Frielinghaus, W. (eds.) (Lecture Notes in Computer Science, vol. 7). Berlin-Heidelberg-New York: Springer 1974
Lippe, W.: Über die Entscheidbarkeit der formalen Erreichbarkeit von Prozeduren bei monadischen Programmen. Doctoral Dissertation. Universität des Saarlandes, Saarbrücken, 1975
Winklmann, K.: On the complexity of some problems concerning the use of procedures. I. Acta Informat. 18, 299–318 (1982)
Author information
Authors and Affiliations
Additional information
Supported by the Purdue Research Foundation and by the National Science Foundation through Grants GJ27127A1 and MCS8004128
Rights and permissions
About this article
Cite this article
Winklmann, K. On the complexity of some problems concerning the use of procedures. II. Acta Informatica 18, 411–430 (1983). https://doi.org/10.1007/BF00289578
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF00289578