Skip to main content

The equivalence problem and correctness formulas for a simple class of programs

Extended abstract

  • Communications
  • Conference paper
  • First Online:
Mathematical Foundations of Computer Science 1984 (MFCS 1984)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 176))

Abstract

This paper is concerned with the semantics (or computational power) of very simple loop programs over different sets of primitive instructions. Recently, a complete and consistent Hoare axiomatics for the class of {x←0, x←y, x←x+1, x←x∸1, do x...end} programs which contain no nested loops, was given, where the allowable assertions were those formulas in the logic of Presburger arithmetic. The class of functions computable by such programs is exactly the class of Presburger functions. Thus, the resulting class of correctness formulas has a decidable validity problem. In this paper, we present simple loop programming languages which are, computationally, strictly more powerful, i.e. which can compute more than the class of Presburger functions. Furthermore, using a logical assertion language that is also more powerful than the logic of Presburger arithmetic, we present a class of correctness formulas over such programs that also has a decidable validity problem. In related work, we examine the expressive power of loop programs over different sets of primitive instructions. In particular, we show that an {x←0, x←y, x←x+1, do x ... end, if x=0 then y←z}-program which contains no nested loops can be transformed into an equivalent {x←0, x←y, x←x+1, do x ... end}-program (also without nested loops) in exponential time and space. This translation was earlier claimed, in the literature, to be doable in polynomial time, but then this was subsequently shown to imply that PSPACE=PTIME. Consequently, the question of translatability was left unanswered. Also, we show that the class of functions computable by {x←0, x←y, x←x+1, x←x∸1, do x ... end, if x=0 then x←c}-programs is exactly the class of Presburger functions. When the conditional instruction is changed to “if x=0 then x←y+1”, then the class of computable functions is significantly enlarged, enough so, in fact, as to render many decision problems (e.g. equivalence) undecidable.

This research was supported in part by NSF Grant MCS 83-04756.

This research was supported in part by The University Research Institute, The University of Texas at Austin and the IBM Corporation.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Alt, H., Functions Equivalent to Integer Multiplication, Lecture Notes in Computer Science, No. 85: Automata, Languages and Programming (ICALP 80), Springer Verlag, 1980.

    Google Scholar 

  2. Cherniavsky, J., Simple Programs Realize Exactly Presburger Formulas, SIAM J. Comput. 5 (1976), pp. 666–677.

    Google Scholar 

  3. Cherniavsky, J. and Kamin, S., A Complete and Consistent Hoare Axiomatics for a Simple Programming Language, J. ACM, 26 (1979), pp. 119–128.

    Google Scholar 

  4. Constable, R., Hunt, H. and Sahni, S., On the Computational Complexity of Scheme Equivalence, Proc. 8th Ann. Princeton Conf. on Information Sciences Systems, Princeton, NJ, 1974.

    Google Scholar 

  5. Fischer, M. and Rabin, M., Super-Exponential Complexity of Presburger Arithmetic, Project Mac. Tech. Memo 43, MIT, Cambridge, 1974.

    Google Scholar 

  6. Gurari, E., Decidable Problems for Powerful Programs, to appear in J. ACM.

    Google Scholar 

  7. Gurari, E. and Ibarra, O., The Complexity of the Equivalence Problem for Simple Programs, J. ACM 28, 3 (July 1981), pp. 535–560.

    Google Scholar 

  8. Gurari, E. and Ibarra, O., The Complexity of the Equivalence Problem for Two Characterizations of Presburger Sets, Theor. Computer Science, 13 (1981) pp. 295–314.

    Google Scholar 

  9. Gurari, E. and Ibarra, O., Two-Way Counter Machines and Diophantine Equations, J. ACM 29, 3 (July 1982), pp. 863–873.

    Google Scholar 

  10. Hoare, C., An Axiomatic Basis of Computer Programming, CACM, Vol. 12, No. 10, pp. 576–580, 1969.

    Google Scholar 

  11. Ibarra, O., Reversal-Bounded Multicounter Machines and their Decision Problems, J. ACM, Vol. 25, No. 1, January 1978, pp. 116–133.

    Google Scholar 

  12. Ibarra, O. and Leininger, B., Characterizations of Presburger Functions, SIAM J. Comput., Vol. 10, No. 1, pp. 22–39, February, 1981.

    Google Scholar 

  13. Ibarra, O. and Leininger, B., On the Equivalence and Simplification Problems for Simple Programs, J. ACM, 30, 3 (July 1983), pp. 641–656.

    Google Scholar 

  14. Ibarra, O., Leininger, B. and Rosier, L., A Note on the Complexity of Program Evaluation, accepted for publication in Math. Systems Theory.

    Google Scholar 

  15. Ibarra, O. and Rosier, L., The Equivalence Problem and Correctness Formulas for a Simple Class of Programs, University of Texas at Austin, Department of Computer Sciences, Tech. Rep. No. 83–23 (1983).

    Google Scholar 

  16. Ibarra, O. and Rosier, L., Simple Programming Languages and Restricted Classes of Turing Machines, Theoretical Computer Science, Vol. 26, No. 1 and 2, pp. 197–220, September 1983.

    Google Scholar 

  17. Jefferson, D., Type Reduction and Program Verification (Ph.D. thesis), Department of Computer Science, Carnegie-Mellon University, 1980.

    Google Scholar 

  18. Kfoury, A., Analysis of Simple Programs Over Different Sets of Primitives, 7th ACM SIGACT-SIGPLAN Conference Record, 1980, pp. 56–61.

    Google Scholar 

  19. Knuth, D., The Art of Computer Programming: Vol. 1, Fundamental Algorithms, Addison-Wesley, Reading, MA, 1973.

    Google Scholar 

  20. Matijasevic, Y., Enumerable Sets are Diophantine, Dodl. Akad. Nauk., SSSR 191 (1970), pp. 279–282.

    Google Scholar 

  21. Meyer, A. and Richie, D., The Complexity of Loop Programs, in Proc. 22nd Nat. Conf. of the ACM, Thompson Book Co., Washington, DC, 1976, pp. 465–469.

    Google Scholar 

  22. Robinson, J., Definability and Decision Problems in Arithmetic, J. Symbolic Logic, 14, pp. 98–114 (1949), MR 11, 151.

    Google Scholar 

  23. Suzuki, N. and Jefferson, D., Verification Decidability of Presburger Array Programs, J. ACM 27, 1 (Jan. 1980), pp. 191–205.

    Google Scholar 

  24. Tsichritzis, D., The Equivalence Problem of Simple Programs, J. ACM 17, 4 (Oct. 1970), pp. 729–738.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

M. P. Chytil V. Koubek

Rights and permissions

Reprints and permissions

Copyright information

© 1984 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ibarra, O.H., Rosier, L.E. (1984). The equivalence problem and correctness formulas for a simple class of programs. In: Chytil, M.P., Koubek, V. (eds) Mathematical Foundations of Computer Science 1984. MFCS 1984. Lecture Notes in Computer Science, vol 176. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0030314

Download citation

  • DOI: https://doi.org/10.1007/BFb0030314

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-13372-8

  • Online ISBN: 978-3-540-38929-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics