Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

Optimizing Ackermann's function by incrementalization

Published: 07 June 2003 Publication History

Abstract

This paper describes a formal derivation of an optimized Ackermann's function following a general and systematic method based on incrementalization. The method identifies an appropriate input increment operation and computes the function by repeatedly performing an incremental computation at the step of the increment. This eliminates repeated subcomputations in executions that follow the straightforward recursive definition of Ackermann's function, yielding an optimized program that is drastically faster and takes extremely little space. This case study uniquely shows the power and limitation of the incrementalization method, as well as both the iterative and recursive nature of computation underlying the optimized Ackermann's function.

References

[1]
G. Berry. Bottom-up computation of recursive programs. RAIRO Informatique Thorique/Theoretical Computer Science 10(1):47--82, Mar. 1976.
[2]
G. Berry. Calculs ascendants du programme d'Ackermann: Analyse du programme de J. Arsac. RAIRO Informatique Thorique/Theoretical Computer Science 11(2):113--126, 1976.
[3]
R. S. Bird. Tabulation techniques for recursive programs. ACM Comput. Surv.12(4):403--417, Dec. 1980.
[4]
J. Cai and R. Paige. Program derivation by fixed point computation. Sci. Comput. Program. 11:197--261, Sept. 1988/89.
[5]
J. Cai, R. Paige, and R. Tarjan. More efficient bottom-up multi-pattern matching in trees. Theoret. Comput. Sci.106(1):21--60, Nov. 1992.
[6]
W.-N. Chin. Towards an automated tupling strategy. In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation pages 119--132. ACM, New York, 1993.
[7]
W.-N. Chin and M. Hagiya. A bounds inference method for vector-based memoization. In Proceedings of the 1997 ACM SIGPLAN International Conference on Functional Programming pages 176--187. ACM, New York, 1997.
[8]
T. H. Cormen, C. E. Leiserson, and R. L. Rivest. Introduction to Algorithms TheMIT Press/McGraw-Hill, 1990.
[9]
J. W. Grossman and R. S. Zeitman. An inherently iterative computation of Ackermann's function. Theoretical Computer Science 57(2-3):327--330, May 1988.
[10]
F. Henglein. Efficient type inference for higher-order binding-time analysis. In Proceedings of the 5th International Conference on Functional Programming Languages and Computer Architecture volume 523 of Lecture Notes in Computer Science pages 448--472. Springer-Verlag, Berlin, 1991.
[11]
N. D. Jones. An introduction to partial evaluation. ACM Comput. Surv.28(3):480--503, 1996.
[12]
N. D. Jones. Notes on Ackermann's function and comments on derivation. Email communications, Oct. 2000.
[13]
N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation Prentice-Hall, 1993.
[14]
T. Lengauer and R. Tarjan. A fast algorithm for finding dominators in a flowgraph. ACM Trans. Program. Lang. Syst.1(1):121--141, July 1979.
[15]
Y. A. Liu. Efficiency by incrementalization: An introduction. Higher-Order and Symbolic Computation 13(4):289--313, Dec. 2000.
[16]
Y. A. Liu and G. Gómez. Automatic accurate cost-bound analysis for high-level languages. IEEE Transactions on Computers 50(12):1295--1309, Dec. 2001. An earlier version appeared in Proceedings of the ACM SIGPLAN Workshop on Languages, Compilers, and Tools for Embedded Systems 1998.
[17]
Y. A. Liu and S. D. Stoller. From recursion to iteration: what are the optimizations? In Proceedings of the ACM SIGPLAN 2000 Workshop on Partial Evaluation and Semantics-Based Program Manipulation pages 73--82. ACM, New York, 2000.
[18]
Y. A. Liu and S. D. Stoller. Program optimization using indexed and recursive data structures. In Proceedings of the ACM SIGPLAN 2002 Workshop on Partial Evaluation and Semantics-Based Program Manipulation pages 108--118. ACM,New York, 2002.
[19]
Y. A. Liu and S. D. Stoller. Dynamic programming via static incrementalization. Higher-Order and Symbolic Computation 16(1-2):37--62, Mar.-June 2003. An earlier version appeared in Proceedings of the 8th European Symposium on Programming 1999.
[20]
Y. A. Liu, S. D. Stoller, and T. Teitelbaum. Static caching for incremental computation. ACM Trans. Program. Lang. Syst. 20(3):546--585, May 1998. An earlier version appeared in Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation 1995.
[21]
Y. A. Liu, S. D. Stoller, and T. Teitelbaum. Strengthening invariants for efficient computation. Sci. Comput. Program. 41(2):139--172, Oct.2001. An earlier version appeared in Conference Record of the 23rd Annual ACM Symposium on Principles of Programming Languages 1996.
[22]
D. Michie. "memo" functions and machine learning. Nature 218:19--22, Apr. 1968.
[23]
R. Paige. Real-time simulation of a set machine on a RAM. In Computing and Information, Vol. II pages 69--73.Canadian Scholars Press, 1989. Proceedings of ICCI'89: The International Conference on Computing and Information, Toronto, Canada, May 23-27, 1989.
[24]
R. Paige and S. Koenig. Finite differencing of computable expressions. ACM Trans. Program. Lang. Syst. 4(3):402--454, July 1982.
[25]
A. Pettorossi. A powerful strategy for deriving efficient programs by transformation. In Conference Record of the 1984 ACM Symposium on LISP and Functional Programming ACM, New York, 1984.
[26]
A. Pettorossi and M. Proietti. Rules and strategies for transforming functional and logic programs. ACM Comput. Surv. 28(2):360--414, June 1996.
[27]
H. G. Rice. Recursion and iteration. Commun. ACM 8(2):114--115, Feb. 1965.
[28]
B. Steensgaard. Points-to analysis in almost linear time. In Conference Record of the 23rd Annual ACM Symposium on Principles of Programming Languages pages 32--41. ACM, New York, 1996.
[29]
M. P. Ward. Iterative procedures for computing Ackerman's function. Technical Report 9, Department of Computer Science, University of Durham, Durham, U.K., July 1993.

Cited By

View all
  • (2011)Approximate Shortest Paths in Simple PolyhedraDiscrete Geometry for Computer Imagery10.1007/978-3-642-19867-0_43(513-524)Online publication date: 2011
  • (2011)Approximate shortest paths in simple polyhedraProceedings of the 16th IAPR international conference on Discrete geometry for computer imagery10.5555/1987119.1987170(513-524)Online publication date: 6-Apr-2011

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 38, Issue 10
Proceedings of the ACM SIGPLAN symposium on principles and practice of parallel programming (PPoPP 2003) and workshop on partial evaluation and semantics-based program manipulation (PEPM 2003)
October 2003
331 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/966049
Issue’s Table of Contents
  • cover image ACM Conferences
    PEPM '03: Proceedings of the 2003 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation
    June 2003
    100 pages
    ISBN:1581136676
    DOI:10.1145/777388
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 07 June 2003
Published in SIGPLAN Volume 38, Issue 10

Check for updates

Author Tags

  1. caching
  2. incremental computation
  3. incrementalization
  4. iteration
  5. memoization
  6. optimization
  7. program transformation
  8. recursion
  9. tabulation

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 16 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2011)Approximate Shortest Paths in Simple PolyhedraDiscrete Geometry for Computer Imagery10.1007/978-3-642-19867-0_43(513-524)Online publication date: 2011
  • (2011)Approximate shortest paths in simple polyhedraProceedings of the 16th IAPR international conference on Discrete geometry for computer imagery10.5555/1987119.1987170(513-524)Online publication date: 6-Apr-2011

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media