Springer Nature is making SARS-CoV-2 and COVID-19 research free. View research | View latest news | Sign up for updates

Recognition and selection of idioms for code optimization


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 to check access.


  1. 1.

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

  2. 2.

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

  3. 3.

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

  4. 4.

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

  5. 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

  6. 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

  7. 7.

    Perlis, A.J.: Private Communication

  8. 8.

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

  9. 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

  10. 10.

    Websters 3rd International Dictionary

Download references

Author information

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).

Download citation


  • Information System
  • Operating System
  • Data Structure
  • Communication Network
  • Information Theory