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.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
D. Brotsky. An algorithm for parsing flow graphs. Technical Report 704, MIT Artificial Intelligence Lab., March 1984. Master's thesis.
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.
W. Dally, et al. The J-Machine: A fine-grain concurrent computer. In Int. Fed. of Info. Processing Societies, 1989.
P. Della-Vigna and C. Ghezzi. Context-free graph grammars. Information and Control, 37(2):207–233, 1978.
J. Earley. An efficient context-free parsing algorithm. Comm. of the ACM, 13(2):94–102, 1970.
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.
J. Feder. Plex languages. Information Sciences Journal, 3:225–241, 1971.
A. Habel. Hyperedge Replacement: Grammars and Languages. Springer-Verlag, New York, 1992. Lecture Notes in Computer Science Series, Vol. 643.
J. Hartman. Automatic control understanding for natural programs. Technical Report AI 91-161, University of Texas at Austin, 1991. PhD thesis.
W. L. Johnson. Intention-Based Diagnosis of Novice Programming Errors. Morgan Kaufmann Publishers, Inc., Los Altos, CA, 1986.
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.
V. Kozaczynski and J.Q. Ning. Automated program understanding by concept recognition. Automated Software Engineering, 1(1):61–78, March 1994.
S. Letovsky. Plan analysis of programs. RR 662, Yale University, Dec. 1988.
U. Lichtblau. Decompilation of control structures by means of graph transformation. In H. Ehrig, editor, LNCS, Vol. 185, pages 284–297. Springer-Verlag, 1985.
R. Lutz. Chart parsing of flowgraphs. In Proc. 11th Int. Joint Conf. Artificial Intelligence, pages 116–121, Detroit, Michigan, 1989.
U. G. Montanari. Separable graphs, planar graphs, and web grammars. Information and Control, 16(3):243–267, March 1970.
T. Pavlidis. Linear and context-free graph grammars. Journal of the ACM, 19(1):11–23, January 1972.
K. Peng, T. Yamamoto, and Y. Aoki. A new parsing algorithm for plex grammars. Pattern Recognition, 23(3–4):393–402, 1990.
J. L. Pfaltz and A. Rosenfeld. Web grammars. In Proc. 1st Int. Joint Conf. Artificial Intelligence, pages 609–619, Washington, D.C., September 1969.
A. Quilici. Memory-based approach to recognizing programming plans. Comm. of the ACM, 37(5):84–93, May 1994.
C. Rich and R. C. Waters. The Programmer's Apprentice. Addison-Wesley, Reading, MA and ACM Press, Baltimore, MD, 1990.
C. Rich and L. M. Wills. Recognizing a program's design: A graph-parsing approach. IEEE Software, 7(1):82–89, January 1990.
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.
H. Thompson. Chart parsing and rule schemata in GPSG. In Proc. 19th Annual Meeting of the ACL, Stanford, CA, 1981.
L. Wills. Automated program recognition: A feasibility demonstration. Artificial Intelligence, 45(1–2):113–172, 1990.
L. Wills. Automated program recognition by graph parsing. Technical Report 1358, MIT Artificial Intelligence Lab., July 1992. PhD Thesis.
L. Wills. Flexible control for program recognition. In Proc. 1st Working Conference on Reverse Engineering, Baltimore, MD, May 1993.
K. Wittenburg, L. Weitzman, and J. Talley. Unification-based grammars and tabular parsing for graphical languages. TR ACT-OODS-208-91, MCC, 1991.
Author information
Authors and Affiliations
Editor information
Rights 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