Jean-Yves Girard Equipe de logique (UA 753 CNRS) D~partement de math~matiques T 45-55, 5 ~tage, Universit~
Abstract
I.i. specifications and types In the recent years, more and more attention has been paid to questions of modularity in programming languages : in the handling of very big (debugging,
improvement of some part of the algorithm) without having to check again the complete structure. For this it is natural to conceive a
program as a juxtaposition of modules, which are branched together; what is inside the module is irrelevant to the branching, the branching, we have only been using specifications, and in doing
which tell us
167
general
for instance
integers as inputs and gives us back an integer as output. cations are usually represented by types, just considered int X int =~int
then the correctness of the full program only of its modules, and we are done.
we have to use some logic, and we are faced with an alternative i) external logic : a logical comment external : the program, to the program
ii) integrated
logic
the branchings
of in logical terms
; in fact, only this approach has a theoretical which dates back to Heyting's semantics through the Curry-Howard a program enjoying
expressions,
S is nothing but a proof of the formula S in an appropriate logic, typically intuitionist logic. can using
objects that are built to meet the logical requirements be written as functional expressions (for instance,
indifferently
corresponds
the functional
(and hence
on the other hand the use of proofs is more they are not absolutely linked to such
to get out of the realm of sequential later only discuss proofs. 1.3. second order !ambda-calculus
This system -called [ by the author- was introduced and corresponds propositional
in (Girard 1970)
exactly to the natural deduction of second-order : the system contains type variables ~ , ~ and the universal ,~ ...,
calculus
quantifier A ~ . and
elimination rules. The interest of the system relies on the following features : in the system : one can define
i) most current data types are definable types for booleans, int = d A~. ~ integers, ~) trees,
~ ((~ ~ )
through the
into an integer,
integer being independant of the order of the rules used. iii) the class of functions that can be expressed by means of proofs of int =~int is very general : in (Girard 1970) it was shown that this terminating algorithms sending
class is equal to the set of all provably integers into integers, arithmetic converge
the proof being carried out in second-order any algorithm that can be proved to can be represented in F.
PA 2. In particular,
in usual mathematics
169
sequential computation.
to parallelism.
of usual logic,leading
2.1.
intuitionistic
case
logic is based on a deep asymmetry between free variables in the functional notation) notation)
(hypotheses, (conclusions,
The asymmetry comes from the fact that a deduction a tree, with
(some of) its summits occupied by hypotheses, (the root of the tree).
H1 ]D
.....
Hk
of
ne__~t, enabling us to transform answers to the questions H i into an output of type C. So the communication seems to work from the hypotheses is indeed more complex, in more details as we :
to the conclusion.
170
it is enough to consider the case k ~- i, and more, where the only hypothesis H (= H I) occurs exactly once ; the c o m m u n i c a t i o n is established :
ID'
H
of a term t' of type H for a variable x of type H in a term t of type C, namely the term t ~ ' / x ] which is again of type C~. Now, the computation works by reducing certain c o n f i g u r a t i o n s which are created by the physical contact between D ' conclusion H with a hypothesis H written and and ~]D, by identifying a can be
AI
ID~
.HI
]D*
C problem of substitution etc.. What we have just described is a small bit of the n o r m a l i z a t i o n procedure, which is, up to now, widely adopted as a model for sequential computation. Let us come back to our point : the last :
is used as a destroyer for the first rule of ~ , hence using ~. But in fact the
171
communication
is symmetric
destroys
the
are in presence of a phenomenon of reciprocal produces a double communication, This general framework,
inputs/output
first rules of D.
2.2. linear negation In linear logic, we restore the symmetry, (.)i (nil) of linear negation, Linear logic will therefore with only conclusions. by introducing the connective
which exchanges
appear as a multiple
For instance,
instead of writing D
we did, we shall write a proof-net with as conclusions the proof-net will be indifferently the hypothesis H, or as a proof of ~
C and Hi
function from A to A
or the identity function from Al to A ~. Once for all, this imposes the dumping of any functional notation, which has the disadvantage The communication is
established by means of the (unhappily named) cut-rule, exact counterpart of the identity axiom written above
which is the
I72
AI
CUT indicate o f 1D f o r a phenomenon H i n 113' w o u l d of anihita-
the tion.
symbol
CUT b e i n g the
just
a way t o
Typically,
substitution
now b e c o m e
H CUT
Hi
where ]P and]P' "are the proof-nets representinglD" and iD' in linear logic. The syntax is organized in such a way that H il is H, i.e. the negation is only used on atoms, and then defined by De Morgan laws, which will force us to introduce our connectives and quantifiers by pairs. The connective of linear negation (which is a defined one) is
the first and most important level of linear logic : the level of communication, which consists essentially in opposing inputs and
outputs in two dual ways, namely the identity axioms and the cut rule.
3.
Cooperation
3.1. multiplicatives We only discuss here the idea of a binary cooperation ; the general
concept of a multiplicative connective of arity n, yielding more complex kinds of cooperation, By cooperation, will be analysed in a forthcoming paper.
and one of type B. The fact that we have these two outputs will be indicated by replacing them by a third ome A m B, where m is a
173
multiplicative
connective,
perate. There are only two possible ways of cooperating, pond to the De Morgan dual connectives i) independance m and 9.
The
which is written,
in the symmetrical
which look the same, although they are deeply different. rules,
together with the axioms of identity and the cut rule, form fragment of linear logic, by far the best understood. we can build proof-structures, and no hypothesis. which For
the multiplicative
, A
AliB
B,
IA1
but also A
'I AL.
procedure
A.B
The first proof-structure
174 works well, when we relate this proof-net to other ones by cuts); second one does not work well in relation to the cut-rule, therefore not be accepted as a proof-net. In order to determine which, ledged as proof-nets, with an arbitrary among proof-structures, will be acknow: starting the
and will
we introduce
instructions
we have to preset some switches because these ; in fact the ways of passing
through these rules are just the expression of the absence or presence of communication. The travel instructions are bideterministic, i.e. the
from a formula and a direction we can predict the next formula, next direction, As a corollary but we can only reconstruct to bideterminism,
a certain number of loops. When there are several to a particular switching), we speak of shortrip
; in case of a single
loop, we speak of longtrip. Definition A proof-structure of its switches, are longtrips, g is said to be a proof-net when, there is no shortrip for any positioning all trips every formula
; in other terms,
which means that starting from anywhere, once upwards, once downwards. procedure
is an obvious normalization
for proof-nets,
established by
AI
Ai CUT
BI
A ~ B
AI
B
CUT
Bi
CUT which means an o u t p u t is excluded. to avoid that used as its own i n p u t , related and that to general its c a n n o t be n o r m a l i z e d , trips are indeed might
own t a i l "
occur through normalization. Normalization normalize, in the multiplicative fragment is very quick strictly) (when we
i.e. we can work with several cuts at the same time. multiplicatives, we shall give a striking geometrical process.
the cut-elimination
3.3. sequentialization The general condition for being a proof-net is of exponential nature if thereeare n multiplicative switchings, links in 8, there are 2n possible :
and the idea is therefore not to ask a computer to decide is sound. The idea will be and that we shall feed
176
it with a proof written in a more traditional way. This more traditional way is linear sequent calculus, same expressive power as proof-nets, which has the in the
familiar tree-like succession of axioms and rules. of linear sequent calculus corresponds mechanically net p-. Conversely,
exists at least one proof p in linear sequent calculus B = p-, in general many ones. appear as particular
into proof-nets,
and we can even imagine other derived rules enabling us to describe proof-nets manners in a simple, useful~ but non intrinsic way : all these language
the machine
4. Sharing
4.1. additves Here again~ where, I only discuss binary sharing. By sharing, I mean a situation
third output A a B, where a is an additive connective, in which sense the only output will be effective. ways of sharing, i) open sharing outputs,
which indicates
177
are considered,
but we
don't know which one (we need to know in which case we are). The connective for open sharing is & (with), the direct product. where exactly one is
A
le
et
B
- - 2 ~
AeB
j
--
AI . . . . . . . .
An
and the box will be linked to other boxes and formulas by means of the rules of the system. The linkage must be correct independantly of what is actually inside the box, i.e. I can replace by any other ~ will
are exactly
which depict the arbitrary behaviour of a p r o o f - n e t whose conclusions are AI, .... An, and so boxes can be inserted in the multiplicative framework. The rule for & is the following :
178
given two proof-nets B and B' whose respective conclusions are C,A and C,B (C is a sequence of formulas), form a box ~ whose oonclusions
are C and A & B ; the formu&a A & B is the main door of the box, whereas the formu%as C are its auxiliary doors. It is not problematic to normalize cuts when one of the premises is the main door of a &-box ;
the case. where one of the premises is an auxiliary door can be handled too, but in that case part of what we are doing may be eventually cancelled, hence it is more reasonable to wait in this case until
a cut arriving through the main door arises. Such a cut is normalized as follows :
BBI c
CUT
v~
AI
B1 le
A~
becomes
CvA 4',.
CUT This kind of situation is typical of IF THEN ELSE instructions. part of the structure, namely B' in the example given, A whole
is destroyed.
The commutative reductions, Which reduce cuts arising through one of the auxiliary doors ~, produce a duplication of the work, and this is why it reasonable to wait for the opening of~the main door. In doing so, we produce a phenomenon of synchronization, to the asynchronous multiplicative level. in sharp contrast
179
5. Storage
5.1. exponentials The storage operations are all those connected with the use of memory.
instruction
by replacing
which indicates
dual connectives
The situation
is in-
namely duplication,
erasing)
; other interesting
possibilities
as primitive.
? (why not)
of consideration. 5.2. the exponential ru&~s from a proof-net ending with !A and
ending with
? is handled by means of three rules,, namely i) contraction ?A 2A - - c ? ?A which has the same features as a "par"
which sonsists
180
an additional
iii) dereliction
, which corresponds
to reading/e~asing.
Without
6. abstraction
6.1. quantifiers When we want to abstract a given output from certain type contingencies, then we are lead to replace A by Q .A, where ~ is a variable of type,
and the quantifier Q denotes which kind.of abstraction has been performed ; there are two De Morgan dual quantifiers, A a abstraction and V ~ in
i) universal
(second order) quantifier. abstraction : this is when we have obtained A by . The situation is
ii) existential
6.2. the quantifier rules A i is handled by means of a box : from a proof-net ending with A and auxiliary conclusions C not containing ~ free, then we can
181
form a box ending with A~.A and C. ~is handled by means of the unary rule
~ V
~. A
AB, ]
7. execution of a program
7.1. normalization The methods of 6G~rard 1970) can be extended here to provide a strong normalization described. theorem (cut-elimination) for the full system PN2 just are added
orthogonality proof.
There is therefore a way of executing a program by applying procedure, each symbol CUT being an indication ; the boxes are responsible for a
the normalization
at a semantic level.
of the operational
to PN2 is a an essential
i) it will certainly shorten the execotion of programs, a lot of syntax will be dumped at the ground level. ii) it will enable us to use operations,
because
182
not definable in PN2 (or by any other current logical system). of the main problems is to combine the advantages of semantics syntactical byzantinism) with those of the syntax (finitism) last point (finitism)
One (no
; the
iii) at a later stage, one can dream of a new kind of machine, on the operational semantics particularily simple,
BIBLIOGRAPHY (Girard 1970) Une extension de l'interpr~tation de G~del & l'analyse et ~ la th@orie des types etc., Proc. 2nd Scand. North Holland Pub. C , Amsterdam 1971. (Girard 1986) Linear Logic, to appear in T.C.S. For a discussion of the sequential case, in relation to linear Log. Symp., ed Fenstad,
memory allocation and laziness, by means of intuitionistic logic, one can consult (Girard & Lafont 1986) Linear logic & lazy evaluation, the Proceedings of TAPSOFT'87, Pisa.
to appear in