Abstract
A simple problem concerning evaluation of programs is shown to be nonelementary recursive. The problem is the following: Given an input-free programP (i.e. all variables are initially 0) without nested loops using only instructions of the formx ← 1, x ← x + y,\(x \leftarrow x\dot - y\),do x... end, doesP output 0? This problem has time complexity\(2^{2^{ {\mathinner{\mkern2mu\raise1pt\hbox{.}\mkern2mu \raise4pt\hbox{.}\mkern2mu\raise7pt\hbox{.}\mkern1mu}} ^2 } } \)}cn-levels for some constantc. Other results are presented which show how the complexity of the 0-evaluation problem changes when the nonlooping instructions are varied. For example, it is shown that 0-evaluation is PSPACE-complete even for the case when the nonlooping instructions are onlyx ← x + 1,if x = 0then y ←y \(y \leftarrow y\dot - 1\).
Similar content being viewed by others
References
Aho, A. V., Hopcroft, J. E. and Ullman, J. D.,The Design and Analysis of Computer Algorithms, Addison-Wesley, Reading, MA, 1974.
Cherniavsky, J., Simple programs realize exactly Presburger formulas,SIAM J. Comput., 5 (1976), pp. 666–677.
Constable, R. and Borodin, A., Subrecursive programming languages. Part I: Efficiency and program structure,JACM 19 (1972), 526–568.
Gurari, E. M. and Ibarra, O. H., The complexity of the equivalence problem for simple programs,JACM 28 (1981), 535–560.
Hartmanis, J. and Stearns, R. E., On the computational complexity of algorithms,Trans. AMS 117 (1965), 285–306.
Hopcroft, J. E. and Ullman, J. D.,Introduction to Automata Theory, Languages, and Computation, Addison-Wesley, Reading, MA, 1979.
Hunt, H. B. III, Constable, R. L., and Sahni, S., On the computational complexity of program scheme equivalence,SIAM J. Comput. 9 (1980), 396–416.
Hunt, H. B. III, On the complexity of flowchart and loop program schemes and programming languages,JACM 29 (1982), 228–249.
Ibarra, O. H. and Leininger, B. S., Characterizations of Presburger functions,SICOMP 10 (1981), 22–39.
Ibarra, O. H. and Rosier, L. E., Simple programming languages and restricted classes of Turing machines,Theoretical Computer Science, Vol. 26, No. 1 and 2, pp. 197–220, September 1983.
Ibarra, O. H. and Rosier, L. E., Some comments concerning the analysis of simple programs over different sets of primitives. University of Minnesota, Department of Computer Science, Tech. Rep. No. 82–10 (1982).
Kfoury, A. J., Analysis of simple programs over different sets of primitives,7th ACM SIGACT-SIGPLAN Conference Record, 1980, pp. 56–61.
Knuth, D.,The Art of Computer Programming: Vol. 2,Seminumerical Algorithms, Addison-Wesley, Reading, MA, 1973.
Machtey, M. and Young, P.,An Introduction to the General Theory of Algorithms, North-Holland, New York, NY, 1978.
Meyer, A. R., Weak monadic second order theory of successor is not elementary recursive, Project MAC Report, MIT, Cambridge, MA, 1972.
Meyer, A. R. and Ritchie, D. M., The complexity of loop programs,Proc. ACM Nat'l. Conf. (1967), 465–469.
Meyer, A. R. and Stockmeyer, L. J., Nonelementary word problems in automata and logic,Proc. AMS Symp. on Complexity of Computation, 1973.
Minsky, M. L.,Computation: Finite and Infinite Machines, Prentice Hall, Englewood Cliffs, NJ, 1967.
Stockmeyer, L. J. and Meyer, A. R., Word problems requiring exponential space,Proc. Fifth Annual ACM STOC (1973), 1–9.
Tsichritzis, D., The equivalence problem of simple programs,JACM 17 (1970), 729–738.
Author information
Authors and Affiliations
Additional information
This research was supported in part by NSF Grant MCS78-01736 and MCS81-02853.
Rights and permissions
About this article
Cite this article
Ibarra, O.H., Leininger, B.S. & Rosier, L.E. A note on the complexity of program evaluation. Math. Systems Theory 17, 85–96 (1984). https://doi.org/10.1007/BF01744435
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF01744435