Skip to main content

Using attributed flow graph parsing to recognize clichés in programs

  • Software Engineering
  • Conference paper
  • First Online:
Graph Grammars and Their Application to Computer Science (Graph Grammars 1994)

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

Abstract

This paper presents a graph parsing approach to recognizing common, stereotypical computational structures, called clichés, in computer programs. Recognition is a powerful technique for efficiently reconstructing useful design information from existing software. We use a flow graph formalism, which is closely related to hypergraph formalisms, to represent programs and clichés and we use attributed flow graph parsing to automate recognition. The formalism includes mechanisms for tolerating variations in programs due to structure sharing (a common optimization in which a structural component is used to play more than one functional role). The formalism has also been designed to capture aggregation relationships on graph edges, which is used to encode aggregate data structure clichés and the abstract operations on them. A chart parsing algorithm is used to solve the problem of determining which clichés in a given cliché library are in a given program.

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. D. Brotsky. An algorithm for parsing flow graphs. Technical Report 704, MIT Artificial Intelligence Lab., March 1984. Master's thesis.

    Google Scholar 

  2. H. Bunke and B. Haller. A parser for context free plex grammars. In M. Nagl, editor, 15th Int. Workshop on Graph-Theoretic Concepts in Computer Science, pages 136–150. Springer-Verlag, June 1989. LNCS, Vol. 411.

    Google Scholar 

  3. W. Dally, et al. The J-Machine: A fine-grain concurrent computer. In Int. Fed. of Info. Processing Societies, 1989.

    Google Scholar 

  4. P. Della-Vigna and C. Ghezzi. Context-free graph grammars. Information and Control, 37(2):207–233, 1978.

    Google Scholar 

  5. J. Earley. An efficient context-free parsing algorithm. Comm. of the ACM, 13(2):94–102, 1970.

    Google Scholar 

  6. R. Farrow, K. Kennedy, and L. Zucconi. Graph grammars and global program data flow analysis. In Proc. 17th Annual IEEE Symposium on Foundations of Computer Science, pages 42–56, Houston, Texas, 1976.

    Google Scholar 

  7. J. Feder. Plex languages. Information Sciences Journal, 3:225–241, 1971.

    Google Scholar 

  8. A. Habel. Hyperedge Replacement: Grammars and Languages. Springer-Verlag, New York, 1992. Lecture Notes in Computer Science Series, Vol. 643.

    Google Scholar 

  9. J. Hartman. Automatic control understanding for natural programs. Technical Report AI 91-161, University of Texas at Austin, 1991. PhD thesis.

    Google Scholar 

  10. W. L. Johnson. Intention-Based Diagnosis of Novice Programming Errors. Morgan Kaufmann Publishers, Inc., Los Altos, CA, 1986.

    Google Scholar 

  11. M. Kay. Algorithm schemata and data structures in syntactic processing. In B. Grosz, K. Sparck-Jones, and B. Webber, editors, Readings in Natural Language Processing, pages 35–70. Morgan Kaufmann Publishers, Inc., Los Altos, CA, 1986.

    Google Scholar 

  12. V. Kozaczynski and J.Q. Ning. Automated program understanding by concept recognition. Automated Software Engineering, 1(1):61–78, March 1994.

    Google Scholar 

  13. S. Letovsky. Plan analysis of programs. RR 662, Yale University, Dec. 1988.

    Google Scholar 

  14. U. Lichtblau. Decompilation of control structures by means of graph transformation. In H. Ehrig, editor, LNCS, Vol. 185, pages 284–297. Springer-Verlag, 1985.

    Google Scholar 

  15. R. Lutz. Chart parsing of flowgraphs. In Proc. 11th Int. Joint Conf. Artificial Intelligence, pages 116–121, Detroit, Michigan, 1989.

    Google Scholar 

  16. U. G. Montanari. Separable graphs, planar graphs, and web grammars. Information and Control, 16(3):243–267, March 1970.

    Google Scholar 

  17. T. Pavlidis. Linear and context-free graph grammars. Journal of the ACM, 19(1):11–23, January 1972.

    Google Scholar 

  18. K. Peng, T. Yamamoto, and Y. Aoki. A new parsing algorithm for plex grammars. Pattern Recognition, 23(3–4):393–402, 1990.

    Google Scholar 

  19. J. L. Pfaltz and A. Rosenfeld. Web grammars. In Proc. 1st Int. Joint Conf. Artificial Intelligence, pages 609–619, Washington, D.C., September 1969.

    Google Scholar 

  20. A. Quilici. Memory-based approach to recognizing programming plans. Comm. of the ACM, 37(5):84–93, May 1994.

    Google Scholar 

  21. C. Rich and R. C. Waters. The Programmer's Apprentice. Addison-Wesley, Reading, MA and ACM Press, Baltimore, MD, 1990.

    Google Scholar 

  22. C. Rich and L. M. Wills. Recognizing a program's design: A graph-parsing approach. IEEE Software, 7(1):82–89, January 1990.

    Google Scholar 

  23. A. Rosenfeld and D. Milgram. Web automata and web grammars. In B. Meltzer and D. Michie, editors, Machine Intelligence 7, pages 307–324. John Wiley and Sons, New York, 1972.

    Google Scholar 

  24. H. Thompson. Chart parsing and rule schemata in GPSG. In Proc. 19th Annual Meeting of the ACL, Stanford, CA, 1981.

    Google Scholar 

  25. L. Wills. Automated program recognition: A feasibility demonstration. Artificial Intelligence, 45(1–2):113–172, 1990.

    Google Scholar 

  26. L. Wills. Automated program recognition by graph parsing. Technical Report 1358, MIT Artificial Intelligence Lab., July 1992. PhD Thesis.

    Google Scholar 

  27. L. Wills. Flexible control for program recognition. In Proc. 1st Working Conference on Reverse Engineering, Baltimore, MD, May 1993.

    Google Scholar 

  28. K. Wittenburg, L. Weitzman, and J. Talley. Unification-based grammars and tabular parsing for graphical languages. TR ACT-OODS-208-91, MCC, 1991.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Janice Cuny Hartmut Ehrig Gregor Engels Grzegorz Rozenberg

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Wills, L.M. (1996). Using attributed flow graph parsing to recognize clichés in programs. In: Cuny, J., Ehrig, H., Engels, G., Rozenberg, G. (eds) Graph Grammars and Their Application to Computer Science. Graph Grammars 1994. Lecture Notes in Computer Science, vol 1073. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61228-9_86

Download citation

  • DOI: https://doi.org/10.1007/3-540-61228-9_86

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-61228-5

  • Online ISBN: 978-3-540-68388-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics