Coinductive Techniques for Operational Equivalence of Interaction Nets Maribel Fern´ andez LIENS (CNRS URA 1327) ´ Ecole Normale Sup´ erieure 45 Rue d’Ulm, 75005 Paris, France maribel@dmi.ens.fr Ian Mackie CNRS-LIX (UMR 7650) ´ Ecole Polytechnique 91128 Palaiseau Cedex, France mackie@lix.polytechnique.fr Abstract In this paper we study a notion of operational equiva- lence for interaction nets, following the recent success of applying methods based on bisimulation to functional and object oriented programming languages. We set up notions of contextual equivalence and bisimilarity and show that they coincide. A coinduction principle then gives a sim- ple and robust way of showing when two interaction nets are contextually equivalent. We include several examples to demonstrate the usefulness of the approach, in particular for optimizing interaction nets. 1 Introduction One of the most fundamental notions in programming languages is that of program equivalence: when can one program fragment be replaced by another. A notion of equivalence should be substitutive so that programs remain equivalent in all contexts. Amongst other applications, this facilitates proving properties of programs, and gives a sound basis for program optimization. Interaction nets provide an interesting new perspective as both a programming paradigm [9] and an intermediate lan- guage for the implementation of other paradigms [5, 12, 4]. Their key feature is that all the operations—in particular copying and discarding of data—are explicit, thus modeling the main computational content of any program. Although quite a substantial theory of interaction nets has been de- veloped in the literature, no operational account exists until now (concerning evaluation strategies, notions of canonical forms, etc.) and no general notion of net equivalence has emerged. The purpose of this paper is to develop an opera- tional theory of interaction nets, and to give a clear notion of net equivalence to fill this basic gap. An important appli- cation of this new theory is the optimization of the imple- mentation of the various programming paradigms coded as interaction nets. Our aim is to define a notion of operational equivalence for interaction nets, and an associated proof technique (nets may be cyclic structures coding infinite terms for exam- ple, so there is no hope of proofs by structural induction). We consider typed interaction nets (built with a specific discipline), and set up a theory of contextual equivalence that captures the natural operational equivalence on nets: two nets are equivalent unless there is a context that dis- tinguishes them. As a first step towards the definition of contextual equivalence we define an evaluation algorithm, using a “lazy” evaluation strategy which allows us to define equivalence also for nets that do not have a normal form. To facilitate the proofs of contextual equivalence, we define an associated notion of bisimulation. This technique was first used for process calculi [14], and more recently for func- tional [8, 15, 6] and object oriented [7] languages. In all these works, it has become evident that proving contextual equivalence is highly non-trivial, whereas proving bisimi- larity is much easier thanks to a coinduction principle—all the effort is done once and for all in proving the equivalence between the two notions. We show that bisimilarity and contextual equivalence co- incide if the interaction net system is complete, a notion in- troduced by Howe [8] for functional languages, which we adapt to the interaction net framework: an interaction net system is complete if there are enough agents in the signa- ture to observe all the nets in the system. As a consequence of this result, we can use coinductive techniques to show equivalences of nets; several examples of application are given in the paper. In particular we show that the equational theory induced by the program ( i.e., the equalities derived by conversion using the interaction rules in the program) is included in our notion of equivalence. The interest of our proof method based on coinduction is that it also allows us to prove equivalences of nets that do not have a normal form or that have different normal forms—the equational theory is strictly included. In addition we remark that interaction nets can code higher-order systems such as proof nets and the -calculus, thus the techniques that we give here could 1