Elena Machkasova and Franklyn Turbak. A Computationally Sound Call-By-Value Module Calculus. Draft of a Boston University technical report that expands on [MT00], August 1, 2001.
In our multi-layer calculus, terms at one level serve as components of terms at the same or higher level. This leads to a notion of embedding : calculus X is embedded in calculus Y if calculus steps of X are preserved when wrapped in a context of Y. Two terms in X have the same meaning with respect to Y if they have the same observational outcome in all contexts of Y. In our framework, computational soundess of Y implies an observational soundness property: two terms that are equivalent in X have the same meaning with respect to Y. Thus, calculus-based transformations in one calculus are meaning preserving in any embedding calculus.
Our modules have both public and private components. We formalize the notion of privacy by identifying modules up to alpha-renaming of hidden (i.e., private) labels. Because of this identification, module linking can be defined without the need to resolve naming conflicts between the hidden labels of two modules. In addition to alpha-renaming at the core module level, we also formalize alpha-renaming in namespaces at the term and linking levels of our calculus. This is important, because many properties of our module calculus hold only for alpha-equivalence classes of terms and not for concrete terms.
A particularly important domain for module transformations is link-time compilation, where many optimization opportunities are not apparent until two modules are linked together. We present a simple model of link-time compilation and introduce the weak distributivity property for a meaning-preserving transformation T operating on modules D1 and D2 linked by +: T(D1 + D2) = T(T(D1) + T(D2)). We argue that this property finds promising candidates for link-time optimizations, and present simple conditions that imply weak distributivity. We use these to demonstrate that some meaning preserving module transformations are weakly distributive.
This reports expands upon our earlier work reported in [MT00]. We make several corrections to the earlier work, the most important of which concerns the rule for garbage collection at the core module level. Our rigorus treatment of alpha renaming in this report allows us to improve the treatment of several linking operations and simplify the characterization of term behavior.