skip to main content
article

Logical characterizations of heap abstractions

Published:01 January 2007Publication History
Skip Abstract Section

Abstract

Shape analysis concerns the problem of determining “shape invariants” for programs that perform destructive updating on dynamically allocated storage. In recent work, we have shown how shape analysis can be performed using an abstract interpretation based on three-valued first-order logic. In that work, concrete stores are finite two-valued logical structures, and the sets of stores that can possibly arise during execution are represented (conservatively) using a certain family of finite three-valued logical structures. In this article, we show how three-valued structures that arise in shape analysis can be characterized using formulas in first-order logic with transitive closure. We also define a nonstandard (“supervaluational”) semantics for three-valued first-order logic that is more precise than a conventional three-valued semantics, and demonstrate that the supervaluational semantics can be implemented using existing theorem provers.

Skip Supplemental Material Section

Supplemental Material

References

  1. Andersen, L. O. 1993. Binding-Time analysis and the taming of C pointers. In Proceedings of the ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM), D. Schmidt, Ed. 47--58.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Benedikt, M., Reps, T., and Sagiv, M. 1999. A decidable logic for describing linked data structures. In Proceedings of the European Symposium On Programming. 2--19.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Blamey, S. 2002. Partial logic. In Handbook of Philosophical Logic, 2nd. ed., vol. 5, D. Gabbay and F. Guenthner, Eds. Kluwer Academic. 261--353.]]Google ScholarGoogle Scholar
  4. Bruns, G. and Godefroid, P. 2000. Generalized model checking: Reasoning about partial state spaces. In Proceedings of the Concurrency Theory: 11th International Conference (CONCUR). Lecture Notes in Computer Science, vol. 1877. Springer Verlag, 168--182.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Chase, D., Wegman, M., and Zadeck, F. 1990. Analysis of pointers and structures. In SIGPLAN Conference on Programming Language Design and Implementation. 296--310.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Clarke, E., Grumberg, O., Jha, S., Lu, Y., and Veith, H. 2000. Counterexample-Guided abstraction refinement. In Proceedings of the Conference on Computer-Aided Verification. 154--169.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Clarke, E., Grumberg, O., and Long, D. 1994. Model checking and abstraction. Trans. Prog. Lang. Syst. 16, 5, 1512--1542.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Courcelle, B. 1996. On the expression of graph properties in some fragments of monadic second-order logic. In Descriptive Complexity and Finite Models: Proceedings of a DIAMCS Workshop, N. Immerman and P. Kolaitis, Eds. American Mathematical Society. 33--57.]]Google ScholarGoogle Scholar
  9. Cousot, P. and Cousot, R. 1977. Abstract interpretation: A unified lattice model for static analysis of programs by construction of approximation of fixed points. In Symposium on Principles of Programming Languages. 238--252.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Dams, D. 1996. Abstract interpretation and partial refinement for model checking. Ph.D. thesis, Technical University of Eindhoven, Eindhoven, The Netherlands.]]Google ScholarGoogle Scholar
  11. Das, M. 2000. Unification-Based pointer analysis with directional assignments. In Conference on Programming Language Design and Implementation. 35--46.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Erez, G. 2004. Generating concrete counter examples for arbitrary abstract domains. M.S. thesis, Tel-Aviv University, Tel-Aviv, Israel. In preparation.]]Google ScholarGoogle Scholar
  13. Erez, G., Sagiv, M., and Yahav, E. 2003. Generating concrete counter examples for arbitrary abstract domains. Unpublished manuscript.]]Google ScholarGoogle Scholar
  14. Fagin, R. 1975. Monadic generalized spectra. Z. Math. Logik 21, 89--96.]]Google ScholarGoogle ScholarCross RefCross Ref
  15. Fähndrich, M., Foster, J., Su, Z., and Aiken, A. 1998. Partial online cycle elimination in inclusion constraint graphs. In Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation. 85--96.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Fradet, P. and Metayer, D. L. 1997. Shape types. In Proceedings of the Symposium on Principles of Programming Languages. 27--39.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Godefroid, P. and Jagadeesan, R. 2003. On the expressiveness of 3-valued models. In Proceedings of the 4th Conference on Verfication, Model Checking and Abstract Interpretation (VMCAI). 206--222.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Heintze, N. and Tardieu, O. 2001. Ultra-Fast aliasing analysis using CLA: A million lines of C code in a second. In Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Hell, P. and Nesetril, J. 2004. Graphs and Homomorphisms. Oxford University Press.]]Google ScholarGoogle Scholar
  20. Hendren, L. 1990. Parallelizing programs with recursive data structures. Ph.D. thesis, Cornell University, Ithaca, NY.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Hendren, L., Hummel, J., and Nicolau, A. 1992. Abstractions for recursive pointer data structures: Improving the analysis and the transformation of imperative programs. In Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation. 249--260.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Hendren, L. and Nicolau, A. 1990. Parallelizing programs with recursive data structures. IEEE Trans. Parallel Distrib Syst. 1, 1 (Jan.), 35--47.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Henriksen, J., Jensen, J., Jørgensen, M., Klarlund, N., Paige, B., Rauhe, T., and Sandholm, A. 1996. Mona: Monadic second-order logic in practice. In Proceedings of the Tools and Algorithms for the Construction and Analysis of Systems (TACAS'95). 89--110.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Huth, M., Jagadeesan, R., and Schmidt, D. A. 2001. Modal transition systems: A foundation for three-valued program analysis. In Proceedings of the Programming Languages and Systems: 10th European Symposium on Programming (ESOP). Lecture Notes in Computer Science, vol. 2028. Springer Verlag. 155--169.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Immerman, N. 1999. Descriptive Complexity. Springer Verlag.]]Google ScholarGoogle Scholar
  26. Immerman, N., Rabinovich, A., Reps, T., Sagiv, M., and Yorsh, G. 2004a. The boundary between decidability and undecidability for transitive-closure logics. In Computer Science Logic. Lecture Notes in Computer Science, vol. 3210. Springer Verlag.]]Google ScholarGoogle Scholar
  27. Immerman, N., Rabinovich, A., Reps, T., Sagiv, M., and Yorsh, G. 2004b. Verification via structure simulation. In Computer Aided Verification. Lecture Notes in Computer Science, vol. 3114. Springer Verlag.]]Google ScholarGoogle Scholar
  28. Jones, N. and Muchnick, S. 1981. Flow analysis and optimization of Lisp-like structures. In Program Flow Analysis: Theory and Applications, S. Muchnick and N. Jones, Eds. Prentice-Hall, Englewood Cliffs, NJ, 102--131.]]Google ScholarGoogle Scholar
  29. Jones, N. and Muchnick, S. 1982. A flexible approach to interprocedural data flow analysis and programs with recursive data structures. In Symposium on Principles of Programming Languages. 66--74.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Klarlund, N. and Schwartzbach, M. 1993. Graph types. In Symposium on Principles of Programming Languages. New York, NY, 196--205.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Kuncak, V., Lam, P., and Rinard, M. C. 2002. Role analysis. In Proceedings of the Conference POPL. 17--32.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Kuncak, V. and Rinard, M. 2003a. Boolean algebra of shape analysis constraints. In Proceedings of the Verification Model Checking and Abstract Interpretation. Lecture Notes in Computer Science, vol. 2937. Springer Verlag. 59--72.]]Google ScholarGoogle Scholar
  33. Kuncak, V. and Rinard, M. 2003b. On Boolean algebra of shape analysis constraints. Tech. Rep., MIT, CSAIL. http://www.mit.edu/~vkuncak/papers/index.html.]]Google ScholarGoogle Scholar
  34. Lam, P., Kuncak, V., and Rinard, M. 2005. Hob: A tool for verifying data structure consistency. In Conference on Compiler Construction (Tool Demo).]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Lev-Ami, T. 2000. TVLA: A framework for Kleene based static analysis. M.S. thesis, Tel-Aviv University, Tel-Aviv, Israel.]]Google ScholarGoogle Scholar
  36. Lev-Ami, T., Immerman, N., Reps, T., Sagiv, M., Srivastava, S., and Yorsh, G. 2005. Simulating reachability using first-order logic with applications to verifciation of linked data structures. Submitted for publication.]]Google ScholarGoogle Scholar
  37. Lev-Ami, T., Reps, T., Sagiv, M., and Wilhelm, R. 2000. Putting static analysis to work for verification: A case study. In Proceedings of the International Symposium on Software Testing and Analysis. 26--38.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Lev-Ami, T. and Sagiv, M. 2000. TVLA: A system for implementing static analyses. In Proceedings of the Static Analysis Symposium. 280--301.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. McCune, W. 2001. Mace 2.0 reference manual and guide. http://www-unix.mcs.anl.gov/AR/mace/.]]Google ScholarGoogle Scholar
  40. McMillan, K. L. 1999. Verification of infinite state systems by compositional model checking. In Proceedings of the Correct Hardware Design and Venfication Methods: 110th IFIP WG 10.5 Advanced Research Working Conference (CHARME). Lecture Notes in Computer Science, vol. 1703. Springer Verlag. 219--234.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Meyer, A. R. 1975. Weak monadic second-order theory of successor is not elementary recursive. In Logic Colloquium, Proceedings of the Symposium on Logic. 132--154.]]Google ScholarGoogle Scholar
  42. Møller, A. and Schwartzbach, M. 2001. The pointer assertion logic engine. In SIGPLAN Conference on Programming Language Design and Implementation. 221--231.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Mortimer, M. 1975. On languages with two variables. Zeitschrift fur Math. Logik uematischend Grundlagen der Math 21, 135--140.]]Google ScholarGoogle ScholarCross RefCross Ref
  44. Nielson, F., Nielson, H., and Hankin, C. 1999. Principles of Program Analysis. Springer Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Nielson, F., Nielson, H., and Sagiv, M. 2000. A Kleene analysis of mobile ambients. In Proceedings of the Programming Languages and Systems: 19th European Symposium on Programming (ESOP). Lecture Notes in Computer Science, vol. 1782. Springer Verlag. 305--319.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Rabin, M. 1969. Decidability of second-order theories and automata on infinite trees. Trans. Amer. Math. Soc. 141, 1--35.]]Google ScholarGoogle Scholar
  47. Ramalingam, G., Varshavsky, A., Field, J., Goyal, D., and Sagiv, M. 2002. Deriving specialized program analyses for certifying component-client conformance. In Proceedings of the PLDI Conferance. 83--94.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Reps, T., Sagiv, M., and Yorsh, G. 2004. Symbolic implementation of the best transformer. In Verification, Model Checking, and Abstract Interpretation. Lecture Notes in Computer Science, vol. 2937. Springer Verlag. 252--266.]]Google ScholarGoogle Scholar
  49. Sagiv, M., Reps, T., and Wilhelm, R. 1998. Solving shape-analysis problems in languages with destructive updating. Trans. Program. Lang. Syst. 20, 1 (Jan.), 1--50.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Sagiv, M., Reps, T., and Wilhelm, R. 1999. Parametric shape analysis via 3-valued logic. In Symposium on Principles of Programming Language. 105--118.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Sagiv, M., Reps, T., and Wilhelm, R. 2002. Parametric shape analysis via 3-valued logic. Trans. Program. Lang. Syst.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Shaham, R., Yahav, E., Kolodner, E., and Sagiv, M. 2003. Establishing local temporal heap safety properties with applications to compile-time memory management. In Proceedings of the Static Analysis Symposium (SAS). Lecture Notes in Computer Science, vol. 2694. Springer Verlag, 483--503.]]Google ScholarGoogle Scholar
  53. Shapiro, M. and Horwitz, S. 1997. Fast and accurate flow-insensitive points-to analysis. In Symposium on Principles of Programming Languages. 1--14.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Steensgaard, B. 1996. Points-to analysis in almost-linear time. In Proceedings of the Symposium on Principles of Programming Languages. 32--41.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Su, Z., Fähndrich, M., and Aiken, A. 2000. Projection merging: Reducing redundancies in inclusion constraint graphs. In Proceedings of the Symposium on Principles of Programming Languages, T. Reps, Ed. 81--95.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. van Fraassen, B. 1966. Singular terms, truth-value gaps, and free logic. J. Phil 63, 17, 481--495.]]Google ScholarGoogle ScholarCross RefCross Ref
  57. Weidenbach, C. 2006. SPASS: An automated theorem prover for first-order logic with equality. http://spass.mpi-sb.mpg.de/index.html.]]Google ScholarGoogle Scholar
  58. Yahav, E. 2001. Verifying safety properties of concurrent Java programs using 3-valued logic. In Proceedings of the Symposium on Principles of Programming Languages 36, 3, 27--40.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Yahav, E. and Ramalingam, G. 2004. Verifying safety properties using separation and heterogeneous abstractions. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. 25--34.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Yahav, E. and Sagiv, M. 2003. Automatically verifying concurrent queue algorithms. In Electronic Notes in Theoretical Computer Science, vol. 89. B. Cook et al. Eds. Elsevier.]]Google ScholarGoogle Scholar
  61. Yorsh, G. 2003. Logical characterizations of heap abstractions. M.S. thesis, Tel-Aviv University, Tel-Aviv, Israel. http://www.math.tau.ac.il/~gretay.]]Google ScholarGoogle Scholar
  62. Yorsh, G., Reps, T. W., and Sagiv, M. 2004. Symbolically computing most precise abstract operations for shape analysis. In Tools and Algorithms for the Construction and Analysis of Systems. Lecture Notes in Computer Science, vol. 2988. Springer Verlag. 530--545.]]Google ScholarGoogle Scholar

Index Terms

  1. Logical characterizations of heap abstractions

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            Full Access

            • Published in

              cover image ACM Transactions on Computational Logic
              ACM Transactions on Computational Logic  Volume 8, Issue 1
              January 2007
              210 pages
              ISSN:1529-3785
              EISSN:1557-945X
              DOI:10.1145/1182613
              Issue’s Table of Contents

              Copyright © 2007 ACM

              Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 1 January 2007
              Published in tocl Volume 8, Issue 1

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • article

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader