ACM Home Page
Please provide us with feedback. Feedback
Binding-time analysis and the taming of C pointers
Source ACM/SIGPLAN Workshop Partial Evaluation and Semantics-Based Program Manipulation archive
Proceedings of the 1993 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation table of contents
Copenhagen, Denmark
Pages: 47 - 58  
Year of Publication: 1993
ISBN:0-89791-594-1
Author
Sponsor
SIGPLAN: ACM Special Interest Group on Programming Languages
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): n/a,   Downloads (12 Months): n/a,   Citation Count: 6
Additional Information:

abstract   cited by   index terms  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/154630.154636
What is a DOI?

ABSTRACT

The aim of binding-time analysis is to determine when variables, expressions, statements, etc. in a program can be evaluated by classifying these into static (compile-time) and dynamic (run-time). Explicit separation of binding times has turned out to be crucial for successful self-application of partial evaluators, and apparently, it is also an important stepping-stone for profitable specialization of imperative languages with pointers and dynamic memory allocation. In this paper we present an automatic binding-time analysis for a substantial subset of the C language. The paper has two parts. In the first part, the semantic issues of binding-time separation is discussed with emphasis on pointers and classification of these. This leads to the introduction of a two-level C language where binding times are explicit in the syntax. Finally, well-annotatedness rules are given which excludes non-consistently annotated programs. In the second part, an automatic binding-time analysis based on constraint system solving is developed. The constraints capture the binding-time dependencies between expressions and subexpressions, and a solution to the system gives the binding times of all variables and expressions. We give rules for the generation of constraints, provide normalization rules, and describe how a solution can be found. Given the binding times of expressions, a well-annotated two-level version of the program can easily be constructed. A two-level program can e.g. be input to an offline partial evaluator.