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(X − X ÷ 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.
Similar content being viewed by others
References
Gries, D.: Compiler construction for digital computers. New York-London-Sydney-Toronto: John Wiley and Sons 1971
Holls, T.P.: APL programming guide: Vector optimizations. White Plains, New York: IBM DPD Scientific Marketing Report 1978
Knuth, D.E.: The art of computer programming, Vol. 1: Fundamental algorithms, 2nd ed. Reading, Mass.: Addison Wesley 1973
Knuth, D.E.: The art of computer programming, Vol. 3: Sorting and searching. Reading, Mass.: Addison-Wesley 1973
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
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
Perlis, A.J.: Private Communication
Perlis, A.J., Rugaber, J.S.: The APL idiom list. Yale University Computer Science Technical Report #87, 1977
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
Websters 3rd International Dictionary
Author information
Authors and Affiliations
Additional information
This work was supported in part by National Science Foundation Grant MCS78-04749
Rights 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
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF00264357