HAL Id: inria-00221221
https://hal.inria.fr/inria-00221221v3
Submitted on 1 Feb 2008
HAL
is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire
HAL, estdestinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
Michele Pagani, Alexis Saurin
To cite this version:
Michele Pagani, Alexis Saurin. Stream Associative Nets and Lambda-mu-calculus. [Research Report]
RR-6431, INRIA. 2008, pp.48. �inria-00221221v3�
a p p o r t
d e r e c h e r c h e
9-6399ISRNINRIA/RR--6431--FR+ENG
Thème SYM
Stream Associative Nets and Λ µ-calculus.
Michele Pagani — Alexis Saurin
N° 6431
janvier 2008
Centre de recherche INRIA Saclay – Île-de-France
Mihele Pagani
∗
, Alexis Saurin
†
ThèmeSYMSystèmessymboliques
Équipe-ProjetPARSIFAL
Rapportdereherhe n°6431janvier200848pages
Abstrat: Λµ-alulushas beenbuilt as anuntyped extension of Parigot's λµ-alulusin orderto reoverBöhmtheorem whih wasknown tofail in λµ-
alulus. An essential omputational feature of Λµ-alulus for separationto
holdistheunrestriteduseofabstrationsoverontinuationsthatprovidesthe
aluluswithaonstrutionofstreams.
BasedontheCurry-HowardparadigmLaurenthasdened atranslationof
λµ-alulusin polarized proof-nets. Unfortunately, this translation annotbe immediately extended to Λµ-alulus: the type system on whih it is based
freezesΛµ-alulus'sstreammehanism.
We introdue stream assoiative nets (SANE), a notion of nets whih is
between Laurent's polarized proof-nets and the usual linear logi proof-nets.
SANEhavetwokindsofO(heneof⊗),oneislinearwhiletheotheroneallows
freestruturalrules(asinpolarizedproof-nets). WeproveonueneforSANE
and givearedutionpreserving enoding of Λµ-alulusin SANE, basedona
newtypesystemintroduedbytheseondauthor. Itturnsoutthatthestream
mehanismatworkin Λµ-alulusanbeexplainedbytheassoiativityofthe twodierentkindsofOofSANE.
Atlast,weahieveaBöhmtheoremforSANE.ThisresultfollowsGirard's
programtoput intotheforetheseparationasakeypropertyoflogi.
Key-words: λµ-alulus, linear logi, Böhm theorem, proof-nets, lassial logi,assoiativityinlogi,ontinuations.
∗
PPS,CNRS&UniversitéParisVIIMihele.Paganipps.jussieu.fr
†
LIXParsifal,INRIA&ÉolePolytehniqueSaurinlix.polytehnique.fr
Résumé: LeΛµ-alulaétéintroduitommeuneextensionnon-typéeduλµ-
aluldeParigot,remanièreàretrouverlapropriétédeséparation(outhéorème
deBöhm)dontonsavaitqu'elleétaitfausseenλµ-alul. Unélémentessentiel
enΛµ-alul pourquelaséparationsoitvalide estl'utilisation sansrestrition d'abstrationsur lesontinuations qui donnent au alul une onstrutionde
streams.
Fondésurleparadigme deCurry-Howard,OlivierLaurentadéniunetra-
dutionduλµ-alulusdanslesréseauxdepreuvepolariés. Malheureusement, ettetradutionnepeutpasêtre étendueauΛµ-aluls: lesystème detypage
surlequelelleestbaséedésativeleméanismedestreamduΛµ-alul.
Nous introduisons les stream assoiative nets (SANE), une variante de ré-
seauxquisesitueentrelesréseauxpolariséesdeLaurentetlesréseauxhabituels
delalogiquelinéaire. LesSANEontdeuxtypesdeO(etdonde⊗): l'unest
linéairetandisquel'autreadmetlibrementdesrèglesstruturellesommedans
lesréseauxpolarisés.
NousprouvonslaonuenepourSANEetprésentonsunerédutionquipré-
servel'enodageduΛµ-aluldansSANE.Cetterédution,fondéesurunnou-
veausystèmedetypageintroduitparleseondauteur.Ons'aperçoitquelemé-
anismedestreamàl'÷uvreenΛµ-alulspeutêtreexpliquéparl'assoiativité desdeuxtypesdeOdesSANE.
Finalement, onmontre un théorème de Böhm pour lesSANE. Le résultat
suitleprogrammedeGirardvisantàdonneruneplaeléàlaséparationparmi
lespropriétésdessystèmeslogiques.
Mots-lés: λµ-alul,logiquelinéaire,théorèmedeBöhm,réseauxdepreuve,
logiquelassique,assoiativitéenlogique,ontinuations.
Stream Assoiative Nets and
Λ µ
-alulus.Mihele Pagani ,Alexis Saurin
Λµ-alulushasbeenbuiltasanuntypedextensionofParigot'sλµ-alulus
in order to reover Böhm theorem whih was known to fail in λµ-alulus.
An essentialomputationalfeatureofΛµ-alulusforseparationtohold isthe
unrestrited use of abstrations overontinuations that provides the alulus
withaonstrutionofstreams.
BasedontheCurry-HowardparadigmLaurenthasdened atranslationof
λµ-alulusin polarized proof-nets. Unfortunately, this translation annotbe immediately extended to Λµ-alulus: the type system on whih it is based
freezesΛµ-alulus'sstreammehanism.
We introdue stream assoiative nets (SANE), a notion of nets whih is
between Laurent's polarized proof-nets and the usual linear logi proof-nets.
SANEhavetwokindsofO(heneof⊗),oneislinearwhiletheotheroneallows
freestruturalrules(asinpolarizedproof-nets). WeproveonueneforSANE
and givearedutionpreserving enoding of Λµ-alulusin SANE, basedona
newtypesystemintroduedbytheseondauthor. Itturnsoutthatthestream
mehanismatworkin Λµ-alulusanbeexplainedbytheassoiativityofthe twodierentkindsofOofSANE.
Atlast,weahieveaBöhmtheoremforSANE.ThisresultfollowsGirard's
programtoput intotheforetheseparationasakeypropertyoflogi.
Contents
1 Introdution 4
2 Λµ-alulus 7
2.1 λµ-alulus,streamsandSeparation: Λµ-alulus . . . . . . . . . 7
2.2 TypingΛµ-alulus. . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Streamassoiative nets 12
3.1 Rewritingrules . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 Corretnessriterion . . . . . . . . . . . . . . . . . . . . . . . . . 19
4 Conuenetheorem 25
5 Separation theorem 28
6 Simulation theorem 40
7 Conlusion 46
∗
PPS,CNRS&UniversitéParisVIIMihele.Paganipps.jussieu.fr
†
1 Introdution
Curry-Howard in lassiallogi. Curry-Howardisomorphismstatesaor-
respondenebetweenprogramsandproofs. Basially,itexpresses(i)thatatype
anbeseen asa logialformula, and onversely, and (ii) that a program an
be seenas aproof, s.t. theexeution of theprogramorrespondsto applying
theut-eliminationproedure to theassoiated proof, andonversely. Indeed,
thisorrespondenewasatrst limitedto intuitionistilogion theonehand
andto funtionalprogramming(λ-alulus)ontheother hand. Extendingthe
orrespondenetolassiallogiresultedinstrongonnetionswithontrolop-
eratorsin funtionalprogramminglanguagesasrstnotiedbyGrin[Gri90℄.
Inpartiular,λµ-alulus[Par92℄wasintroduedbyMihelParigotasanexten-
sionofλ-alulusisomorphitoanalternativepresentationoflassialnatural dedution(knownasfreededution)in whihoneanenodeusualontrolop-
eratorsandinpartiulartheall/operator.
Polarizedlinear logi. BasedontheextensionoftheCurry-Howardisomor-
phismtolassiallogi,LaurentdenesatranslationofParigot'sλµ-alulusin
polarizedlinearlogi: avariantoflinearlogi(LL),allowingfreestruturalrules
onnegativeformulas[Lau02℄. Laurent'stranslationenlargestheomparisonbe-
tweenLLandusualλ-alulus,startedfromGirard[Gir87℄,Danos[Dan90℄and
Regnier[Reg92℄. Inpartiular polarized LLprovidesalassof proof-nets(the
graph-theoretialrepresentationof LL proofs)orrespondingto the λµ-terms,
soshedingnewlightinto theomputationofλµ-alulus.
λµ-alulus and Separation. λµ-alulusbeameone of themoststandard
waystoexaminelassiallambda-aluli. Asaresult,thealulushasbeenmore
andmorestudied andmorefundamental questionsarose. Amongthem, oneof
themostimportantisseparation. Thebestknownexampleofseparationresult
isBöhm'stheorem forthepureλ-alulus[B68℄: ift, t′ aretwodistintlosed βη-normalterms,thenthereexisttermsu1, . . . , un,suhthat(t)u1. . . un →β x
and(t′)u1. . . un→βy. Thisresulthasonsequenesbothatthesemantiallevel
aswellasatthesyntatialone: ontheonehanditentailsthatamodelofthe
λ-alulusannotidentify twodierentβη-normalformswithoutbeingtrivial;
onthe other hand it establishes abalane betweensyntatial onstrutsand
β-redution: anydiereneinthestrutureofaβη-normalformimpliesadier-
eneinthevalueofthat normalform onsuitablearguments. In2001David &
PyaddressedthequestionofseparationtoParigot'sλµ-alulusandtheygavea
negativeanswerbyexhibitingaounter-example[DP01℄. Inapreviousworkof
2005,theseondauthorintroduedanextensiontoλµ-alulus,Λµ-alulus,for
whih heouldprovethat separationholds [Sau05℄. Λµ-alulusisfairly lose
tostandardpresentationsofλµ-alulus(see[dG94,dG98℄forinstane),butis
denitelyadierentalulus. Inpartiular,anessentialomputationalfeature
ofΛµ-alulusforseparationtoholdistheunrestriteduseofabstrationsover ontinuationsthatprovidesthealuluswithaonstrutionofstreams.
The logi of Λµ-alulus. We pursue an investigation of the logi behind
Λµ-alulus. Ourfeelingis thattherulesof lassiallogi imposesatoostrit
disipline over the use of streams: in Parigot's λµ-alulusstreams represent
onlyhannelsthroughwhih termsanbesent,thesehannelsanbeplugged
toeahother,theyanbeexhanged,buttheydonotreallyommuniatewith
the termsin theourse ofa omputation. Streams andterms live in dierent
worlds,inpartiulartheformeronesarenotrstlassitizensintheearlyver-
sionsofλµ-alulus. WethinkthattheCurry-Howardisomorphismatthebase ofParigot'sλµ-alulusrestritstoomuhtheomputationalpowerofstreams, a onsequeneof whih is thefailure of theseparationproperty,as provedby
David &Py. If we forget theCurry-Howardisomorphisms and startto build
morefreelytheprogramsinΛµ-alulus,thenwegetbaktheseparationprop-
ertyandinthesametimewemoveawayfromlassiallogi.
StreamAssoiativeNEts: fromtherulesoflassiallogitothelogi
of Λµ-alulus rules. Thisturning-pointindues ahangeoftheenodingof
λµ-alulusintoproof-nets: indeedLaurent'stranslationisbasedontheCurry- Howardisomorphismwithlassiallogi. Wefollowanotherdiretion,in order
tohaveanenodingofΛµ-aluluswhihismorefaithfulltothestreambehavior
at thebase oftheseparationproperty. Webelievethat itisbydepartingfrom
therulesoflassiallogithatwewill understandthereallogiofΛµ-alulus
rules.
Wethusdeneanewlassofnets,StreamAssoiativeNEts(SANE).SANE
lies in betweenusual linearlogiproof-netsand polarizedproof-nets: wehave
twokindsofO(anddually of⊗),oneomingfromLL(assoiatedwiththeλ-
variables)andtheotheroneomingfrompolarizedLL(andassoiatedwiththe
µ-variables). Theessentialingredientistheassoiativitypropertybetweenthese twokindsofmultipliatives,whihmakespossibletheommuniationbetween
streamsandλ-variablesmuh inthesamewayasfstruledoesin Λµ-alulus.
Better be in SANE to study Λµ-alulus. The orrespondene between
Λµ-alulusandSANEwillallowforonsiderabletransfersoftehnologiesbe- tweenthetwodomains,inpartiularproof-netswillprovidepowerfulgeometri-
alabstrationsandadeeplysymmetrialframeworkaswellasstrongdualities.
Inadditiontoaner-grainedstudyoftheredutionrulesofΛµ-alulus(asem-
phasized byour simulationresult), SANE redutions will provide Λµ-alulus
with a notionof expliit substitution. Moreover,SANE should help studying
therelationshipsofΛµ-aluluswithotherontinuation-basedaluli.
Proof-nets with separationproperty. SANE havebeendesigned in order
to studyΛµ-alulus,butseparationpropertyplaysakeyrolein thetheoryof
SANE.AsinLudis[Gir01℄whereGirardhoseseparationtobearequirement
for his elementary objets, the designs, the nets we introdue in the present
work have been designed with separation property to be at the heart of the
theory,muhinthesamewayasonuenedoes.
Struture ofthe Paper. Thefollowingsetionisdediatedto ashort intro-
dutiontoParigot'sλµ-alulustoseparationrelatedtopisandtoΛµ-alulus.
A new type systemfor Λµ-alulus is provided whih servesas abasis to de-
ne, in setion 3,the pureStream assoiativenets,their redutions,statethe
orretness riterionfor SANE and proveanoriginal strong normalizationre-
sult of s,r,a whih impliesthestrong normalizationof exponentialredution
in SANE 1
. The followingsetion is dediated to proving onuene of SANE
beforegoingtothequestionoftheseparationpropertyinsetion5. Finally,we
simulateΛµ-alulusinSANEin setion6.
1
ThisgivesasaorollarytheSNoftheimpliitexpliitsubstitutionsystem
2
Λ µ
-alulus2.1
λµ
-alulus, streams and Separation:Λ µ
-alulusDavid & Py ounter-example to Separation in λµ-alulus. In their
2001 paper [DP01℄, David & Py addressed the question of separation prop-
ertyinλµ-alulusbyexhibitingaounter-exampletoseparation,theλµ-term W =λx.µα.[α]((x)µβ.[α](x)U0 y)U0 withU0=µδ.[α]λz1.λz2.z2. Separation
propertyfails in this setting beausethere is no way to put thevariable y in
headposition. Thekeypointisthattheentireappliativeontextinwhihthis
term is plaed is transmitted through µαto subterms; asa onsequene, the
usualtehnique(whihonsistsinbuildingaontextthatshallexplorethepart
ofthetermwewant)annotbeapplied.
Reovering Separation in λµ-alulus: relaxing impliit(underlying) typing onstraints. What we doby introduing Λµ-alulusis preisely to
bemoreliberal withtheonstrutionoftermsinorderto providethealulus
with more appliative ontexts and retrieve the ability to realize the needed
explorationpaths. Inpartiular,Parigot'sλµ-alulussyntax hasaonstraint
ofnamingatermrightbeforeitisµ-abstrated(termshavetheformµα.[β]_)
whih anatually beseen asatyping onstraintdiretly built in the syntax
of the untyped alulus. Λµ-alulus is basially the result of removing this
onstraint. By doing so, we obtain a alulus whih is lose to de Groote's
presentation of λµ-alulus but it is not equivalent to this alulus sine de
Groote's presentation also ontains a typing onstraint whih is built in the
syntax,namelytheǫrulethatisabsentfromΛµ-alulus2.
Λµ-aluluswasintroduedin [Sau05℄asanuntyped extensionofParigot's λµ-alulus in whih separation holds. Given twoinnite disjoint sets Vt (of
term variables,denoted byx, y, z . . .) andVs (of streamvariables, denoted by
α, β, γ . . .),Λµ-alulusisdened bythefollowinggrammar:
t, u...::= x|λx.t| (t)u|µα.t|(t)α
Anabstration isatermofshapeλx.torµα.t andanappliation is aterm
of shape(t)u or(t)α. We referto the appliation of an abstration asa ut.
There arefour kindsofutsin Λµ-alulusasshownin gure1: (T)T, (T)S, (S)T,(S)S.
Λµ-alulusredutions.
Cutsoftype(T)T and (S)S areredexesforthefollowingrules:
(λx.t)u →βT t[u/x] (1)
(µα.t)β →βS t[β/α] (2)
Bututsoftype(S)T and(T)S arenotredexesfortheserules.
2
Theresultofthe ǫruleinΛµ-aluluswouldatuallybetoanelmultiplestreamab-
(T)T : (λx.t)u (T)S: (λx.t)α
(S)T : (µα.t)u (S)S : (µα.t)β
Figure1: Cutsin Λµ-alulus.
⊲(λx.t)u −→βT t[u/x]
⊲ λx.(t)x −→ηT t
⊲(µα.t)β −→βS t[β/α]
⊲ µα.(t)α −→ηS t
⊲ µα.t −→fst λx.µβ.t[(U)xβ/(U)α]
Proviso:
Inη,fst, x6∈F Vt(t);in ηs,α6∈F Vs(t)
Figure2: Λµ-alulusredutionrules
The following fst-rule relates term variables with stream variables, it is a
way to aess therst term of thestream and it will allowto redue the last
twotypesofuts:
µα.t →fst λx.µβ.t[(U)xβ/(U)α] (3)
Indeedthefst-rulemakesreduibletheutsoftype(S)T:
(µα.t)u→fst (λx.µβ.t[(U)xβ/(U)α])u→βT µβ.t[(U)uβ/(U)α]
aswellasthoseoftype(T)S,wheneversubtermsofalosedterm:
µβ. . . .(λx.t)β· · · →f stλx.µβ. . . .(λx.t)xβ· · · →βλx.µβ. . . .(t)β . . .
Thefollowingrulesdenesextensionalequivalenes(withtheusual proviso
x /∈F VT(t)andα /∈F VS(t)):
λx.(t)x →ηT t (4)
µα.(t)α →ηS t (5)
Λµ-alulusredutionrulesaresummarizedin gure2.
InΛµ-alulus,µanbeseenasanabstrationoverstreamsofterms3.
For instane, while λx.λy.λz.((z)(t)xy)(t′)xy may dupliate twoterms passed
3
Streamsasrst-lassitizensareonsequenesofmoreextensionalityinΛµ-alulusthan
inλµ-alulus,duetothefatthatitispossibletousetheextensionalityrulesηandηswhere
λµ-alulussyntaxforbidstodoso,forinstane: µα.(t)β→ηµα.(λx.(t)x)β.
V arT
Γ, x:T ⊢x :T |∆
Γ, x:T ⊢t :T′|∆
AbsT
Γ⊢λx.t :T → T′|∆
Γ⊢t :T → T′|∆ Γ⊢u :T |∆
AppT
Γ⊢(t)u :T′|∆
Γ⊢t :⊥|∆, α:A Γ⊢µα.t :A|∆ µAbs
Γ⊢t :A|∆, α:A Γ⊢(t)α :⊥|∆, α:A µApp
Figure3: Λµ-alulusClassialTypeSystem.
throughxandy,Λµ-termµα.µβ.λz.((z)(t)αβ)(t′)αβandupliatetwostreams
ofterms,these streamsbeingforinstaneappliedthroughtheappliativeon-
text: []t1. . . tkγu1. . . ulδ.
Comparedtoλµ-aluluswheretheeetofµisonlytoredirettheompu-
tation ow, inΛµ-alulus,oneanmanageto dealwith streamsasrst-lass
itizens: forinstane,µα.µβ.λx.λy.xisatermthaterasestwostreamsofterms
andreturnsthebooleanvaluetrue. Aspreviouslysaid,Λµ-alulushasbeende-
signedinordertoreovertheseparationproperty. Theoriginalounter-example
toseparationbyDavid&Py[DP01℄,W,issolvedbythefollowingΛµ-ontext:
C = []Px0x1α0α1α where P = λz0, z1.µγ.λu.((u)µβ.z1)z0: C(W) →⋆ y (see
[Sau05℄ formoredetails).
2.2 Typing
Λ µ
-alulusTyping Λµ-alulus as λµ-alulus. Oneouldthink of typing Λµ usinga
standardtypesystemforlassiallambda-aluliasshowningure3. However,
thisapproahisnotsatisfatoryonsideringourmotivationsindeveloppingthe
new alulus, that is from the point of view of separation. Indeed, the main
struturesusedin[Sau05℄inordertoobtainseparationwouldnotbetypablein
thesystemofgure3andforveryfundamentalreasons. Anytermoftheform
µα.λx.twouldbeuntypablewhereasthisisthetypialtermusedintheproofof
separationforΛµ-alulus. Infat,thetypingsystemoriginally introduedin
ordertoonnetthealuluswithfreededution[Par92℄preiselyforbidssuh
terms: λx.tisaλ-abstratedtermandthusshallbeofan→-typewhereasthe
fat that itis µ-abstratedthroughstream variableαfores thetermto beof
type⊥whihisinompatible(seeruleµAbsin gure3).
Making streams rst-lass itizens in the typed setting. The stream
mehanismthatwasusedintheuntypedalulusinordertoobtainseparation
is thus desativatedwhen lassialtypesare reintrodued. Weshalllook fora
variantofthistypesystemthat wouldreetintypesthestreamonstrution.
In partiular, sine µ is seen as a stream abstration, one might think of a funtional type for streams: if the term t is of type T when stream α is of
stream typeS,then µα.twould beofthetypeofastream funtionfrom S to T (that wewrite S ⇒ T). Weanthusthink ofthefollowingtyping rulesfor