ABSTRACT
We present a family of abstract-interpretation algorithms that are capable of determining "shape invariants" of programs that perform destructive updating on dynamically allocated storage. The main idea is to represent the stores that can possibly arise during execution using three-valued logical structures.
Questions about properties of stores can be answered by evaluating predicate-logic formulae using Kleene's semantics of three-valued logic:
If a formula evaluates to true, then the formula holds in every store represented by the three-valued structure.
If a formula evaluates to false, then the formula does not hold in any store represented by the three-valued structure.
If a formula evaluates to unknown, then we do not know if this formula always holds, never holds, or sometimes holds and sometimes does not hold in the stores represented by the three-valued structure.
Three-valued logical structures are thus a conservative representation of memory stores.
The approach described is a parametric framework: It provides the basis for generating a family of shape-analysis algorithms by varying the vocabulary used in the three-valued logic.
- 1.U. Assmann and M. Weinhardt. Interprocedural heap analysis for parallelizing imperative programs. In W. K. Giloi, S. J~ihnichen, and B. D. Shriver, editors, Programming Models For Massively Parallel Computers, pages 74-82, Washington, DC, September 1993. IEEE Press.Google ScholarCross Ref
- 2.D.R. Chase, M. Wegman, and F. Zadeck. Analysis of pointers and structures. In SIGPLAN Conf. on Prog. Lang. Design and lmpl., pages 296-310, New York, NY, 1990. ACM Press. Google ScholarDigital Library
- 3.P. Cousot and R. Cousot. Systematic design of program analysis frameworks. In Syrup. on Princ. of Prog. Lang., pages 269-282, New York, NY, 1979. ACM Press. Google Scholar
- 4.A. Deutsch. A storeless model for aliasing and its abstractions using finite representations of right-regular equivalence relations. In IEEE International Conference on Computer Languages, pages 2-13, Washington, DC, 1992. IEEE Press.Google ScholarCross Ref
- 5.A. Deutsch. Interprocedural may-alias analysis for pointers: Beyond k-limiting. In SIGPLAN Conf. on Prog. Lang. Design and Impl., pages 230-241, New York, NY, 1994. ACM Press. Google ScholarDigital Library
- 6.L. Hendren. Parallelizing Programs with Recursive Data Structures. PhD thesis, CorneI1 Univ., Ithaca, NY, Jan 1990. Google ScholarDigital Library
- 7.L. Hendren, J. Hummel, and A. Nicolau. Abstractions for recursive pointer data structures: Improving the analysis and the transformation of imperative programs. In SIGPLAN Conf. on Prog. Lang. Design and lmpl., pages 249-260, New York, NY, June 1992. ACM Press. Google ScholarDigital Library
- 8.L. Hendren and A. Nicolau. Parallelizing programs with recursive data structures. IEEE Trans. on Par. and Dist. Syst., 1(1):35-47, January 1990. Google ScholarDigital Library
- 9.C.A.R. Hoare. Recursive data structures. Int. d. of Comp. and Inf. Sci., 4(2):105-132, 1975.Google Scholar
- 10.S. Horwitz, P. Pfeiffer, and T. Reps. Dependence analysis for pointer variables. In SIGPLAN Conf. on Prog. Lang. Design and lmpl., pages 28-40, New York, NY, 1989. ACM Press. Google ScholarDigital Library
- 11.N.D. Jones and S.S. Muchnick. Flow analysis and optimization of Lisp-like structures. In S.S. Muchnick and N.D. Jones, editors, Program Flow Analysis: Theory and Applications, chapter 4, pages 102-131. Prentice-Hall, Englewood Cliffs, NJ, 1981.Google Scholar
- 12.N.D. Jones and S.S. Muchnick. A flexible approach to interprocedural data flow analysis and programs with recursive data structures. In Syrup. on Princ. of Prog. Lang., pages 66-74, New York, NY, 1982. ACM Press. Google Scholar
- 13.S.C. Kleene. Introduction to Metamathematics. North- Holland, second edition, 1987.Google Scholar
- 14.W. Landi and B.G. Ryder. Pointer induced aliasing: A problem classification. In Syrup. on Princ. of Prog. Lang., pages 93-103, New York, NY, January 1991. ACM Press. Google Scholar
- 15.J.R. Larus and P.N. Hilfinger. Detecting conflicts between structure accesses. In SIGPLAN Conf. on Prog. Lang. Design and Impl., pages 21-34, New York, NY, 1988. ACM Press. Google ScholarDigital Library
- 16.J. Plevyak, A.A. Chien, and V. Karamcheti. Analysis of dynamic structures for efficient parallel execution, in U. Banerjee, D. Gelernter, A. Nicolau, and D. Padua, editors, Languages and Compilers .for Parallel Computing, volume 768 of Lec. Notes in Comp. Sci., pages 37-57, Portland, OR, August 1993. Springer-Verlag. Google Scholar
- 17.M. Sagiv, T. Reps, and R. Wilhelm. Solving shape-analysis problems in languages with destructive updating. In Syrup. on Princ. of Prog. Lang., New York, NY, January 1996. ACM Press. Google ScholarDigital Library
- 18.M. Sagiv, T. Reps, and R. Wilhelm. Parametric shape analysis via 3-valued logic. Tech. Rep. TR-1383, Comp. Sci. Dept., Univ. of Wisconsin, Madison, WI, July 1998. Available at "http://www.cs.wisc.edu/wpis/papers/parametric.ps".Google Scholar
- 19.M. Sagiv, T. Reps, and R. Wilhelm. Solving shape-analysis problems in languages with destructive updating. 7~ns. on Prog. Lang. and Syst., 20(1):1-50, January 1998. Google ScholarDigital Library
- 20.S. Sagiv, N. Francez, M. Rodeh, and R. Wilhelm. A logic-based approach to data flow analysis problems. Acta Inf., 35(6):457- 504, June 1998.Google ScholarCross Ref
- 21.J. Stransky. A lattice for abstract interpretation of dynamic (Lisp-like) structures. Inf. and Comp., 101(1):70-102, Nov. 1992. Google ScholarDigital Library
- 22.E. Y.-B. Wang. Analysis of Recursive Types in an Imperative Language. PhD thesis, Univ. of Calif., Berkeley, CA, 1994. Google ScholarDigital Library
Index Terms
- Parametric shape analysis via 3-valued logic
Recommendations
Parametric shape analysis via 3-valued logic
Shape analysis concerns the problem of determining "shape invariants" for programs that perform destructive updating on dynamically allocated storage. This article presents a parametric framework for shape analysis that can be instantiated in different ...
Another Useful Four-Valued Logic
Knowledge Science, Engineering and ManagementAbstractWe propose a four-valued logic with intuitive semantics by the connectives that is useful for understanding the contradictions in knowledge representation. The intuitive semantics reflects that any assertion has dual character by whose information ...
Three-valued Logics in Modal Logic
Every truth-functional three-valued propositional logic can be conservatively translated into the modal logic S5. We prove this claim constructively in two steps. First, we define a Translation Manual that converts any propositional formula of any three-...
Comments