## Compilation and Equivalence of Imperative Objects (1998)

### Cached

### Download Links

- [www.cl.cam.ac.uk]
- [www.cl.cam.ac.uk]
- [ftp.cl.cam.ac.uk]
- [research.microsoft.com]
- [www.cl.cam.ac.uk]
- [www.brics.dk]
- DBLP

### Other Repositories/Bibliography

Citations: | 32 - 4 self |

### BibTeX

@MISC{Gordon98compilationand,

author = {Andrew D. Gordon and Paul D. Hankin and Søren B. Lassen},

title = {Compilation and Equivalence of Imperative Objects},

year = {1998}

}

### Years of Citing Articles

### OpenURL

### Abstract

We adopt the untyped imperative object calculus of Abadi and Cardelli as a minimal setting in which to study problems of compilation and program equivalence that arise when compiling objectoriented languages. We present both a big-step and a small-step substitution-based operational semantics for the calculus. Our rst two results are theorems asserting the equivalence of our substitutionbased semantics with a closure-based semantics like that given by Abadi and Cardelli. Our third result is a direct proof of the correctness of compilation to a stack-based abstract machine via a small-step decompilation algorithm. Our fourth result is that contextual equivalence of objects coincides with a form of Mason and Talcott's CIU equivalence; the latter provides a tractable means of establishing operational equivalences. Finally, we prove correct an algorithm, used in our prototype compiler, for statically resolving method osets. This is the rst study of correctness of an object-oriented abstract machine, and of operational equivalence for the imperative object calculus.

### Citations

1570 | The definition of Standard ML - Milner, Tofte, et al. - 1990 |

1288 | A Structural Approach to Operational Semantics - Plotkin - 1981 |

892 | A Theory of Objects
- Abadi, Cardelli
- 1996
(Show Context)
Citation Context ...us. Proposition 8. Suppose o = [` i = V(x i )b i i21::n ] and j 2 1::n. (1) o:` js(let x j = o in b j ) (2) (o:` j ( V(x)b)s[` i = V(x i )b i i21::j \Gamma1 ; ` j = V(x)b; ` i = V(x i )b i i2j+1::n ] =-=(3)-=- clone(o)so (4) (let x = o in R[clone(x)])s(let x = o in R[o]), if x = 2 fv(o) (5) (let x = o in b)sb, if x = 2 fv (b) (6) (let x = a in let y = o in b)s(let y = o in let x = a in b), if x = 2 fv(o) a... |

735 | Structure and Interpretation of Computer Programs - Abelson, Sussman - 1996 |

732 | Notions of computation and monads
- Moggi
- 1991
(Show Context)
Citation Context ...ce, it is possible to show a multitude of equational laws for the constructs of the calculus. For instance, the let construct satisfies laws corresponding to those of Moggi's computational - calculus =-=[19]-=-, presented here in the form given by Talcott [27]. Proposition 6. (1) (let x = y in b)sbff y =xgg (2) (let x = a in R[x])sR[a], if x = 2 fv (R) The effect of invoking a method that has just been upda... |

416 | A language with distributed scope - Cardelli - 1995 |

395 | LCF considered as a programming language - Plotkin - 1977 |

333 |
The mechanical evaluation of expressions
- Landin
- 1964
(Show Context)
Citation Context ...emantics would do alone; we include both for the sake of completeness. We do not present a small-step closure-based semantics for the imperative object calculus; this would amount to an SECD machine (=-=Landin 1964-=-) for the calculus. The next section, however, contains a small-step closure-based semantics for an object-oriented abstract machine to which we compile the object calculus. The technique used to prov... |

302 | Natural semantics - Kahn - 1987 |

222 | A foundation for actor computation
- Agha, Mason, et al.
- 1997
(Show Context)
Citation Context ...l theories for functional languages with state [14,18]. Agha, Mason, Smith and Talcott study contextual equivalence, but not CIU equivalence, for a concurrent object-oriented language based on actors =-=[5]-=-. Ours is the first development of CIU equivalence for an object-oriented language. Our experience is that existing techniques for functional languages with state scale up well to deal with the object... |

202 | A Basis for a Mathematical Theory of Computation
- McCarthy
- 1963
(Show Context)
Citation Context ...erational semantics, a style of mathematical description widely held to be particularly suited to language descriptions. In general, mathematical descriptions of computation have long been advocated (=-=McCarthy 1963-=-). Mathematics is neither necessary nor sufficient to achieve clarity, precision or consistency in a language description, but it does contribute to precision and it does allow properties to be proved... |

173 |
Call-by-name, call-by-value and the lambda-calculus
- Plotkin
- 1975
(Show Context)
Citation Context ...ccumulator. The correctness proof is similar to the one for the machine presented here. There is a large literature on proofs of interpreters based on abstract machines, such as Landin's SECD machine =-=[12,22,25]-=-. Since no compiled machine code is involved, unloading such abstract machines is easier than unloading an abstract machine based on compiled code. The VLISP project [11], using denotational semantics... |

153 |
The Java Virtual Machine Specification. The Java Series
- Lindholm, Yellin
- 1997
(Show Context)
Citation Context ...of Andersen and Pedersen [6]. In principle, we believe our compiler correctness proof would scale up to proving correctness of a Java compiler emitting instructions for the Java virtual machine (JVM) =-=[17]-=-. To carry this out would require formal descriptions of the operational semantics of Java, the JVM and the compiler. Due to the scale of the task, the proof would require machine support. Acknowledge... |

129 | The Design and Implementation of the SELF Compiler, an Optimlzing Compiler for Object- Oriented Progmmming Languages
- Chambers
- 1992
(Show Context)
Citation Context ...swamp the effect of optimisations such as this. It is likely to be more effective in a native code implementation. In general, there are many algorithms for optimising access to objects; see Chambers =-=[7]-=-, for instance, for examples and a literature survey. The idea of statically resolving labels to integer offsets is found also in the work of Ohori [21], who presents a -calculus with records and a po... |

128 | A logic of object-oriented programs
- Abadi, Leino
- 2003
(Show Context)
Citation Context ...ve object calculus, a topic left unexplored by Abadi and Cardelli's book. To the best of our knowledge, the only other work on the imperative object calculus is a program logic due to Abadi and Leino =-=[4]-=- and a brief presentation, without discussion of equivalence, of a labelled transition system for untyped imperative objects in the thesis of Andersen and Pedersen [6]. In principle, we believe our co... |

128 |
Lambda calculus models of programming languages
- Morris
- 1968
(Show Context)
Citation Context ...erative object calculus, based on the CIU equivalence of Mason and Talcott [18]. We establish useful equivalence laws and prove that CIU equivalence coincides with Morris-style contextual equivalence =-=[20]-=-. In Section 5, we exercise operational equivalence by specifying and verifying a simple optimisation that resolves at compile-time certain method labels to integer offsets. We discuss related work at... |

111 | Equivalence in functional languages with effects
- Mason, Talcott
- 1991
(Show Context)
Citation Context ...proof of Rittri [23] to cope with state and objects. In Section 4, we develop a theory of operational equivalence for the imperative object calculus, based on the CIU equivalence of Mason and Talcott =-=[18]-=-. We establish useful equivalence laws and prove that CIU equivalence coincides with Morris-style contextual equivalence [20]. In Section 5, we exercise operational equivalence by specifying and verif... |

110 | Operational reasoning in functions with local state - Pitts, Stark - 1998 |

105 |
Functional programming and Input/Output
- Gordon
- 1994
(Show Context)
Citation Context ... exercise compositional equational reasoning it is necessary that operational equivalence is preserved by arbitrary term constructs. This property can be formalised in terms of compatible refinement (=-=Gordon 1994-=-). Given a relation on terms S, its compatible refinement, b S, relates terms with identical outermost syntactic constructor and with immediate subterms pairwise related by S, as defined by the rules:... |

105 | Proving congruence of bisimulation in functional programming languages
- Howe
- 1996
(Show Context)
Citation Context ..., considering that the imperative object calculus is a higher-order, state-based language. Alternatively, it is possible to adapt Howe's general method for proving congruence of simulation orderings (=-=Howe 1996-=-) to CIU equivalence; see Gordon (1997) for an example of this for the stateless object calculus of Abadi and Cardelli (1996). Talcott (1997) presents another proof method based on a notion of uniform... |

98 | Towards fully abstract semantics for local variables: Preliminary report - Meyer, Sieber - 1988 |

92 |
The ZINC experiment: an economical implementation of the ML language
- Leroy
- 1990
(Show Context)
Citation Context ... may easily be re-used in an object-oriented setting. Our system compiles the imperative object calculus to bytecodes for an abstract machine, implemented in C, based on the ZAM of Leroy's CAML Light =-=[16]-=-. A type-checker enforces the system of primitive self types of Abadi and Cardelli. Since the results of the paper are independent of this type system, we will say no more about it. In Section 2 we pr... |

83 |
Control operators, the SECD machine and the -calculus
- Felleisen, Friedman
- 1986
(Show Context)
Citation Context ...ite maps, let the map f + (x 7! OE) be f 0 @[x 7! OE]@f 00 if f = f 0 @[x 7! /]@f 00 , otherwise (x 7! OE) :: f . Now we specify a small-step substitution-based operational semantics for the calculus =-=[8,18]-=-. Let a store, oe, be a finite map [' i 7! o i i21::n ] from locations to objects. Each stored object consists of a collection of labelled methods. The methods may be updated individually. Abadi and C... |

79 | A Concurrent Object Calculus: Reduction and Typing - Gordon, Hankin - 1998 |

67 | Deriving a lazy abstract machine
- Sestoft
- 1997
(Show Context)
Citation Context ...ccumulator. The correctness proof is similar to the one for the machine presented here. There is a large literature on proofs of interpreters based on abstract machines, such as Landin's SECD machine =-=[12,22,25]-=-. Since no compiled machine code is involved, unloading such abstract machines is easier than unloading an abstract machine based on compiled code. The VLISP project [11], using denotational semantics... |

58 | From operational semantics to abstract machines
- Hannan, Miller
- 1990
(Show Context)
Citation Context ...ccumulator. The correctness proof is similar to the one for the machine presented here. There is a large literature on proofs of interpreters based on abstract machines, such as Landin's SECD machine =-=[12,22,25]-=-. Since no compiled machine code is involved, unloading such abstract machines is easier than unloading an abstract machine based on compiled code. The VLISP project [11], using denotational semantics... |

57 | A compilation method for ml-style polymorphic record calculi
- Ohori
- 1992
(Show Context)
Citation Context ...s for optimising access to objects; see Chambers [7], for instance, for examples and a literature survey. The idea of statically resolving labels to integer offsets is found also in the work of Ohori =-=[21]-=-, who presents a -calculus with records and a polymorphic type system such that a compiler may compute integer offsets for all uses of record labels. Our system is rather different, in that it exploit... |

48 | A variable typed logic of effects
- Honsell, Mason, et al.
- 1995
(Show Context)
Citation Context ...o be a congruence. The following may be proved in several ways, most simply by an adaptation of the corresponding congruence proof for a -calculus with references by Honsell, Mason, Smith and Talcott =-=[14]-=-. Proposition 9. Operational equivalence is a congruence. From Proposition 9 it easily follows that operational equivalence coincides with Morris-style contextual equivalence. Let a term context, C, b... |

48 | Idealized Algol and its specification logic - Reynolds - 1982 |

43 | Bisimilarity for first-order calculus of objects with subtyping
- Gordon, Rees
- 1996
(Show Context)
Citation Context .... asa 0 if and only if for all term contexts C with locs(C) = ?, C[a] and C[a 0 ] are closed, that (C[a]; [])+ , (C[a 0 ]; [])+. Earlier studies of operational equivalence of stateless object calculi =-=[10,15,24]-=- rely on bisimulation equivalence. See Stark [26] for an account of the difficulties of defining bisimulation in the presence of imperative effects. The main influence on this section is the literatur... |

42 | Objects in the pi-calculus - Walker - 1995 |

40 | Accommodating Interference in the Formal Design of Concurrent Object-Based Programs
- Jones
- 1996
(Show Context)
Citation Context ...bjects too, but we have not explored these issues here in any depth. Several authors have studied operational equivalences for languages with concurrent objects (Agha, Mason, Smith, and Talcott 1997; =-=Jones 1995-=-; Walker 1995; Sangiorgi 1997), but the technique of CIU equivalence has yet to be recast in a concurrent setting. 5 Example: Static Resolution of Labels In Section 3 we showed how to compile the impe... |

39 | Imperative Objects and Mobile Processes - Kleist, Sangiorgi - 1998 |

38 | A syntactic theory of sequential state - Felleisen, Friedman - 1989 |

30 | References, local variables and operational reasoning - Mason, Talcott - 1992 |

26 | An imperative object calculus - Abadi, Cardelli - 1995 |

23 |
An Interpretation of Typed Objects into Typed -Calculus
- Sangiorgi
- 1998
(Show Context)
Citation Context .... asa 0 if and only if for all term contexts C with locs(C) = ?, C[a] and C[a 0 ] are closed, that (C[a]; [])+ , (C[a 0 ]; [])+. Earlier studies of operational equivalence of stateless object calculi =-=[10,15,24]-=- rely on bisimulation equivalence. See Stark [26] for an account of the difficulties of defining bisimulation in the presence of imperative effects. The main influence on this section is the literatur... |

23 | Operational equivalences for untyped and polymorphic object calculi - Gordon - 1998 |

23 | Functional runtime systems within the lambda–sigma calculus - Hardin, Maranget, et al. - 1998 |

22 | Semantical paradigms: notes for an invited lecture - Meyer, Cosmodakis - 1988 |

22 | Objects and classes in Algol-like languages - Reddy - 2002 |

19 |
An Imperative Object Calculus. Theory and Practice of Object Systems
- Abadi, Cardelli
- 1996
(Show Context)
Citation Context ...nd (ops ; E; AC;RS) u \Gamma! ([]; e 0 ; [a]; []). We can prove the following: Lemma 2. Whenever [] ` a ) ops then ((ops ; []; []; []); []) ; (a; []). Lemma 3. (1) If C ; c and C \Gamma! D then D ; c =-=(2)-=- If C ; c and C fi \Gamma! D then there is d such that D ; d and c ! d Let a big-step transition relation, C + D, on machine states hold if and only if there are '; E; \Sigma with D = (([]; E; [']; []... |

17 | An imperative object calculus - Abadi, Cardelli - 1995 |

13 | The VLISP Verified Scheme System
- Guttman, Swarup, et al.
- 1994
(Show Context)
Citation Context ...s Landin's SECD machine [12,22,25]. Since no compiled machine code is involved, unloading such abstract machines is easier than unloading an abstract machine based on compiled code. The VLISP project =-=[11]-=-, using denotational semantics as a metalanguage, is the most ambitious verification to date of a compiler-based abstract machine. Other work on compilers deploys metalanguages such as calculi of expl... |

13 | Reasoning about functions with effects
- Talcott
(Show Context)
Citation Context ...al laws for the constructs of the calculus. For instance, the let construct satisfies laws corresponding to those of Moggi's computational - calculus [19], presented here in the form given by Talcott =-=[27]-=-. Proposition 6. (1) (let x = y in b)sbff y =xgg (2) (let x = a in R[x])sR[a], if x = 2 fv (R) The effect of invoking a method that has just been updated is the same as running the method body of the ... |

12 | A type-theoretic account of Standard ML - Harper, Stone - 1996 |

11 | Objects as mobile processes
- Huttel, Kleist
- 1996
(Show Context)
Citation Context .... asa 0 if and only if for all term contexts C with locs(C) = ?, C[a] and C[a 0 ] are closed, that (C[a]; [])+ , (C[a 0 ]; [])+. Earlier studies of operational equivalence of stateless object calculi =-=[10,15,24]-=- rely on bisimulation equivalence. See Stark [26] for an account of the difficulties of defining bisimulation in the presence of imperative effects. The main influence on this section is the literatur... |

11 | Compiler correctness for parallel languages
- Wand
- 1995
(Show Context)
Citation Context ...guage, is the most ambitious verification to date of a compiler-based abstract machine. Other work on compilers deploys metalanguages such as calculi of explicit substitutions [13] or process calculi =-=[28]-=-. Rather than introduce a metalanguage, we prove correctness of our abstract machine directly from its operational semantics. We adopted Rittri's idea [23] of unloading a machine state to a term via a... |

11 | Higher Order Operational Techniques in Semantics - Gordon, Pitts, et al. - 1998 |

11 | Reasoning about object systems in VTLoE - Mason, Talcott - 1995 |