Interaction Combinators

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

Information and Computation  IC2643

information and computation 137, 69101 (1997)


article no. IC972643

Interaction Combinators
View metadata, citation and similar papers at core.ac.uk brought to you by CORE
provided by Elsevier - Publisher Connector
Yves Lafont*
Institut de Mathematiques de Luminy, UPR 9016 du CNRS,
163 avenue de Luminy, case 930, 13288 Marseille Cedex 9, France
E-mail: lafontiml.univ-mrs.fr

It is shown that a very simple system of interaction combinators, with


only three symbols and six rules, is a universal model of distributed com-
putation, in a sense that will be made precise. This paper is the continua-
tion of the author's work on interaction nets, inspired by Girard's proof
nets for linear logic, but no preliminary knowledge of these topics is
required for its reading. ] 1997 Academic Press

INTRODUCTION

This paper addresses the following question: what are the fundamental laws of
computation? Of course, the answer depends on the choice of a particular model
of computation. Let us mention some of them:

v Turing machines imitate the mathematician writing symbols on paper. There


are many variants, for instance register machines and stack machines. This notion
has the advantage of being simple and powerful at the same time, but it models
only sequential computation.
v Cellular automata can be seen as discrete approximations of physical
processes. This notion models distributed computation, but with a global synchro-
nization of transitions.
v Rewrite systems are closer to the algebraic tradition, since a rewrite rule is
just an oriented equation. An interesting example is the *-calculus, with only one
rewrite rule:

(*x . u)v  v[ux].

This calculus is Turing complete and it has a nice logical interpretation, at least in
the typed case. However, the rule is more complicated than it seems: is it reasonable

* Partially supported by HCM Project CHRX-CT93-0046 (Lambda Calcul Type ).

69 0890-540197 25.00
Copyright  1997 by Academic Press
All rights of reproduction in any form reserved.

File: 643J 264301 . By:DS . Date:06:08:01 . Time:09:33 LOP8M. V8.0. Page 01:01
Codes: 3658 Signs: 1886 . Length: 58 pic 2 pts, 245 mm
70 YVES LAFONT

to consider substitution as an atomic operation? In this sense, a more primitive


system is combinatory logic, with two rewrite rules:

Kxy  x, Sxyz  xz( yz).

But again, is it reasonable to consider erasing and duplication as atomic operations?


Following this tradition of rewrite systems, interaction nets were introduced
in [Laf 90] as a model of distributed computation with local synchronization
(Section 1). These nets, which are related to the connection graphs of [Baw86],
appeared as a generalization of Girard's proof nets for linear logic (see [Gir95,
Laf95]).
By ``local synchronization,'' we mean that there is no need to consider a global
time for computation. In other words, time is relativistic. By ``distributed,'' we mean
that the computation is performed at several places at the same time, whereas
``parallel'' sometimes refers to a kind of magical superposition, as in ``parallel or:''

T 6 x  T, x 6 T  T, F 6 F  F.

Our interaction nets are deterministic in a strong sense: not only the result, but also
the computation is unique, up to trivial commutations. In particular, it is not
possible to encode ``parallel or.'' We shall not address the question of deciding
whether this should be considered as a good or a bad point.
From the viewpoint of computability, our interaction nets are equivalent to the
Turing machines, but from the viewpoint of computation, there is something more,
for instance parallelism (in the sense of distributed computation). To express this
rigorously, we introduce a natural notion of translation of interaction system
preserving the essential properties of computations, such as the complexity and the
degree of parallelism.
By definition, a universal interaction system has the property that any other inter-
action system can be translated into it. Turing machines can be seen as particular
interaction systems, but such systems are intrinsically sequential and cannot be
universal in the above sense, even if they come from universal Turing machines. On
the other hand, it is proved that a system of interaction combinators is universal
(Section 2). This suggests an answer to our original question, at least within the
framework of interaction nets: the fundamental laws of computation are commutation
and annihilation.
Our system of interaction combinators has been obtained by a kind of distilla-
tion, starting from some more complicated system suggested by Samson Abramsky
for implementing the proof boxes of linear logic (see [Mac94]). Independently,
Simon Gay has also obtained a universal system, with eight symbols instead of
three (see [Gay95]). Our system is simpler because it uses the same symbols for
different purposes. Among the other related systems, let us mention the infinite one
introduced by John Lamping for the optimal reduction of *-calculus (see [Lam90])
and the variants proposed by Georges Gonthier, Martin Abadi, and Jean-Jacques
Levy, in connection with linear logic (see [GAL92a, GAL92b]).

File: 643J 264302 . By:DS . Date:06:08:01 . Time:09:33 LOP8M. V8.0. Page 01:01
Codes: 3516 Signs: 2966 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 71

Apart from its simplicity, the system of interaction combinators has an unexpected
interpretation in terms of reversible 2-stack machines which seems to throw a bridge
between distributed and sequential computation (Section 3). This section benefited
from discussions with Vincent Danos and Laurent Regnier.

1. INTERACTION NETS

The origin of our favorite model of computation is explained in [Laf 95]. Here,
it is introduced from scratch, without explicit reference to proof theory.

1.1. Nets
From now on, a symbol : will always be given with its arity n0. An occurrence
of such a symbol is called a cell, and is pictured as follows:

Such a cell has one principal port and n auxiliary ports. It is well understood that
the latter are not interchangeable. For instance, one can number them from 1 to n,
keeping 0 for the principal port. In practice, the ports will always be implicitly
numbered in clockwise order. In particular, the second picture is obtained from the
first one by a rotation of 180%. If n=0, there is no auxiliary port, and the cell is
pictured as follows:

A net is a graph consisting of a finite number of cells and an extra set of free
ports, each port being connected to another one by means of a wire. For instance,
here is a net built with the symbols :, ;, and #, of respective arities 2, 1, and 0:

This net has three free ports, x, y, and z. Note that a net is not necessarily connected,
and that a wire may connect two ports of the same cell. In fact, we shall also allow
cyclic wires which do not connect any ports:

File: 643J 264303 . By:XX . Date:04:08:01 . Time:10:03 LOP8M. V8.0. Page 01:01
Codes: 2573 Signs: 1556 . Length: 52 pic 10 pts, 222 mm
72 YVES LAFONT

To sum up, a net is completely described by the following data:

v a finite set X (of free ports),


v a finite set C (of cells),
v a symbol l(c) for each c # C,
v a finite set W (of wires),
v a set w of 0 or 2 ports for each w # W.

Here, a port is either an element of X, or a pair (c, i) where c # C and i ranges from
0 to the arity of l(c). The nonempty w must define a partition of all ports. In this
paper, we shall avoid such cumbersome descriptions, but the reader may check that
our arguments can always be formalized in this way.
If : is a symbol of arity n, an :-cell can be seen as a net with n+1 free ports.
More generally, a tree is a net { with one distinguished free port, called the root.
It is either a single wire, in which case the root is fixed arbitrarily, or it is obtained
by plugging the n auxiliary ports of a cell into the roots of smaller trees { 1 , ..., { n :

In that case, the root is the free port which is connected to the principal port of this
cell.
A wiring is a net | without cell and without cyclic wire. So it is just a pairing
of its free ports. In particular, a wiring has an even number of free ports. A per-
mutation _ of [1, ..., n] defines a wiring with 2n free ports, which is represented as
follows:

In both cases, x i is connected to y _(i) . For instance, the wiring corresponding to the
identity on [1, 2, 3] is pictured as follows:

File: 643J 264304 . By:XX . Date:04:08:01 . Time:10:06 LOP8M. V8.0. Page 01:01
Codes: 2231 Signs: 1356 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 73

1. 2. Interaction
Fix a finite alphabet 7 with m symbols : 1 , ..., : m of respective arities n 1 , ..., n m .
An interaction rule is a reduction of the form

where & i, j is a net with n i +n j free ports. Note that cells can only interact pairwise,
through their principal ports. Cyclic wires may be created when such a rule is
applied inside a net, and this is why they have been allowed in the definition of nets.
The above rule is clearly equivalent to

where & ij , is obtained by exchanging the n i first free ports with the n j last ones
in & i, j .
An interaction system is a set of interaction rules which can be applied without
any ambiguity. More precisely:
v if a rule is given for : i , : j , then no other rule is given for : i , : j , or for : j , : i ;
v if a symbol : i interacts with itself 1 then & i, i =& i, i .
In particular, an interaction system is necessarily finite, with at most m(m+1)2
rules. Alternatively, such a system can be described by a partially defined square
matrix (& i, j ) 1i, jm satisfying the following symmetry condition:
v if & i, j is defined, so is & j, i , and & j, i =& i, j .
Later we shall add the technical condition that the & i, j are reduced nets.
Proposition 1. If a net + reduces in one step to & and to &$, with &{&$, then &
and &$ reduce in one step to a common !:

Proof. In an instance of the left member of a rule, the cells are connected
through their principal ports, so that two such instances are necessarily disjoint and
the corresponding rules can be applied independently. Q.E.D.
This strong confluence property has the following consequence: if a net + reduces
to an irreducible net & in n steps, then any reduction starting from + eventually
1
In [Laf 90], symbols were not allowed to interact with themselves, but it appeared later that this was
too restrictive.

File: 643J 264305 . By:XX . Date:04:08:01 . Time:10:07 LOP8M. V8.0. Page 01:01
Codes: 3049 Signs: 1778 . Length: 52 pic 10 pts, 222 mm
74 YVES LAFONT

reaches & in n steps. Moreover, if one abstracts from the irrelevant order of applica-
tion of rules, there is only one possible reduction from + to &. So we can say that
interaction nets are a deterministic and asynchronous model of computation. In
fact, we think that any computation of that kind can be modeled by means of inter-
action nets, but of course, an assertion of this kind cannot be proved.

1. 3. Example: Turing Machines

Classical models of sequential computation such as Turing machines, register


machines and stack machines can be seen as special classes of interaction systems.
For instance, a Turing machine is given by a triple (Q, A, T ), where Q is a finite
set of states, A a finite set of letters, and T a (partially defined) map from Q_A
to A_[+, &]_Q. A configuration of the machine is given by a state q, an infinite
tape filled with letters, and a current position in the tape:

If T(q, a)=(a$, +, q$), and being in state q, the machine reads a from the tape, then
it writes a$, moves right, and goes to state q$:

If T(q, a)=(a$, &, q$), the machine has the same behavior, except that it moves left.
By doubling the number of states, one can always assume that the direction of the
move depends only on q$. One says that q$ comes from the left in the first case, and
that it comes from the right in the second case.
All states and letters are now considered as symbols of arity 1. The above
configuration is simulated by the net

depending on whether q comes from the left or from the right. Similarly, the above
transition is simulated by the rule

File: 643J 264306 . By:XX . Date:04:08:01 . Time:10:08 LOP8M. V8.0. Page 01:01
Codes: 2395 Signs: 1570 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 75

depending on whether q comes from the left or from the right. Of course, all this
assumes that we have an infinite net! To simulate computations with a finite net,
one must add a new symbol of arity 0 corresponding to the boundary of (the
written part of) the tape, and some appropriate rules to cope with this new symbol.
The details are left to the reader.
So it appears that interaction nets are complete from the viewpoint of computa-
bility. Similarly, the register machines and the stack machines can be simulated in
a fairly obvious way.

1.4. Example: Cellular Automata


More surprisingly, the cellular automata, which are a synchronous model of
distributed computation, can also be simulated by means of interaction nets. For
instance, a 1-dimensional cellular automaton is given by a pair (Q, T), where Q is
a finite set of states and T is a map from Q_Q_Q to Q. A configuration of the
automaton is given by an infinite sequence of states:

After one step of computation, it becomes

where q$i =T(q i&1 , q i , q i+1 ). In particular, this means that all cells change at the
same time.
Two symbols q and q are introduced for each state q, and also two symbols pq
and pq for each pair p, q. The above configuration is simulated by

and the transitions by

File: 643J 264307 . By:XX . Date:07:08:01 . Time:05:29 LOP8M. V8.0. Page 01:01
Codes: 2355 Signs: 1267 . Length: 52 pic 10 pts, 222 mm
76 YVES LAFONT

where q$=T( p, q, r) and r$=T(q, r, s). This simply means that a transition is
decomposed into two steps: each cell interacts first with its left (or right) neighbor,
and then with the other one. In this way, the global synchronization is no more
needed.
The main difference between the system for Turing machines and the one for
cellular automata appears in the structure of the right members of rules: in the first
case, only one free port is connected to a principal port, whereas in the second case,
both free ports are connected to principal ports. In fact, a system of the first kind
can only model sequential computation.

1.5. Example: Unary Arithmetics

Now we shall build a simple interaction system for unary arithmetics, using the
following symbols: s (successor) of arity 1, 0 of arity 0, + and _, both of arity 2.
The first two symbols are used to represent natural numbers in unary form. One
starts from the usual equations defining addition and multiplication:

sx+ y=s(x+ y), 0+y= y,

sx_y=(x+ y)+ y, 0_y=0.

Since addition is defined by induction on the first argument, we shall always plug
this argument into the principal port of +, and similarly for _. Therefore, the
ports will be interpreted in the following unusual way:

One gets the following rules for addition:

Note that the argument y is used twice in the first equation defining the multiplication,
and it is not used at all in the second one. For that reason, two extra symbols are
needed, $ (duplicator) of arity 2 and = (eraser) of arity 0, with the following inter-
pretation:

File: 643J 264308 . By:XX . Date:04:08:01 . Time:10:09 LOP8M. V8.0. Page 01:01
Codes: 2529 Signs: 1547 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 77

The idea is that a net representing a natural number should be duplicated when it is
connected to the principal port of a $, and it should be erased when it is connected
to the principal port of an =. One gets the following rules for multiplication:

Of course, extra rules are needed for duplication and erasing:

An example of computation is given in Fig. 1. Note that this computation is essen-


tially parallel, since in many cases, several rules can be applied simultaneously.
If one had to duplicate tree-like structures, such as lists of natural numbers, then
one would introduce the following rules for each binary constructor #:

We shall find them again in the system of interaction combinators.

1.6. Reduced Nets

Two kinds of configuration may lock a computation: irreducible cuts and vicious
circles. A cut consists of two cells connected through their principal ports:

For a given interaction system, there are two kinds of cuts: the reducible ones and
the irreducible ones. For instance, in the case of unary arithmetics, a cut between

File: 643J 264309 . By:XX . Date:04:08:01 . Time:10:12 LOP8M. V8.0. Page 01:01
Codes: 2031 Signs: 1058 . Length: 52 pic 10 pts, 222 mm
78 YVES LAFONT

FIG. 1. 2_2=4.

s and + is reducible, whereas a cut between s and 0 is irreducible. If an irreducible


cut occurs in a net &, it can never be eliminated, because the cells can only interact
through their principal ports.
A principal path of length n consists of n cells c 1 , ..., c n such that the principal
port of c i is connected to an auxiliary port of c i+1 . In particular, a wire can be

File: 643J 264310 . By:XX . Date:04:08:01 . Time:10:12 LOP8M. V8.0. Page 01:01
Codes: 795 Signs: 396 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 79

considered as a principal path of length 0. A vicious circle of length n is a closed


principal path of length n:

In particular, a cyclic wire can be considered as a vicious circle of length 0. Clearly,


a vicious circle can never be eliminated, because no c i can interact first.
Say that a net is reduced if it contains no cut and no vicious circle. Trees and
wirings are typical examples of reduced nets. An irreducible net is not necessarily
reduced, since it may contain irreducible cuts or vicious circles, but a reduced net
is always irreducible.
Note that in the case of unary arithmetics, for instance, all right members of rules
are reduced nets. From now on, we shall only consider interaction systems satis-
fying this extra condition. If it is not the case, one can always try to reduce the right
members. If this does not work, it means that there is something wrong in the
system.
Proposition 2. Any reduced net & with n free ports can be uniquely decomposed
as follows,

where { 1 , ..., { n are trees and | is a wiring.


Proof. By induction on the number of cells. If there is no cell, then & is a wiring.
Otherwise, one can choose a cell c 1 , and construct a principal path c 1 , c 2 , c 3 , ...
Since there is no cut and no vicious circle, this path must stop at some cell c n whose
principal port is connected to a free port. It suffices to apply the induction
hypothesis to the net obtained by removing this c n , which is also a reduced net.
Q.E.D.
One says that a reduced net is principal if it is a single wire (degenerate case), or
if one of its free ports is connected to a principal port and all other free ports are
connected to auxiliary ports. For instance, a tree is a principal net. Proposition 2
gives the following decomposition for a principal net ?,

where { is a tree and | is a wiring which does not connect upper ports. If ? has
n+1 ports, one says that ? is a principal net of arity n, because it can be considered

File: 643J 264311 . By:XX . Date:04:08:01 . Time:10:13 LOP8M. V8.0. Page 01:01
Codes: 2788 Signs: 1944 . Length: 52 pic 10 pts, 222 mm
80 YVES LAFONT

as a generalized symbol of arity n. In the non-degenerate case, the free port which
is connected to a principal port is called the root of ?. In the degenerate case, the
choice of the root is arbitrary. We shall need a result which follows easily from the
above decomposition:

Lemma 1. Let ? be a principal net with n+1 free ports x 0 , x 1 , ..., x n , the root
being x 0 . Then, for i=1, ..., n, there is a unique principal path from x i to x 0 . Except
in the degenerate case, there is no other principal path between free ports.

By Proposition 2, a reduced net with no free port is necessarily empty. A reduced


net with only one free port is called a package. Such a net is necessarily principal,
with the following decomposition,

where { is a tree and | is a wiring.

1.7. Translations

Let 7 and 7$ be alphabets of symbols with arities. A translation 8 of 7 into 7$


maps each symbol : of arity n in 7 to a principal net 8(:) of arity n, built with
symbols of 7$. If furthermore, this 8(:) is non-degenerate for every :, one says that
8 is strict. A translation extends to nets in an obvious way. Just notice that, in the
non-strict case, the translation may create cyclic wires, and this is another reason
why cyclic wires have been allowed in the definition of nets. The fact that the 8(:)
are principal has the following consequence:

Proposition 3. If & is a reduced net, when 8(&) is a reduced net. The converse
holds if 8 strict.

Proof. It suffices to check the following points:

v if 8(&) contains a cut, so does &;


v if 8 is strict and & contains a cut, so does 8(&);
v if 8(&) contains a vicious circle, then & contains a vicious circle or a cut;
v if & contains a vicious circle, so does 8(&).

Lemma 1 is used for the last two statements. One simply has to be careful in the
non-strict case. For instance, it may happen that 8(&) contains a vicious circle, and
& contains no vicious circle, but a cut. It may also happen that & contains a cut, and
8(&) is reduced. Q.E.D.

Composition of translations is defined in the obvious way. One says that 8 is


invertible if there is a translation 8 &1 of 7$ into 7 such that 8 &1 b 8=id 7 and

File: 643J 264312 . By:XX . Date:04:08:01 . Time:10:13 LOP8M. V8.0. Page 01:01
Codes: 2943 Signs: 2110 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 81

8 b 8 &1 =id 7$ . In that case, it is easy to see that each 8(:) is necessarily of the
following form,

where :$ is a symbol of 7$ and _ is a permutation. In other words, 8 is given by


a renaming of the symbols and a permutation of the auxiliary ports of each symbol.
Assume that some interaction system is given for 7 and similarly for 7$. One says
that 8 is a translation of interaction system if it is compatible with reduction. This
is expressed by the following property:

The * stands for a reduction of arbitrary length, possibly 0. Remember that & i, j
is supposed to be reduced, and so is 8(& i, j ) by Proposition 3. Therefore, if 8 is
strict, the left member is not reduced, and the reduction cannot be of length 0.
Similarly, if 8 is invertible, the reduction must be of length 1. In general, let L
(resp. M) be the minimal (resp. the maximal) length of all those reductions. By the
above remark, L>0 if 8 is strict, and L=M=1 if 8 is invertible. Obviously, one
has:

Proposition 4. If + is a net built with symbols of 7 which reduces in n steps


to &, then 8(+) reduces in n$ steps to 8(&), with Lnn$Mn.

2. INTERACTION COMBINATORS

This section is the heart of the paper. It is entirely devoted to the universality of
the system of interaction combinators.

FIG. 2. Interaction rules for the combinators.

File: 643J 264313 . By:XX . Date:04:08:01 . Time:10:16 LOP8M. V8.0. Page 01:01
Codes: 2136 Signs: 1318 . Length: 52 pic 10 pts, 222 mm
82 YVES LAFONT

FIG. 3. A nonterminating computation.

2.1. The System


The system of interaction combinators consists of three symbols, called com-
binators: # (constructor) and $ (duplicator) of arity 2, and = (eraser) of arity 0. The
six interaction rules (Fig. 2) are of two kinds: commutation when the two cells carry
different symbols (#$, #=, $=) and annihilation when they carry the same symbol
(##, $$, ==). The reader can check that the symmetry condition is satisfied.
Note that the annihilations for # and $ are not the same. Furthermore, if one
numbers the auxiliary ports, one realizes that it is ##, not $$, which exchanges the
ports:

One can already notice that the process of reduction does not always terminate.
Figure 3 shows a net which reduces to itself in four steps. In fact, we shall prove
that, despite its simplicity, this system is universal in the following sense:
Theorem 1. Any interaction system can be translated into the system of inter-
action combinators.
In order to prove this, we shall introduce several constructions which are inspired
by the rules of linear logic: the multiplexors and the transpositors (inspired by the
multiplicative rules), the menus and the selectors (inspired by the additive rules),
and the codes, the copiers, and the decoder (inspired by the exponential rules).

2.2. Multiplexors and Transpositors


For any n # N, one constructs two principal nets M n and M n* (multiplexors) of
arity n, with the following property:

File: 643J 264314 . By:XX . Date:04:08:01 . Time:10:17 LOP8M. V8.0. Page 01:01
Codes: 2379 Signs: 1455 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 83

FIG. 4. Implementation of the multiplexors.

An implementation of these multiplexors is given in Fig. 4. The needed rules are ##


and ==. There is an alternative implementation using $ instead of #, but in fact, it
will be essential that our implementation of the multiplexors does not use $.
We shall also need a kind of autodual multiplexor, that is a principal net T n of
arity n with the following property:

An implementation of these autodual multiplexors is given in Fig. 5. The needed


rules are $$ and ==. Note that # is not suitable for that purpose.
More generally, if p, q # N, one constructs a principal net T p, q (transpositor) of
arity 2p+q with the following property,

where @ p, q is the involutive permutation of [1, ..., 2p+q] which exchanges 1 with
2, 3 with 4, and so on until 2p. Here is a possible implementation of these
transpositors:

The needed rule is ##. Note that $ is not suitable for that purpose.

FIG. 5. Implementation of the autodual multiplexors.

File: 643J 264315 . By:XX . Date:04:08:01 . Time:10:19 LOP8M. V8.0. Page 01:01
Codes: 1933 Signs: 981 . Length: 52 pic 10 pts, 222 mm
84 YVES LAFONT

Finally, if _ is an involutive permutation of [1, ..., n], one constructs a principal


net T _ of arity n with the following property:

Any such permutation is indeed a product of disjoint transpositions; that is,


_=\ &1 b @ p, q b \, where \ is a permutation of [1, ..., n] and 2p+q=n. So here is a
possible implementation of T _ :

Note that conversely, if such a T _ exists, the permutation _ is necessarily involutive.


This is a consequence of the symmetry condition.

2.3. Menus and Selectors


If ? 1 , ..., ? n are packages, one constructs a new package ? 1 6 } } } 6 ? n (menu)
from which the original ones can be extracted by means of principal nets S 1n , ..., S nn
(selectors) of arity 1:

Here is a possible implementation:

One uses the fact any package ? can be erased as follows:

File: 643J 264316 . By:XX . Date:04:08:01 . Time:10:20 LOP8M. V8.0. Page 01:01
Codes: 1895 Signs: 759 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 85

This is an obvious corollary of the following lemma:


Lemma 2 (Erasing).
(i) For any tree {:

(ii) For any wiring |:

Both statements are proved by induction, using #=, $=, and ==. In fact, (i) holds
more generally for principal nets and (ii) for reduced nets.

2.4. Translation (Restricted Case)


With the previous constructions, we can already simulate interaction systems
which are in some sense recursion-free. Consider an interaction system with m
symbols : 1 , ..., : m of respective arities n 1 , ..., n m . The right member of a rule is a
reduced net which can be decomposed as follows,

where . i, j and  i, j are reduced nets, and _ i, j is a permutation. Of course, such a


decomposition is not unique, but there is a canonical one. For instance, here is the
canonical decomposition for the rule s_of Section 1.5:

By the symmetry condition, and by uniqueness of the canonical decomposition, one


gets . j, i = i, j and _ j, i =_ &1 &1
i, j . In particular, if i= j, one gets _ i, i =_ i, i , which
means that _ i, i is involutive. If i{ j, it is always possible to include the permutation
into . i, j (or into . j, i ), so that the decomposition is no longer canonical, but _ i, j is

File: 643J 264317 . By:XX . Date:04:08:01 . Time:10:21 LOP8M. V8.0. Page 01:01
Codes: 2249 Signs: 1156 . Length: 52 pic 10 pts, 222 mm
86 YVES LAFONT

FIG. 6. Translation of a cell (restricted case).

an identity. To sum up, one can assume that in all cases, . j, i = i, j , _ j, i =_ i, j , and
_ i, j is involutive.
Now, assume that the alphabet [: 1 , ..., : m ] can be ordered in such a way that the
net . i, j , when defined, contains only symbols which are strictly smaller than : j (and
symmetrically,  i, j =. j, i contains only symbols which are strictly smaller than : i ).
It is easy to see that the process of reduction always terminates in such a system.

FIG. 7. Translation of a rule (restricted case).

File: 643J 264318 . By:XX . Date:04:08:01 . Time:10:21 LOP8M. V8.0. Page 01:01
Codes: 1080 Signs: 541 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 87

A typical example is our system of interaction combinators without the rule #$


(using an ordering such that =<# and =<$, and a non-canonical decomposition for
#= and $=).
With this restriction, a principal net [: i ] can be defined inductively for each symbol
: i as in Fig. 6. In this definition, [. i, j ] stands for the net obtained by replacing each
: k by [: k ] in . i, j . If . i, j happens to be undefined, which means that there is no
rule for : i , : j , then 1i, j can be fixed arbitrarily. In that way, one gets a translation
of interaction systems (Fig. 7).

2.5. Duplication

Intuitively, the package 1i above represents the finite tree of all possible futures
of a cell. In the general case, this tree may be infinite, but it is possible to replace
this actual infinity by a potential one: it suffices to use something like a genetic
code. Duplication is clearly essential for this purpose.
Unfortunately, the analogue of Lemma 2 for duplication does not hold, because
$ cannot duplicate $ (whereas = can erase =). Nevertheless, a package ? without $
can be duplicated as follows:

This is an obvious corollary of the following lemma:

Lemma 3 (Duplication).

(i) For any tree { without $:

(ii) For any wiring |:

Both statements are proved by induction, using #$, $= and $$. Note that the rule
$$ is forced by (ii), and this is why $ cannot duplicate $. Again, (i) holds more
generally for principal nets and (ii) for reduced nets without $.

File: 643J 264319 . By:XX . Date:04:08:01 . Time:10:22 LOP8M. V8.0. Page 01:01
Codes: 2390 Signs: 1441 . Length: 52 pic 10 pts, 222 mm
88 YVES LAFONT

Now to cope with this impossibility of duplicating arbitrary packages? This is the
crucial point of our proof.

2.6. Codes, Copiers, and Decoder


One constructs, for any package ?, another package !? (the code of ?) which can
be duplicated, and from which ? can be extracted. More precisely, one constructs
principal nets C n (copier) of arity n and D (decoder) of arity 1, with the following
properties:

If one manages to construct !? without using $, then by Lemma 3, there is an


obvious implementation of the C n (in fact, the same as for the Tn ). It remains to
define !? and D. If ? contains n occurrences of $, it can be decomposed as follows,

where ?$ is a reduced net with 3n+1 free ports containing no $. An implementation


of the code and the decoder is given in Fig. 8. Clearly, !? contains no $ and ? can
be extracted from it by means of the decoder (Fig. 9). Note that Lemma 3 is used
once more.

2.7. Translation (General Case)


Using the previous constructions, a principal net [: i ] can be defined for each
symbol : i as in Fig. 10, where p i, j is the total number of cells in . i, j and ( . i, j ) is

FIG. 8. Implementation of the code and the decoders.

File: 643J 264320 . By:XX . Date:04:08:01 . Time:10:23 LOP8M. V8.0. Page 01:01
Codes: 2056 Signs: 1153 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 89

FIG. 9. Decoding.

FIG. 10. Translation of a cell (general case).


. .

File: 643J 264321 . By:XX . Date:04:08:01 . Time:10:24 LOP8M. V8.0. Page 01:01
Codes: 583 Signs: 87 . Length: 54 pic 1 pts, 228 mm
90 YVES LAFONT

obtained by replacing each symbol : k in . i, j by ( : k ). Note that this ( : k ) has one


more port than the cell : k . All those extra ports must be plugged into the copier
C pi, j in 1i, j . Otherwise, this translation works very much like the previous one. The
package !1 plays the role of a genetic code, from which each [: k ] can be extracted
as follows:

The reader is invited to complete the proof of Theorem 1 by working out the
analogue of Fig. 7 for this translation.

2.8. Minimality of the System

One may wonder whether the system of interaction combinators is minimal. In


other words, is it possible to remove symbols or rules without losing the property
of theorem 1? One can already make the following remarks:

v #$ is necessary because it is the only rule which increases the number of


cells. In particular, # and $ are necessary.
v == is necessary because it is the only rule for which the right member is
empty. In particular, = is necessary.
v One rule out of #= and $= is necessary because they are the only rules which
increase the number of occurrences of =.
v One rule out of ## and $$ is necessary because they are the only rules for
which the right member is a nonempty wiring.

A more detailed study shows that, in fact, both ## and $$ are necessary. On the
other hand, it happens that the system remains universal if one removes $=, but this
is not a significant simplification.
One may also wonder whether there is a universal interaction system with less
symbols. Starting from the interaction combinators, Denis Bechet proposed a
universal interaction system with only two symbols and three rules (private com-
munication), but one of his rules is quite complicated. Also, it is easy to see that
one symbol is not enough. Therefore, we conjecture that our system of interaction
combinators is essentially the simplest one satisfying Theorem 1.

3. SEMANTICS OF COMBINATORS

Here, we interpret the nets of combinators as reversible 2-stack machines. This


interpretation gives a notion of equivalence on nets of combinators, and suggests a
system of directed combinators.

File: 643J 264322 . By:XX . Date:04:08:01 . Time:10:24 LOP8M. V8.0. Page 01:01
Codes: 2867 Signs: 2075 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 91

FIG. 11. A net reducing to a wiring.

3.1. Execution

Let & be a net of combinators which reduces to some wiring |, as in Fig. 11.
Looking carefully at the rules of interaction, one sees that it is possible to compute
| without reducing &, just by travelling in &. This will be called the execution of &.
During this execution, one carries a pair (u, v) where u (the #-stack) and v (the
$-stack) are finite strings over the alphabet [p, q]. We shall write 1 for the empty
string. The letter p (resp. q) corresponds to the first (resp. the second) auxiliary port
of # or $. One travels according to the following rules (Fig. 12):

v if one enters a cell through an auxiliary port, one pushes the corresponding
letter onto the relevant stack, and one exits through the principal port;
v if one enters a cell through the principal port, one pops p or q from the
relevant stack, and one exits through the corresponding auxiliary port (in the case
of a $-cell) or through the other one (in the case of a #-cell). If the relevant stack
is empty, one stops.

Of course, one considers that the =-stack is always empty. An example of execution
is given in Fig. 13.
&
Let & be an arbitrary net of combinators. One writes (x, u, v) ^ (x$, u$, v$) if,
starting from the free port x with the pair (u, v), one eventually reaches the free port
x$ with the pair (u$, v$). One writes u for the string obtained by exchanging p with
q in u.

Proposition 5. The execution satisfies the following properties:


&
(i) for any (x, u, v), there is at most one (x$, u$, v$) such that (x, u, v) ^
(x$, u$, v$) (determinism);

FIG. 12. Rules of execution.

File: 643J 264323 . By:XX . Date:04:08:01 . Time:10:25 LOP8M. V8.0. Page 01:01
Codes: 2375 Signs: 1600 . Length: 52 pic 10 pts, 222 mm
92 YVES LAFONT

FIG. 13. Example of execution.

& &
(ii) if (x, u, v) ^ (x$, u$, v$) then (x$, u$, v$) ^ (x, u, v), and conversely (rever-
sibility);
& &
(iii) if (x, u, v) ^ (x$, u$, v$), then for any u" and v", (x, uu", vv") ^ (x$, u$u", v$v")
(monotonicity);
& +
(iv) if + reduces to &, then ^ and ^ are the same (invariance).

File: 643J 264324 . By:XX . Date:04:08:01 . Time:10:25 LOP8M. V8.0. Page 01:01
Codes: 871 Signs: 287 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 93

Proof. The first three statements are obvious. The fact that u becomes u in the
reverse computation comes from our definition of the execution in the case of a
#-cell. It is of course related to the fact that ## exchanges the ports. For the last
statement, it suffices to check that the execution is invariant by each rule. Clearly,
the execution has been defined in such a way that it is invariant by ## and $$. Here
is a typical case for ##:

Here is a typical case for $$:

The execution is also invariant by #$, because the two stacks are independent. Here
is a typical case:

The remaining cases are similar. Q.E.D.

3.2. Equivalence

Say that two nets of combinators + and & with the same free ports are equivalent
+ &
if ^ and ^ are the same. This is obviously a congruence: if one replaces a subnet
of & by an equivalent one, the resulting net is equivalent to &. Furthermore, the
invariance property tells us that + and & are equivalent whenever + reduces to &.
|
In the case of a wiring |, one has (x, 1, 1) ^ (x$, 1, 1) if and only if x is connected
to x$ in |. Therefore, if a net & reduces to a wiring | as in Fig. 11, this | can be
obtained by executing &, as in Fig. 13. Note also that two wirings are equivalent if
and only if they are equal. In order to characterize the equivalence of reduced nets,
we shall use the rules of Fig. 14, which can be applied in both directions.
Say that a free port x of a reduced net & accepts a pair (u, v) if there is a free port
&
x$ and a pair (u$, v$) such that (x, u, v) ^ (x$, u$, v$). Of course, this notion depends
only on the equivalence class of &. Say that x is passive if it is not connected to a

File: 643J 264325 . By:XX . Date:04:08:01 . Time:10:26 LOP8M. V8.0. Page 01:01
Codes: 2584 Signs: 1650 . Length: 52 pic 10 pts, 222 mm
94 YVES LAFONT

FIG. 14. Rules for equivalence.

principal port, and say that x is #-active (resp. $-active, =-active) if & can be trans-
formed by means of the rules of Fig. 14, in such a way that x is connected to the
principal port of a #-cell (resp. a $-cell, an =-cell). Again, these notions depend only
on the equivalence class of &:

v x is passive if and only if it accepts all (u, v);


v x is #-active if and only if it accepts no (1, v);
v x is $-active if and only if it accepts no (u, 1);
v x is =-active if and only if it accepts no (u, v).

The first statement follows easily from the decomposition of Proposition 2, and the
other ones are proved by induction on the number of cells.

Proposition 6. If + and & are reduced nets of combinators with the same free
ports, then + is equivalent to & if and only if + can be transformed into & by means
of the rules of Fig. 14.

Proof. It is easy to see that the execution is invariant by these rules. It remains
to show that, if + is equivalent to &, then + can be transformed into & by means of
the rules of Fig. 14. This is proved by induction on the number of cells in &. If all
free ports are passive, then + and & are the same wiring. Otherwise, there is a free
port x of & which is connected to the principal port of a cell, for instance a #-cell.
In other words, x is #-active, and + can be transformed in such a way that x is
connected to the principal port of a #-cell. One can remove the #-cell in both cases,
and apply the induction hypothesis to the remaining nets. Q.E.D.

3.3. Algebraic Formulation

The execution can be reformulated in a more algebraic way, as in the geometry


of interaction (see [Gir89, DR95]). For conciseness, we omit all proofs here.
First, one considers the non-commutative ring R generated by the letters p, q, p*,
and q* subjected to the following equations:

p*p=q*q=1, p*q=q*p=0.

The letters p and q are called positive, and the other letters are called negative.
A reduced monomial is an expression of the form uu$, where u consists of positive

File: 643J 264326 . By:XX . Date:04:08:01 . Time:10:26 LOP8M. V8.0. Page 01:01
Codes: 2827 Signs: 1984 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 95

letters and u$ consists of negative ones. By the above equations, the product of two
such monomials is either a reduced monomial or 0. For instance,

(pp*q*)(qppq*)=(pp*)(ppq*)=ppq*,

(pp*q*)(qqpq*)=(pp*)(qpq*)=0.

So one can show that any element of R can be uniquely written as a finite sum of
reduced monomials. In particular, the strings of positive letters can be identified
with the corresponding monomials in R. Moreover, the duality can be extended to
the whole ring R in such a way that it satisfies the following properties:

(uv)*=v*u*, 1*=1, (u+v)*=u*+v*, 0=0,

u**=u, u*u=1.

Let & be an arbitrary net of combinators. If x and x$ are free ports of &, a direct
path P from x to x$ is a path from x to x$ such that, if one enters through an
auxiliary port (resp. the principal port), then one exits through the principal port
(resp. an auxiliary port). For each type of crossing, one introduces an element of
the ring R  R as in Fig. 15. The weight |P| is the product of all these elements, in
reverse order. For instance, the weight of the path in Fig. 13 is

(q*qq*q)  (q*p*pq*qq)=1  1.

The weight is invariant by reduction. In fact, if one considers the interaction rules
for # and $, it appears that the equations defining R correspond to the rules of
annihilation (## and $$) and the commutation (u  1)(1  v)=(1  v)(u  1) to the
rule of commutation (#$).
&
Clearly, (x, u, v) ^ (x$, u$, v$) if and only if there is a direct path P from x to x$
such that |P| (u  v)=u$  v$. This is just a reformulation of the execution.
Let & be a reduced net with n free ports x 1 , ..., x n . By proposition 2, one sees that
there is a finite number of direct paths in &. So it makes sense to consider the sum
a i, j of all |P| where P is a direct path from x j to x i . This defines an n_n matrix
A with coefficients in R R. Consider for instance the following net:

FIG. 15. Algebraic interpretation.

File: 643J 264327 . By:XX . Date:04:08:01 . Time:10:27 LOP8M. V8.0. Page 01:01
Codes: 2786 Signs: 1878 . Length: 52 pic 10 pts, 222 mm
96 YVES LAFONT

There are two direct paths from x 1 to x 2 , and vice versa. The matrix of this net is:

0 p  q*+q  p*
A=
\q*  q+p*  p 0
.
+
The matrix of a reduced net will always satisfy the following symmetry property:
a j, i =,(a i, j ) where , is the anti-automorphism of R  R defined by

,(p  1)=q*  1, ,(q  1)=p* 1,


,(1  p)=1 p*, ,(1  q)=1 q*.

Note also that two reduced nets have the same matrix if and only if they are
equivalent.
If + is a net with n free ports, k cuts, and no vicious circle, it can be decomposed
as follows,

where +$ is a reduced net with n+2k free ports. If + reduces to a reduced net &, then
the matrix A of & can be obtained by means of the execution formula

A= tJ(A$+A$KA$+A$KA$KA$+ } } } ) J
= tJA$(I&KA$) &1 J,

where
v A$ is the matrix of +$,
v I is the matrix of the identity on [1, ..., n+2k],
v J is the matrix of the inclusion of [1, ..., n] into [1, ..., n+2k],
v K is the matrix of the partial permutation which is undefined on [1, ..., n]
and which exchanges the elements of [n+1, ..., n+2k] pairwise.
The execution formula makes sense because, in that case, the matrix KA$ is nilpotent.

3.4. Directed Combinators

Our execution is revertible, but the backward execution does not follow exactly
the same rules as the forward execution: the #-stack u must be replaced by u. This

File: 643J 264328 . By:XX . Date:05:08:01 . Time:06:46 LOP8M. V8.0. Page 01:01
Codes: 2506 Signs: 1244 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 97

is also expressed by the fact that the anti-automorphism , above maps p  1 to


q*  1 instead of p*  1. Of course, this would not happen if the rule ## were the
same as $$:

This modified system of combinators is not universal in the technical sense of


Theorem 1, but we shall see that it has the same expressive power as the original.
To show this, it is natural to consider a system of directed combinators with six
symbols #, #*, $, $*, =, =*, and the nine interaction rules of Fig. 16. This system
looks very much like the original one, except that it has no symbol which interacts
with itself. Because of this, the choice for the annihilations (##* and $$*) is just a
matter of taste.
If & is a net of combinators with n free ports, one defines a net &~ of directed com-
binators (the covering of &) with 2n free ports labelled by + or &. The covering
is defined on cells as in Fig. 17. It extends to nets in the obvious way, with the
convention that a + must always be plugged into a &, as in Fig. 18.
In fact, we have just separated the forward and the backward executions. This
construction is inspired by a classical one in topology: the 2-fold covering of an
arbitrary surface by an orientable one.
This covering is obviously not a translation in the technical sense of Section 1.7,
but it is compatible with reduction:

Proposition 7. If + reduces to & in n steps, then +~ reduces to &~ in 2n steps.

FIG. 16. Interaction rules for the directed combinators.

File: 643J 264329 . By:XX . Date:04:08:01 . Time:10:28 LOP8M. V8.0. Page 01:01
Codes: 2085 Signs: 1473 . Length: 52 pic 10 pts, 222 mm
98 YVES LAFONT

FIG. 17. Covering of a cell.

Proof. It suffices to check that each interaction between combinators is inter-


preted by two interactions between directed combinators. Q.E.D

This kind of generalized translation can be called a 2-translation. A consequence


of Theorem 1 and Proposition 7 is that any interaction system can be 2-translated
into the system of directed combinators. Conversely, there is an obvious translation
8 of directed combinators into combinators,

8(#)=#, 8($)=$, 8(=)==,

8(#*)=#, 8($*)=$, 8(=*)==,

where $ stands for $ with exchanged auxiliary ports:

FIG. 18. Covering of a net.

File: 643J 264330 . By:XX . Date:04:08:01 . Time:10:29 LOP8M. V8.0. Page 01:01
Codes: 1492 Signs: 590 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 99

FIG. 19. Symmetries of the directed combinators.

There is also a translation 9 of directed combinators into the modified system of


combinators, where the rule ## is the same as $$:

9(#)=#, 9($)=$, 9(=)==,

9(#*)=#, 9($*)=$, 9(=*)==.

In particular, this shows that the modified system of combinators has the same
expressive power as the original one.
The system of directed combinators itself has some interesting properties. First,
it is an extension of the system of multiplicative proof-nets (see [Laf 95]). Further-
more, it has a lot of automorphisms which operate on the set

[#, #, #*, # *, $, $, $*, $ *, =, =*].

One can show that the group of automorphisms has order 16 and is isomorphic to
the group of symmetries of a rectangle parallelepiped with square basis (Fig. 19).

4. DISCUSSION

If a net & reduces to a wiring |, one may wonder whether the execution is an
efficient algorithm for computing |. This question was already raised by Vincent
Danos and Laurent Regnier in [DR95]. They considered a linear *-term which
corresponds to the following net:

File: 643J 264331 . By:XX . Date:04:08:01 . Time:10:29 LOP8M. V8.0. Page 01:01
Codes: 1992 Signs: 1072 . Length: 52 pic 10 pts, 222 mm
100 YVES LAFONT

Clearly, such a net reduces to a single wire in a linear number of steps, whereas
one can show that the execution takes exponential time! Therefore, the practical
interest of this execution is not clear, even if one ignores the parallel aspects of the
reduction.
One may also wonder whether our translation of interaction systems into the
system of combinators can be seen as a process of compilation. This would mean
that we have a physical machine suitable for the reduction of nets of combinators.
The problem is that, even if the rules are simple, the geometry of the net may
become very complicated during the computation. In fact, we only know that the
reduction of interaction nets can be easily and efficiently implemented on a tradi-
tional sequential machine, but from this viewpoint, the translation into the system
of combinators does not seem to be useful.
From a more theoretical viewpoint, one may also wonder whether there are
typed versions of our various systems of combinators. In other words, is there
a logic behind the interaction combinators ? A simple solution has been given by
the author, and independently by Peter Selinger (private communication), but
this would lead us too far away from our issue, and we prefer to reserve it for
subsequent publication.

Received August 2, 1995; final manuscript received March 26, 1997

REFERENCES

[Baw86] Bawden, A. (1986), Connection graphs, in ``Proceedings of ACM Conference on Lisp and
Functional Programming,'' pp. 258265.
[DR95] Danos, V., and Regnier, L. (1995), Proof-nets and the Hilbert space, in ``Advances in Linear
Logic'' (J.-Y. Girard, Y. Lafont, and L. Regnier, Eds.), London Mathematical Society
Lecture Note Series, Vol. 222, pp. 307328, Cambridge Univ. Press, Cambridge, UK.
[Gay95] Gay, S. J. (1995), Combinators for interaction nets, in ``Proceedings of the Second Imperial
College Department of Computing Workshop on Theory and Formal Methods'' (C. L.
Hankin, I. C. Mackie, and R. Nagarajan, Eds.), Imperial College Press.
[Gir89] Girard, J.-Y. (1989), Geometry of interaction I: Interpretation of system F, in ``Proceedings,
Logic Colloquium '88'' (Ferro et al., Eds.), pp. 221260, North-Holland, Amsterdam.
[Gir95] Girard, J.-Y. (1995), Linear logic: Its syntax and semantics, in ``Advances in Linear Logic''
(J.-Y. Girard, Y. Lafont, and L. Regnier, Eds.), London Mathematical Society Lecture Note
Series, Vol. 222, pp. 142, Cambridge Univ. Press, Cambridge, UK.
[GAL92a] Gonthier, G., Abadi, M., and Levy, J.-J. (1992), The geometry of optimal lambda reduction,
in ``Proceedings of 19th ACM Symposium on Principles of Programming Languages
(POPL '92),'' Assoc. Comput. Mach., New York.
[GAL92b] Gonthier, G., Abadi, M., and Levy, J.-J. (1992), Linear logic without boxes, in ``Proceedings
of 7th Annual Symposium on Logic in Computer Science (LICS '92),'' IEEE Press, New York.
[Laf 90] Lafont, Y. (1990), Interaction nets, in ``Proceedings of 17th ACM Symposium on Principles
of Programming Languages (POPL '90),'' pp. 95108, Assoc. Comput. Mach., New York.
[Laf 95] Lafont, Y. (1995), From proof-nets to interaction nets, in ``Advances in Linear Logic''
(J.-Y. Girard, Y. Lafont, and L. Regnier, Eds.), London Mathematical Society Lecture Note
Series, Vol. 222, pp. 225247, Cambridge Univ. Press, Cambridge, UK.

File: 643J 264332 . By:DS . Date:06:08:01 . Time:09:33 LOP8M. V8.0. Page 01:01
Codes: 6147 Signs: 3357 . Length: 52 pic 10 pts, 222 mm
INTERACTION COMBINATORS 101

[Lam90] Lamping, J. (1990), An algorithm for optimal lambda calculus reduction, in ``Proceedings
of 17th ACM Symposium on Principles of Programming Languages (POPL '90),''
pp. 1646, Assoc. Comput. Mach., New York.
[Mac94] Mackie, I., (1994) ``The Geometry of Implementation (An Investigation into Using the
Geometry of Interaction for Language Implementation),'' Ph.D. thesis, Imperial College of
Science, Technology, and Medicine, London.

Printed in Belgium

File: 643J 264333 . By:DS . Date:06:08:01 . Time:09:33 LOP8M. V8.0. Page 01:01
Codes: 1145 Signs: 497 . Length: 52 pic 10 pts, 222 mm

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy