Type systems currently available for imperative languages are two 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.
CITATION STYLE
Fradet, P., & Le Metayer, D. (1997). Shape types. In Conference Record of the Annual ACM Symposium on Principles of Programming Languages (pp. 27–39). ACM. https://doi.org/10.1145/263699.263706
Mendeley helps you to discover research relevant for your work.