Skip to main content
Log in

Recognition and selection of idioms for code optimization

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

Idioms are frequently occurring expressions that programmers use for logically primitive operations for which no primitive construct is available in the language. For example, in ALGOL-60 the expression abs(XX ÷ 2 × 2) is idiomatic for parity of X. With optimization as a motive, two problems, idiom recognition and selection, are defined. Recognition is solved in O(n log n) time (worst case), O(n) time (average case) on a uniform cost RAM. Selection is solved in O(n) time. Ambiguity is solved in O(n 2) time and is related to resolution theorem proving.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Gries, D.: Compiler construction for digital computers. New York-London-Sydney-Toronto: John Wiley and Sons 1971

    Google Scholar 

  2. Holls, T.P.: APL programming guide: Vector optimizations. White Plains, New York: IBM DPD Scientific Marketing Report 1978

  3. Knuth, D.E.: The art of computer programming, Vol. 1: Fundamental algorithms, 2nd ed. Reading, Mass.: Addison Wesley 1973

    Google Scholar 

  4. Knuth, D.E.: The art of computer programming, Vol. 3: Sorting and searching. Reading, Mass.: Addison-Wesley 1973

    Google Scholar 

  5. Miller, T.C.: Tentative compilation: A design for an APL compiler. Department of Applied Physics and Information Sciences, University of California at San Diego Technical Report 78-CS-013, 1978

    Google Scholar 

  6. Paterson, M.S., Wegman, M.N.: A linear time unification algorithm. Eighth ACM Symposium on the Theory of Computing, Hershey, Penn., pp. 181–186. New York: Association of Computing Machinery 1976

    Google Scholar 

  7. Perlis, A.J.: Private Communication

  8. Perlis, A.J., Rugaber, J.S.: The APL idiom list. Yale University Computer Science Technical Report #87, 1977

  9. Robinson, J.A.: Computational logic: The unification computation. Machine Intelligence, Vol. 6, pp. 63–72. New York-London-Sydney-Toronto: John Wiley and Sons 1971

    Google Scholar 

  10. Websters 3rd International Dictionary

Download references

Author information

Authors and Affiliations

Authors

Additional information

This work was supported in part by National Science Foundation Grant MCS78-04749

Rights and permissions

Reprints and permissions

About this article

Cite this article

Snyder, L. Recognition and selection of idioms for code optimization. Acta Informatica 17, 327–348 (1982). https://doi.org/10.1007/BF00264357

Download citation

  • Received:

  • Issue Date:

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

Keywords

Navigation