skip to main content
10.1145/263699.263706acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free access

Shape types

Published: 01 January 1997 Publication History

Abstract

Type systems currently available for imperative languages are too weak to detect a significant class of programming errors. For example, they cannot express the property that a list is doubly-linked or circular. We propose a solution to this problem based on a notion of shape types defined as context-free graph grammars. We define graphs in set-theoretic terms, and graph modifications as multiset rewrite rules. These rules can be checked statically to ensure that they preserve the structure of the graph specified by the grammar. We provide a syntax for a smooth integration of shape types in C. The programmer can still express pointer manipulations with the expected constant time execution and benefits from the additional guarantee that the property specified by the shape type is an invariant of the program.

References

[1]
L. Andersen, Program analysis and specialization .for the C programming language, Ph.D Thesis, DIKU, University of Copenhagen, May 1994.
[2]
J.-P. Banhtre and D. Le M#tayer, Programming by multiset transformation, Communications of the ACM, Vol. 36-1, pp. 98-111, January 1993.
[3]
D. Chase, M. Wegman and F. Zadeck, Analysis of pointers and structures, in Proc. ACM Conf. on Protramming Language Design and Implementation, Vol. 25(6) of SIGPLAN Notices, pp. 296-310, 1990.
[4]
T. H. Cormen, C. E. Leiserson and R. L. Rivest, Introduction to algorithms, MIT Press, 1990.
[5]
B. Courcelle, Graph rewriting: an algebraic and logic approach, Handbook of Theoretical Computer Science, Chapter 5, J. van Leeuwen (ed.), Elsevier Science Publishers, 1990.
[6]
P. Della Vigna and C. Ghezzi, Context-free graph grammars, Information and Control, Vol. 37, pp. 207- 233, 1978.
[7]
A. Deutsch, Semantic models and abstract interpretation techniques for inductive data structures and pointers, in Proc. ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation PEPM'95, pp. 226-229, 1995.
[8]
P. Fradet and D. Le MStayer, Structured Gamma, Irisa Research Report PI-989, March 1996.
[9]
P. Fradet, R. Gaugne and D. Le M6tayer, Detection of pointer errors: an aaviomatisation and a checking algorithm, Proc. European Symposium on Programming, Springer Verlag, LNCS 1058, pp. 125-140, 1996.
[10]
R. Ghiya and L. J. Hendren, Is it a tree, a dag, or a cyclic graph ? A shape analysis for heap.directed pointers in G, in Proc. ACM Principles of Programming Languages, pp. 1-15, 1996.
[11]
J. Grosch, Tool support.for data structures, Structured Programming, Vol. 12, pp. 31-38, 1991.
[12]
L. J. Hendren, J. Hummel and A. Nicolau, Abstractions .for recursive pointer data structures: improving the analysis and transformation of imperative pro. grams, in Proc. ACM Conf. on Programming Language Design and Implementation, pp. 249-260, 1992.
[13]
J. Hummel, L. J. Hendren and A. Nicolau, Abstract description of pointer data structures: an approach }or improving the analysis and optimisation of imperative programs, ACM Letters on Programming Languages and Systems, Vol. 1, No 3, pp. 243-260, September 1992.
[14]
N. Jones and S. Muchnick, Flow analysis and optimization of Lisp-like structures, in Program Flow Analysis: Theory and Applications, New Jersey 1981, Prentice-Hall, pp. 102-131.
[15]
N. Klarlund and M. Schwartzbach, Graph types, Proc. ACM Principles of Programming Languages, pp. 196- 205, 1993.
[16]
N. Klarlund and M. Schwartzbach, Graphs and decidable transductions based on edge constraints, in Proc. Trees in Algebra and Progrnmming - CAAP'94, Springer Verlag, LNCS 787, pp. 187-201, 1994.
[17]
W. Landi and B. Ryder, Pointer induced aliasing, a problem classification, Proe. ACM Principles of Programming Languages, pp. 93-103, 1991.
[18]
W. Pugh, Skip lists: a probabilistic alternative to balanced trees, Communications of the ACM, Vol. 33-6, pp. 668-676, June 1990.
[19]
J.-C. Raoult and F. Voisin, Set-theoretic graph rewriting, Proc. int. Workshop on Graph T#'ansformations in Computer Science, Springer Verlag, LNCS 776, pp. 312-325, 1993.
[20]
J. R. Russel, R. E. Storm and D. M. Yellin, A checkable interlace language for pointer-based structures, Proc. Workshop on Interface Declaration Languages, ACM Sigplan Notices, Vol. 29, No. 8, August 1994.
[21]
M. Sagiv, T. Reps and R. Wilhelm, Solving shapeanalysis problems in languages with destructive updating, Proc. ACM Principles of Programming Languages, pp. 16-31, 1996.
[22]
R. Sedgewick, Algorithms in C, Addison-Wesley publishing company, 1990.
[23]
J. H. Siekmann, Unification theory, Advances in Artificial Intelligence, Ii, Elsevier Science Publishers, pp. 365-400, 1987.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '97: Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
January 1997
497 pages
ISBN:0897918533
DOI:10.1145/263699
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 January 1997

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

POPL97
Sponsor:
  • SIGPLAN
  • Ctr Natl de la Recherche Sci
  • L'Ecole des Mines de Paris
  • SIGACT

Acceptance Rates

POPL '97 Paper Acceptance Rate 36 of 225 submissions, 16%;
Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)132
  • Downloads (Last 6 weeks)13
Reflects downloads up to 24 Dec 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media