Abstract
Software visualization provides methods to facilitate the understanding of algorithms and programs. Practically all existing visualization systems actually execute the code to be visualized on sample input data. In this paper, we propose a novel approach to algorithm explanation based on static program analysis, specifically shape analysis. Shape analysis of a program operating on heap-based data structures analyzes the program to find out relevant properties of its heap contents. The shape analysis we are using is parameterized with sets of observation properties, which are relevant properties of heap elements. Shape analysis associates sets of shape graphs with program points. These graphs describe both structural properties and non-structural properties such as sortedness. By summarizing sets of undistinguishable heap cells shape analysis supports focusing on active parts of the data structure. By computing the program’s invariants it provides the basis for their visualization. After the application of the shape analysis the program is visually abstractly executed, i.e., traversed with a strategy corresponding to a meaningful explanation. Showing a sequence of shape graphs produced along a program path demonstrates how invariants are temporarily violated and then restored.
supported by the Deutsche Forschungsgemeinschaft, Project Ganimal
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Sagiv, M., Reps, T., Wilhelm, R.: Parametric shape-analysis. In: Proc. of ACM SIGACTSIGPLAN Symposium on Principles of Programming Languages, St. Antonio, Texas, (1999), extended version to appear in ACM Transactions on Programming Languages and Systems (TOPLAS).
Lev-Ami, T., Reps, T., Mooly, S., Wilhelm, R.: Putting static analysis to work for verification: A case study. Proceedings of the International Symposium on Software Testing and Analysis, Portland, Oregon, USA (2000) 26–38
Aho, A.V., Hopcroft, J.E., Ullman, J. D.: Data Structures and Algorithms. Addison-Wesley, Reading, Mass. (1983)
Nielson, F., Riis Nielson, H., Hankin, C.: Principles of Program Analysis. Springer-Verlag, (1999)
Cousot, P., Cousot R.: Systematic design of program analysis frameworks. Conference Record of the Sixth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, ACM Press, New York, U.S.A., San Antonio, Texas, (1979) 269–282
Braune, B., Wilhelm, R.: Focusing in algorithm explanation. Transactions on Visualization and Computer Graphics, 6(1), (2000) 1–7
Michail, A.: Teaching Binary Tree Algorithms though Visual Programming. In Symposium on Visual Languages, IEEE, (1996) 38–45
Wenger, R.: Helly-Type Theorems and Geometric Transversals. In J.E. Goodman, J. O'Rourke (Eds.): Handbook of Discrete and Computational Geometry, CRC Press, (1997)
Demetrescu C., Finocchi, I. and J. Stasko.: Specifying Algorithm Visualizations: Interesting Events or State Mapping? In this volume, p. 105.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Wilhelm, R., Müldner, T., Seidel, R. (2002). Algorithm Explanation: Visualizing Abstract States and Invariants. In: Diehl, S. (eds) Software Visualization. Lecture Notes in Computer Science, vol 2269. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45875-1_30
Download citation
DOI: https://doi.org/10.1007/3-540-45875-1_30
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-43323-1
Online ISBN: 978-3-540-45875-3
eBook Packages: Springer Book Archive