A Computationally Sound Call-By-Value Module Calculus

نویسندگان

  • Elena Machkasova
  • Franklyn A. Turbak
چکیده

We present a call-by-value module calculus that serves as a framework for formal reasoning about simple module transformations. The calculus is stratified into three levels: a term calculus, a core module calculus, and a linking calculus. At each level, we define both a calculus reduction relation and a small-step operational semantics and relate them by a computational soundness property: if two terms are equivalent in the calculus, then they have the same observable outcome in the operational semantics. This result is interesting because recursive module bindings thwart confluence at two levels of our calculus and prohibit application of the traditional technique for showing computational soundness, which requires confluence (in addition to other properties, the most important being standardization). We show that it is sufficient to replace confluence by a weaker property that we call confluence with respect to evaluation. We introduce a new technique for proving computational soundness based on a pair of related properties that we call lift and project. The project property, under certain conditions, implies confluence with respect to evaluation, while the lift property is equivalent to standardization. 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.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Sound and Complete Axiomatisations of Call-by-Value Control Operators

We formulate a typed version of call-by-value-calculus containing variants of Felleisen's control operators A and C which provide explicit access to continuations and logically extend the propositions-as-types correspondence to classical propositional logic. We give an equational theory for this calculus which is shown to be sound and complete with respect to to a class of categorical models ba...

متن کامل

Applicative Bisimilarities for Call-by-Name and Call-by-Value λμ-Calculus

We propose the first sound and complete bisimilarities for the call-by-name and call-by-value untyped λμcalculus, defined in the applicative style. We give equivalence examples to illustrate how our relations can be used; in particular, we prove David and Py’s counter-example, which cannot be proved with Lassen’s preexisting normal form bisimilarities for the λμ-calculus.

متن کامل

Applicative May- and Should-Simulation in the Call-by-Value Lambda Calculus with AMB

Motivated by the question whether sound and expressive applicative similarities for program calculi with should-convergence exist, this paper investigates expressive applicative similarities for the untyped call-by-value lambda-calculus extended with McCarthy’s ambiguous choice operator amb. Soundness of the applicative similarities w.r.t. contextual equivalence based on mayand should-convergen...

متن کامل

Proving Soundness of Extensional Normal-Form Bisimilarities

Normal-form bisimilarity is a simple, easy-to-use behavioral equivalence that relates terms in lambda-calculi by decomposing their normal forms into bisimilar subterms. Besides, they allow for powerful up-to techniques, such as bisimulation up to context, which simplify bisimulation proofs even further. However, proving soundness of these relations becomes complicated in the presence of eta-exp...

متن کامل

Call - by - need splits the mode !

We present a separated-linear lambda calculus based on a reenement of linear logic which allows separate control of weakening and contraction. The calculus satisses subject reduction and connuence, has a straightforward notion of standard evaluation, and inherits previous results on the relationship of Girard's two translations from minimal intuitionistic logic to linear logic with call-by-name...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2001