• Aucun résultat trouvé

On Internalizing Modules as Agents in Concurrent Constraint Programming

N/A
N/A
Protected

Academic year: 2021

Partager "On Internalizing Modules as Agents in Concurrent Constraint Programming"

Copied!
34
0
0

Texte intégral

(1)

HAL Id: inria-00096644

https://hal.inria.fr/inria-00096644v3

Submitted on 26 Sep 2006

HAL is a multi-disciplinary open access

archive for the deposit and dissemination of

sci-entific research documents, whether they are

pub-L’archive ouverte pluridisciplinaire HAL, est

destinée au dépôt et à la diffusion de documents

scientifiques de niveau recherche, publiés ou non,

Constraint Programming

Remy Haemmerle, Francois Fages, Sylvain Soliman

To cite this version:

Remy Haemmerle, Francois Fages, Sylvain Soliman. On Internalizing Modules as Agents in Concurrent

Constraint Programming. [Research Report] RR-5981, INRIA. 2006. �inria-00096644v3�

(2)

inria-00096644, version 2 - 21 Sep 2006

a p p o r t

d e r e c h e r c h e

Thème SYM

On Internalizing Modules as Agents in Concurrent

Constraint Programming

Rémy Haemmerlé — François Fages — Sylvain Soliman

N° 5981

(3)
(4)

Rémy Haemmerlé, François Fages , SylvainSoliman

ThèmeSYMSystèmessymboliques

ProjetContraintes

Rapportdere her he n°5981 Septembre200630pages

Abstra t: Module systems are an essential feature of programming languages asthey

fa ilitatethere-useofexisting odeandthedevelopmentofgeneralpurposelibraries. There

arehowevertwosomewhat ontradi torywaysoflookingatmodulesinagivenprogramming

language. On theone hand,module systems arelargely independent of theparti ulars of

programminglanguages,andseveralexamplesofmodulesystemshaveindeedbeenadapted

todierentprogramminglanguages.Ontheotherhand,themodule onstru tsoften

inter-ferewiththeprogramming onstru ts,andmayberedundantwithothers opeme hanisms

ofprogramminglanguages,su has losuresforinstan e. Thereisthereforeaneedtounify

theprogramming on eptsand onstru tsthat aresimilar, andretain aminimumnumber

ofessential onstru tstoavoidarbitraryprogramming hoi es. Inthispaper,werealizethis

aimin theframeworkof linearlogi on urrent onstraintprogramming(LCC) languages.

Werstshowhowde larationsand losures anbeinternalizedasagentsin LCC.Wethen

presentamodularversionofLCC(MLCC),wheremodulesarereferen edbyvariablesand

where implementation hidingisobtainedwith theusual hidingoperator forvariables. We

develop the logi al semanti s of MLCC in linear logi , and show the ompleteness of the

operationalsemanti sfortheobservationofsu essesanda essiblestores. Finallywe

dis- ussa omplete module systemfor onstraintlogi programming,derivedfrom theMLCC

s heme.

(5)

Résumé: Lessystèmesdemodulessontuntraitessentieldeslangagesdeprogrammation,

ar ils fa ilitent la réutilisation du ode préexistant et le développement de bibliothèques

génériques. Il y a ependant deux façons quelque peu ontradi toires de onsidérer les

modules dans un langage de programmation. D'un oté, les systèmes de modules sont

largement indépendants des parti ularités d'un langage de programmation, et plusieurs

exemplesdesystèmesdemodulesonteneetétéadaptésàdiérentslangagesdeprogrammation.

D'un autre oté, les onstru tions de modules interfèrent souvent ave les opérateurs de

programmation, et peuvent être redondants ave d'autresmé anismes de liaison, telsque

lesfermeturesparexemple. Ilyadon unbesoinpourunierles on eptsetopérateursde

programmationquisontsimilaires,etretenirunnombreminimalde onstru tionsessentielles

an d'éviter des hoix arbitrairesde programmation. Dans et arti le, nous réalisons et

obje tif dans le ontexte des langages de programmation on urrente ave ontraintes en

logiquelinéaire(LCC).Nousmontrons d'abord ommentlesdé larations etles fermetures

peuventêtreinternalisées ommedesagentsLCC,puisnousprésentonsuneversionmodulaire

deLCC(MLCC)oùlesmodulessontréféren éspardesvariableslogiques,etoùlemasquage

del'implantationest obtenuàl'aidedel'opérateurusuelde masquagedesvariables. Nous

développonslasémantiquelogiquedeMLCC,et démontronsla orre tionetla omplétude

de la sémantique opérationnelle pour l'observation des stores a essibles et des su ès.

Finalement nous présentons un système de modules pour la programmation logique ave

ontraintesdérivédeMLCC.

(6)

1 Introdu tion

Module systems are an essential feature of programminglanguages as they fa ilitate the

re-useofexisting odeandthedevelopmentofgeneralpurposelibraries. Therearehowever

two ontradi torywaysoflookingatamodule system. Ontheonehand,amodulesystem

is essentiallyindependent ofthe parti ulars ofa given programminglanguage. Modular

modulesystemshavethusbeendesignedandindeedadaptedtodierentprogramming

lan-guages[13℄. On theother hand,module onstru tsoften interfere with the programming

onstru tsandmayberedundantwithother s opeme hanismssupportedbyagiven

pro-gramming language,su h as losures for instan e. There is therefore a need to unify the

programming on eptsand onstru tsthataresimilarinordertoretainaminimumnumber

ofessential onstru tsandavoidarbitraryprogramming hoi es.

Inthispaper,westudya ompletemodulesystemforlinear on urrent onstraint(LCC)

programminglanguagesandshowhowmodulesand losuresareuniedasaparti ularkind

ofLCCagentsinthisframework.

Linear on urrent onstraint programming

The lass of Con urrentConstraint (CC) programming languageshasbeen introdu ed in

[17℄asan elegantmerge of onstraintlogi programming(CLP) and on urrentlogi

pro-gramming. IntheCCparadigm,CLPgoalsare on urrentagents ommuni atingthrough

a ommonstoreof onstraints,ea hagentbeingableto post onstraintstothe store,and

tosyn hronizebyaskingwhetheraguard onstraintisentailedbythestore. Both

theoret-i alreasons on erningthelogi alsemanti sof CClanguages[6,18℄, andpra ti alreasons

on erningtheneedfor anon-monotoni evolutionof thestore[2℄,led toanatural

exten-sionofCClanguageswith onstraintsystemsbasedonLinearLogi (LL)[8℄, alledLinear

Con urrentConstraint (LCC) programming. By interpreting CCagents by LLformulae,

itisindeed possibleto identifyCCoperationaltransitionswithLLdedu tions,and obtain

ompletenesstheoremsfor theobservation oftheset ofa essiblestores,aswellasforthe

setofsu essstores[6℄. ThismeansthatLinearLogi isthelogi ofCCagents. Moreover,

thetheoremsstill holdwhen onsidering onstraintsystemsbasedonLinearLogi instead

of lassi allogi . Froma programmingpoint of view,LL onstraintsystemsare a

rene-mentof lassi al onstraintsystemsallowingforstate hangeandnon-monotoni evolution

ofthe onstraintstore,throughthe onsumptionoflinearlogi tokensbylinearimpli ation

[6,2℄. Thismakesitpossibletoen odeimperativefeaturesin LCCand ombinethemwith

onstraintprogramming.

In this paper, we show that the linear tokens and the bang operator of LCC an be

usedtointernalizeCCde larationsandpro edure allsas onstraintpostingandasking. A

quitegeneralnotionof losure anthenbeen odedasabangedagentwithanenvironment,

de larations orrespondingtothe aseofanemptyenvironment. Theseresultsarethenused

todenetheoperationalsemanti sofmodularLCC(MLCC)languages,wheremodulesare

variables and where implementation hiding is realized with the usual hiding operator for

(7)

InSe tion 4weprovideanequivalentlogi alsemanti swhere modular LCCagentsare

interpretedby linear logi formulae, and prove ompleteness theoremsfor the observation

ofsu essanda essiblestores.

Then in Se tion 5, we derive from the MLCC s heme a powerful module system for

onstraintlogi programming. Weillustratetheexpressiveness ofthismodulesystemwith

examplesof odehiding, losure programmingand module parameterization in CLP, and

dis ussitsimplementationalongthelinesofitssemanti sinLCC.

Finally,we on ludeontheseresultsandontheirgenerality.

Related Work

The proposed internalization of de larations asagentsgoes somewhatin the opposite

di-re tion to that of denition-based logi s, asdes ribed for instan e in [10℄. Here wemake

denitionsrst-orderobje ts,whi h allowsus tomanipulatethemeasily,andtogeneralize

themto losures.

There has been several programming languages developed in Linear Logi using the

Logi Programmingparadigm, likefor instan e LO[1℄, Lolli [12℄ orLygon[11℄. However,

fore ien yreasonsintheselanguages,thereisnoequivalentforthepersistentasks(whi h

wouldbeimpli ationsundera

!

inmostoftheselanguages)andthusnodire ten odingof dynami lauseassertionsaswewilldoinSe t. 2.4.3. Thebangedaskappearsinthere ent

workof[14℄ontheexpressivenessoflinearityandpersisten einpro ess al uliforse urity.

Con erningCClanguages,theimplementationofmoduleshasnotbeenmu hdis ussed,

being onsidered as an orthogonal issue. For instan e, the MOZART-OZ language [15,

4℄ ontainsan ad-ho module system allowing for separate ompilation. Here we provide

a natural integration of module and programming on epts with the limited set of LCC

programming onstru ts.

2 LCC with De laration Agents

Inthisse tion,wegiveapresentationoftheLCClanguageswherede larationsarerepla ed

bybangedasks, whi h we will all persistent ask. This new onstru t a tuallygeneralizes

de larationsintopersistentasksbyallowingvariablestoremainfreeinapersistentaskand

representtheenvironment.

Inthispaper,aset ofvariablesisdenoted by

x

or

y

. Theset offreevariableso urring inaformula

A

is denotedby

fv(A)

,asequen eofvariablesisdenoted by

~x

,

A[~x\~t]

denotes the formula

A

in whi h the free o urren esof variables

~x

havebeen repla edby terms

~t

(with the usual renaming of bound variables, avoiding variable lashes). Fora transition

relation

−→

,

−→

denotesthetransitiveandreexive losureof

−→

. Thetypewriterfont isused forprograms,where, asin lassi alPrologprograms,theidentiersbeginningby a

(8)

2.1 Linear Logi Constraint Systems

The lass of LCC languages essentially extends CC languages by onsidering onstraint

systemsbasedonLinearLogi [8℄insteadof lassi allogi . From aprogrammingpointof

view,thisextensionintrodu esstate hangeandimperativefeaturesin onstraintlanguages.

Were allheretheusualdenitionsofaLinearLogi onstraintsystem(seeforinstan e[6℄).

Denition2.1 (ConstraintLanguage) An atomi onstraintis aformula built froma

set

V

ofvariables,a set

Σ

F

offun tionsymbols andaset

Σ

C

ofrelationsymbols,whi h does not ontain

,theneutralelementsofadditive linear onjun tions. The onstraintlanguage is the least set ontaining all atomi onstraints, marked or not by the unary exponential

onne tive

!

( alledalsobang) and losedbymultipli ative onjun tion (

)andexistential quanti ation(

).

Denition2.2 (ConstraintSystem) Alinear onstraintsystemisapair

(C,

C

)

where:

ˆ

C

isa onstraintlanguage.

ˆ

C

isasubsetof

C × C

whi h denes the non-logi al axiomsof the onstraintsystem. Wesupposethatforallfreevariableso urringin

c

haveafreeo urren ein

c

1

, . . . , c

n

.

Wewillnote

C

theleastsubsetof

C

×C

ontaining

C

and losedbytheofintuitionisti linearlogi ,notedinthe following ILL(seeappendix Afor the ompletesequent al ulus).

Let

C

bea onstraintsystem. Inthefollowing,

T

willbethelanguageofterms(noted

t

,

s

,

. . .

)formedfrom

V

and

Σ

F

.

2.2 Syntax of LCC(

C

)

Thesyntax ofLCC(

C

)is presented herewithoutde larations,onlyagentswith twoforms ofaskagents.

Denition2.3 The syntax ofLCC(

C

)agentsisgiven bythe followinggrammar:

A ::= A || A | ∃x.A | c | ∀~x(c → A) | ∀~x(c ⇒ A)

Asusual

||

standsforparallel omposition,thetellagentaddsa onstraintto thestore,

hidesvariablesinanagentand

standsforask.Thenew onstru t

representsanask operator, alled persistent ask,thatalwaysremainsa tive.

Note thatwedonotprovideanexpli it hoi eoperator,sin ethelo al hoi eoperator

aneasilybeen odedwithlineartokensandaskasfollows:

A + B = ∃x(choice(x) || choice(x) ⇒ A || choice(x) ⇒ B)

This en oding orrespondsto the lassi alen oding of

+

in CLP astwo lauses with the samehead.

(9)

2.3 Operational Semanti s

Asusual,theoperationalsemanti sofLCCisdenedherewithastru tural ongruen eand

atransition relationdened over ongurations.

Denition2.4 (Conguration) A ongurationisatuple

hx; c; Γi

where

x

isamulti-set ofvariables,

Γ

amulti-setof agentsand

c

a onstraint, alledstore.

Denition2.5 Thestru tural ongruen e

istheleast ongruen esatisfyingthefollowing ruleof parallel omposition:

hx; c; A || B, Γi ≡ hx; c; A, B, Γi

Denition2.6 The transition relation

−→

is the least relation satisfying the rules of the table1.

Equivalen e

hx; c; Γi ≡ hx; c

; Γ

i −→ hy; d

; ∆

i ≡ hy; d; ∆i

hx; c; Γi −→ hy; d; ∆i

Tell

c ⊗ d ⊢

C

e

hx; c; d, Γi −→ hx; e; Γi

Ask

c ⊢

C

d ⊗ e

hx; c; ∀~z(d → A), Γi −→ hx; e; A[~s/~z], Γi

Persistentask

c ⊢

C

d ⊗ e

hx; c; ∀~z(d ⇒ A), Γi −→ hx; e; A[~s/~z], ∀~z(d ⇒ A), Γi

Hiding

z 6∈ z ∪ fv(c, Γ)

hx; c; ∃z.A, Γi −→ hx ∪ {z}; c; A, Γi

Table1: Transitionrelation

In order to introdu e the notion of predi ates,

Σ

C

is partitioned into

D

, Σ

D

}

su h that

Σ

D

ontains

1

. Intuitively,

Σ

D

will ontainlineartokenswhi hshouldnotbeobserved, i.e. predi ates. The onstraint languages formed from

Σ

D

and

Σ

D

, are noted

D

and

D

respe tively.

Denition2.7 (Observables) Let

A

beanLCC(

C

)agentsu hthat

h∅; 1; Ai

−→ hx; c; Γi

.

(10)

ˆ the onstraint

∃x.c

isapseudo-su essfor

A

,if

Γ

isamulti-setof persistent asks.

ˆ the onstraint

∃x.d

is a su ess of

A

, if it is a pseudo-su ess for

A

su h that

hx; c; Γi 6−→

.

ˆ asu ess

d

of

A

isa

D

-su essif

d ∈ D

.

Denition2.8 (Operational Semanti s)

ˆ

O

store

(A)

isthe setof a essiblestorefor the agent

A

. ˆ

O

p-s

(A)

isthe setof pseudo-su esses for the agent

A

. ˆ

O

D

-su

(A)

isthe setof

D

-su esses for theagent

A

.

2.4 Examples

The following examples illustrate, rst, how usual de larations are re overedthroughthe

useofpersistentask,andthenhowfreevariablesareusedtoprovideanenvironment.

2.4.1 DiningPhilosophers

The lassi al ben hmark of expressiveness for on urrent languagesis the dining

philoso-phers. Theproblem onsistsof

N

philosopherssittingaroundatable whodonothing but think andeat. Betweenea h ofthem, thereis asinglefork. Inorderto eat,aphilosopher

musthaveboththeforkonhisrightandtheoneonhisleft. Assuggestedin[2℄,thisproblem

hasanextremelysimpleandelegantsolutionin LCC.

An even more ompa t solution is proposed here: the linear onstraint systemin this

exampleisa ombination oftranslationin ILL ofstandardequality onstraintover

N

and oflinear onstraintstoken

f ork/1

and

eat/1

withnoothernon-logi alaxiomsthanequality axioms hema:

c(~x) ⊗ (~x = ~

y) c(~y)

forany onstraintsymbol

c

.

Example(Dining Philosophers)

∀M, N.recphilo(M, N ) ⇒ (

f ork(M ) ||

∀I(f ork(I) ⊗ f ork(I + 1

mod

N ) ⇒ eat(I)) ||

∀I(eat(I) ⇒ f ork(I) ⊗ f ork(I + 1

mod

N )) ||

I 6= N → recphilo(M + 1, N ) )

It isworthnotingthat thephilosophers donotneedtoberelaun hedusing are ursive

(11)

2.4.2 Iterators

A simpleiterator anbeen odedthanks to thepersistentasks. A more ompleteversion

is provided in Se t. 5.5 thanks to themodular onstru ts,whi h allowpassing avariable

asso iatedtoapersistentasksasargumentofaniterator.

Example(Iterator)

f orall([]) ⇒ true ||

f orall([H|T ]) ⇒ arg(H) ⊗ f orall(T ) ||

∀X(arg(X) ⇒ Body) || f orall(L)

Here, the

f orall

persistentask willapply the ode of

Body

( alledthrough

arg

) toall theelementsofthelist

L

.

2.4.3 Dynami ClauseAssertion

In the two previous exampleswe have no de larationsin e in LCC they are repla ed by

persistentasks. However,thisallowsusto gomu h fartherwith forinstan eaverysimple

anddire ten odingofdynami lauseassertions.

Thestraightforwardre ursiveimplementationoftheFibona isequen eisanalgorithm

known tobeparti ularlyine ient, sin eit omputesmany valuesrepeatedly. An elegant

way to improve signi antly the behavior of su h an algorithm is to store intermediary

omputed values using memoization. The omputation falls from exponential to linear

omplexity.

As thefollowingexampleshows,the useof thiste hniqueis verynaturalin LCC.The

mainideaisto usethenaivere ursiveimplementation,and toaddin parallel omposition

withthebodyofthemain agent,thepersistent:

∀F

(f ib(N, F

) ⇒ F

= F ))

in whi h

N

and

F

are free variables, providing an environment. This agent will be in harge of onsuming the (future) alls to

f ib(N

, F

)

asking for the omputation of the

N

th

Fibona i's number, and unify

F

with the result that has already been al ulated,

transmittedthroughthevariable

F

oftheenvironment.

Example(Fibona i):

∀N, F (f ib(N, F ) ⊗ N < 2 ⇒ F = N ) ||

∀N, F (f ib(N, F ) ⊗ N > 1 ⇒ (

∃F

1

, F

2

.(f ib(N − 1, F

1

) ⊗ f ib(N − 2, F

2

) ⊗ F = F

1

+ F

2

) ||

∀F

(f ib(N, F

) ⇒ F

= F ))

Despitethefa tthattheworst omplexityofthisprogramisstillexponential,the hoi e

ofagoodstrategy,forexamplesele tingrstyounger persistentask for onsuminglinear

(12)

From a Logi Programming (LP) point of view, the persistent ask added at the end

of the lause isnothing but adynami lause assertion. Indeed the lassi alProlog

built-in assert(p(X1,...,XN):-Body) ould be interpreted in LCC as the agent

X1,...,XN (p(X1,...,Xn)

Body). Moreover,variablerenamingthatassert/1madetransparently, anbesimplyemulatedbytheexpli itquanti ationprovidedbytheLCCoperator

. LCC thusprovidesatheoreti alframework,witharstorderlogi alsemanti s,todynami lause

assertion in the ontext of LP. It must be noti ed, however, that this implementation of

assert/1isba ktra king,i.e. thattheasserted lausewillberemovedduringtheba ktra k.

This idea of providing an environment through free variables (like

N

and

F

for the last persistent askof the aboveexample) a tually en odes a losure, seenas ode withan

environment. Note however that using only LCC does not prevent outside ode to look

inside the persistent ask, whi h leads us to provide ode prote tion through a system of

modules, seen asrestri tions on the possible s ope of some variables. Moreover, modules

willprovidesimpletoolstoatta havariabletoapersistentask,andthuspermittopassa

persistentaskastheargumentofanother all.

3 Modular LCC

3.1 Modular Constraint Systems

Let

C

bea onstraintsystem. Tointrodu ethe notionofmodules, wesuppose that

Σ

C

is furtherpartitionedinto

G

, Σ

M

}

su hthat

Σ

G

ontains

=

and

1

. The onstraintsformed from

Σ

G

(resp.

Σ

M

)form thelanguage

G

(resp.

M

) ofbuilt-in onstraints(resp. modular onstraints).Possiblybangedatomi onstraintsin

G

and

M

arenoted

g

and

m

respe tively.

c

willbeanotationforany onstraintin

C

.

3.2 Syntax of MLCC(

C

)

Thesyntaxof MLCCextendstheoneof LCCwithalo alization operator ofanagentis a

module:

Denition3.1 The syntax ofMLCC(

C

) agentsisgiven by the following grammar:

A ::= t{A} | t : c | A || A | ∃x.A | ∀~x(c → A) | ∀~x(c ⇒ A)

Thenew onstru ts

t{A}

standsforthelo alizationofagent

A

inthemodule

t

. Thetell agenthasnowanewform:

t : c

, orrespondingintuitivelytoaddingthe onstraint

c

of

C

in themodulenamedbytheterm

t

of

T

.

3.3 Modular Constraints

(13)

Denition3.2 (Modular Store) Aprexed onstraintm

= t : m

isanatomi onstraint (possiblybanged)

m

of

M

prexedbyaterm

t

of

T

,

t : m

willbeanotationfor

t : m

1

, . . . , t : m

k

if

m = m

1

, . . . , m

k

.

A modular store is a formula

∃x.(g|

m

)

where

g

is a onjun tion of onstraints of

G

withoutquanti ationand mamulti-setofprexed onstraints.

Inthe followingwewill use, ordto note modular storesand1 to notethe modular

emptystore

(1|∅)

.

Denition3.3 Wedene anorderonmodular storesas follows:

transitivity

>

C

d d

>

C

>

C

substitution

g ⊢

C

t = t

⊗ g

∃x.(g|

m

, t : m) >

C

∃x.(g

|

m

, t

: m)

entailment

g ⊗

N m ⊢

C

g

N m

∃x.(g|

m

, t : m) >

C

∃x.(g

|

m

, t : m

)

By abuse of notation, we extend the tensor produ t of linear onstraints to modular

stores:

Denition3.4 The onjun tion of twomodular stores

= ∃x.(g|

m

)

and

= ∃x

.(g

|

m

)

isthe store

(

) = ∃x, x

.(g ⊗ g

|

m

,

m

)

if

x ∩ x

= ∅

.

Lemma3.5(Monotoni ityof

) For all modular stores , d and d

if d

>

C

d

then

d

>

C

d

Proof: Byindu tionontheproof

π

of

(g

|

m

) >

C

(g

′′

|

m

′′

)

weprovethat

(g ⊗ g

|

m

,

m

) >

C

(g ⊗ g

′′

|

m

,

m

′′

)

. Inthis proof wesuppose that allm's arenotempty, ifitis notthe ase,

justre allthat

c ⊗ 1 ⊢ c ⊢ c ⊗ 1

.

ˆ

π

endswithtransitivity: trivial.

ˆ

π

endswithsubstitution:

g

C

t = t

⊗ g

′′

∃x.(g

|

m

, t : m) >

C

∃x.(g

′′

|

m

, t

: m)

Thank to

-left rule, we infer that

g ⊗ g

C

g ⊗ t = t

⊗ g

′′

and then on lude

immediately.

ˆ

π

endswithentailment:

g

N m

C

g

′′

N m

′′

∃x.(g

|

m

, t : m

) >

C

∃x.(g

′′

|

m

, t : m

′′

)

(14)

Thankto

-leftrule, weinferthat

g ⊗ g

O

m

C

g ⊗ g

′′

O

m

′′

,andhen e on lude.



3.4 Operational Semanti s

Wewillnowprovideapre iseoperationalsemanti s toMLCC,basedasusualonanotion

of onguration,throughatransition relationandastru tural ongruen e.

Denition3.6 (Conguration) A ongurationisatuple

hx; ∃y.(g|

m

); Γi

where

x

isa multi-set of variable,

Γ

a multi-set of lo alized agents and

∃y.(g|

m

)

a modular store su h

that

y ∩ fv(Γ, x) = ∅

Denition3.7 Thestru tural ongruen e

istheleast ongruen esatisfyingthefollowing ruleof parallel omposition:

hx;

; t{A || B}, Γi ≡ hx;

; t{A}, t{B}, Γi

Denition3.8 Thetransitionrelation

−→

istheleastrelationsatisfyingtherulespresented inthe table 2.

Thisoperationalsemanti senjoysthesamekindofpropertiesastheoriginalLCC

oper-ationalsemanti s.

Proposition 3.9(Monotoni ity) For every derivation

δ = ((x;

; Γ)

−→ (x

;

; Γ

))

,

thereexists

y

freein

δ

,

,andamodularstoredsu has

(x, y;

d

; Γ, ∆)

−→ (x

, y;

d

; Γ

, ∆)

.

Proof: Byindu tiononthederivation

δ

:

ˆ Forequivalen eitistrivial.

ˆ For tell just note that thanks to the monotoni ity of

, if

c ⊗ ∃y.(g|

m

) >

C

then

c ⊗ ∃y.(g|

m

) ⊗

d

>

C

d.

ˆ Foraskandpersistentasknotethatthankstothemonotoni ityof

,if

>

C

∃y.(g|

m

, t :

m)

and

d >

C

∃y

.(g

|

m

)

then

d

>

C

∃y, y

.(g ⊗ g

|

m

,

m

, t : m)

andthat if

N g ⊗

N m ⊢ N g

′′

N m

′′

⊗ d[~s/~z]

then

N(g ⊗ g

) ⊗

N m ⊢ N(g

′′

⊗ g

) ⊗

N m

′′

⊗ d[~s/~z]

ˆ Forhiding onejust usethe

α

- onversionto besurethat

y

isfreein

δ

.

ˆ Forotherrulesnoti ethatthey anbedonein

(x y;

d

; Γ, ∆)

sin etheydonothave onditionaboutthehiddenvariablesorthestore.

(15)

Equivalen e

hx;

; Γi ≡ hx;

; Γ

i −→ hy;

d

; ∆

i ≡ hy;

d

; ∆i

hx;

; Γi −→ hy;

d

; ∆i

Modularize

hx;

; t{s{A}}, Γi −→ hx;

; s{A}, Γi

Tell

d ⊢ ∃y.(g ⊗

N m)

⊗ ∃y.(g|t : m) >

C

hx;

; s{t : d}, Γi −→ hx;

; Γi

Ask

> ∃y.(g|

m

, t : m)

g ⊗

N m ⊢ g

N m

⊗ d[~s/~z]

hx;

; t{∀~z(d → A)}, Γi −→ hx; ∃y.(g

|

m

, t : m

); t{A[~s/~z]}, Γi

PersistentAsk

> ∃y.(g|

m

, t : m)

g ⊗

N m ⊢ g

N m

⊗ d[~s/~z]

hx;

; t{∀~z(d ⇒ A)}, Γi −→

hx; ∃y.(g

|

m

, t : m

); t{A[~s/~z]}, t{∀~z(d ⇒ A)}, Γi

Hiding

z 6∈ x ∪ fv(

, Γ, t)

hx;

; t{∃z.A}, Γi −→ hx ∪ {z};

; t{A}, Γi

Table2: Transitionrelation



TheobservablesofinterestforMLCCaredenedaspreviouslybyrepla ing onstraints

bymodularstores,wheregenerally,

D

is hosenequalto

G

:

Denition3.10(Observables) Let

A

beanMLCC(C)agentsu hthat

h∅;

1

; x{A}i

−→

hy;

; Γi

forsome

x 6∈ fv(A)

.

ˆ the modular store

∃y.

isan a essiblestorefor

A

.

ˆ the modularstore

∃y.

isapseudo-su essfor

A

,if

Γ

isamulti-setofpersistentasks.

ˆ the modular store

∃y.

is a su ess of

A

, if it is a pseudo-su ess for

A

su h that

hy;

; Γi 6−→

.

ˆ The modular store

∃y.(g|

m

)

is a

D

-su ess for

A

, if it is a su ess for

A

su h that

m

= ∅

and

∃y.g ∈ D

3.5 Example: Beyond Dining Philosophers

LetusimproveontheexampleofSe t. 2.4.1inordertodemonstratetheexpressivepower

(16)

Themodule onstru tsallowtoextendthediningphilosophers'exampletoabanquet

of several tables of philosophers, where ea h table is an independent module. The

orre-spondingMLCCagentbelow reates

N

tablesof

P

philosophers:

Example(Banqueting Philosophers).

banquet{

∀I, N, P.recT able(I, N, P ) ⇒

∃T able.T able{

∀J.recP hilo(J) ⇒ (

T able : f ork(J) ||

f ork(J) ⊗ f ork(J + 1

mod

P ) ⇒

T able : eat(J) ||

eat(J) ⇒

T able : (f ork(J) ⊗ f ork(J + 1

mod

P )) ||

J 6= P → T able : recP hilo(J + 1) ) ||

T able : recP hilo(0)

} ||

I 6= N → banquet : recT able(I + 1, N, P )

}

Sin e the logi al semanti s of MLCC enjoys the same orre tion properties than that

ofLCC(seetheorem 4.4below),thephasesemanti sof LinearLogi anbeusedto prove

safetypropertiesinwaysimilarto[6℄,su hasforinstan ehere,thatnophilosopher anuse

aforkbelongingtoanothertable.

3.6 Code Prote tion

One important feature of a module system is its apability to hide implementations and

guaranteetheprote tionofmodule ode. InMLCC,the odeprote tionpropertymeansthat

ifamodule

t{∃x(x{A} || B)}

is omposed of aninterfa e

B

and ahiddenimplementation

A

,thenaparallelagent

C

annotaddany onstraintoftheform

x : c

norunblo kanyofits askwithsu ha onstraint. Thisleadstothefollowingproperty:

Proposition 3.11(Code prote tion) Let

A

,

B

and

C

be three MLCC agents, and

t

a term ofT. Let

M = t{∃x(x{A} || B)} || C

If

A

and

B

donot addany onstrainton

x

tothe store ,ex ept those ofthe form

x : c

, then

C

annot add any onstraint of the form

x : c

nor unblo k any of its ask with su ha onstraintinaderivation from

M

.

(17)

Proof: Wewillsupposethat

x

isnotfreein

C

norin . Ifthatisnotthe ase,then

x

(the oneunder the

)will berenamedby

α

- onversioninordertousetheHidingrule.

We thus havea onguration of the form:

(x ∪ {x};

; x{A}, t{B}, C)

, su h that

x 6∈

fv(C,

, t)

. Letus provethat aslongas

A

and

B

donotadd onstraintson

x

ex eptthose

oftheform

x : c

,

x

willremain bound in

C

andthus

C

willnotbeabletotellnorask any

onstrainton

x

. This is indeed enough sin ethe restri tionon

A

and

B

forbids that any ask(resp. tell) onanothertermisunblo kedby(resp. unblo ks)atell(resp. anask)on

x

sin e

x : c

willneverimplya onstraintlike

x = t

with

x

boundin

t

.

We only need to prove this property for one step of derivation, it will then hold for

any nite derivation by indu tion. Let us onsider all the ases of derivation. If

x{A}

or

t{B}

are the hosenagents,then thepropertytriviallyholdssin e

C

didnot hange. If

C

istheagent hosenforderivation, therulesModularizeandTellobviouslydon't hange

anything w.r.t.

x

beingbound in

C

. TheHidingrule mightmakeabound variablefree, but sin ewehave

{x} ∪ x

asrstmemberof our onguration,weknowthat theHiding rule will only apply to another variable. The aseof the Equivalen e rule is treatedby

indu tion onthe equivalent ongurations. Forthe Ask and Persistent Ask rules, the

only risk is that the renaming of the variables under

repla es some of them by aterm ontaining

x

. Howeverrememberthattheonlyrepla ementhappensonvariablesappearing in alineartoken

d

, when

⊗ d[t(x)/y]

. Fromthelemmabelowand knowingthat

x

is boundin , theaboveimpli ationwith

x

freein

t

isimpossible,i.e.

x

remainsbound after

anAskoraPersistent Askrule.



Lemma3.12 If

x ∈ fv(m)

su has

m

is lineartokenand

c ⊢

C

m ⊗ d

then

x ∈ fv(c)

Proof: Byindu tionontheproof

π

of

c ⊢

C

m ⊗ d

where

d

isanarbitrary onstraint. Just re all that we havesupposed in thedenition of

C

that all freevariables o urring in the righthandsideofanon-logi alaxiomappearsinitslefthand side.



4 Logi al Semanti s

Onestrikingfeature ofLCC languagesistheirsimplesemanti sin LinearLogi [6, 16, 18℄

allowingforvariousproofmethods omingfromLinearLogi . Inthisse tion,wegeneralize

the results of [6℄ to the ri her fragment of LL ontaining banged impli ations as used in

MLCCprograms.

Denition4.1 In amodule

t

, onstraints,agentsandstorearetranslatedintoformulasin the following way (inthe following wesupposewith nolossof generality that

x 6∈ fv(t)

and

x ∩ fv(t) = ∅

):

(c ⊗ d)

t

= c

t

⊗ d

t

(∃x.c)

t

= ∃x.c

t

g(s

1

, . . . , s

n

)

t

= g(s

1

, . . . , s

n

)

(!c)

t

=!c

t

m(s

1

, . . . , s

n

)

t

= ˙

m(t, s

1

, . . . , s

n

)

(18)

(∃x.A)

t

= ∃x.A

t

s{A}

t

= A

s

(s : c)

t

= c

s

(A || B)

t

= A

t

⊗ B

t

(∀x(c → A))

t

= ∀x(c

t

⊸ A

t

)

(∀x(c ⇒ A))

t

=!∀x(c

t

⊸ A

t

)

For any multi-set

Γ = (γ

1

, . . . , γ

n

)

of agents or prexed onstraints we dene

Γ

t

=

γ

1

t

⊗ · · · ⊗ γ

n

t

and

t

= 1

. Finally agents, Stores and Congurations are translated into

formulaeinthe following way,where

x ∈ fv(A,

, Γ)

:

∃y. (g|

U

i

{t

i

: m

i

})

= ∃y.



g ⊗

O

i

m

i

t

i



A

= A

x

hy;

; Γi

= ∃y.(

⊗ Γ

x

)

(C

,

C

)

is the onstraint system formed from

G

⊎ ˙Σ

M

)

,

Σ

T

and

V

su h that i

c

1

, . . . , c

n

C

c

then

c

x

1

, . . . , c

x

n

C

c

x

with

x 6∈ fv(c, c

1

, . . . , c

n

)

and that for all

m ∈ ˙

˙

Σ

M

˙

m(x, ~z), !x = y ⊢

C

m(y, ~z)

˙

.

Lemma4.2 Let

Γ

be asequen eof onstraints,

c

be a onstraintand

x

be a variable free in

Γ

and

c

,if

Γ ⊢

C

c

then

Γ

x

C

c

x

.

Proof: Byindu tionontheproofof

Γ ⊢

C

c

.



Lemma4.3(Soundness of

>

C

) Forallmodularstores anddif

>

C

dthen

C

d

.

Proof: Aspreviouslywesupposethatall

g

'sandallm'sarenotempty,ifitisnotthe ase thatjust re allthat

c ⊗ 1 ⊢ c ⊢ c ⊗ 1

.

Byindu tionontheproof

π

of

>

C

d: ˆ

π

endswithtransitivityrules:

>

C

>

C

d

>

C

d Byindu tion hypothesis,

C

′†

and

′†

C

d

,then thanksto ut rule,wehave

C

d

.

ˆ

π

endswithsubstitution:

g ⊢

C

t = t

⊗ g

∃x.(g|

m

, t : m) >

C

∃x.(g

|

m

, t

: m)

g ⊢

C

t = t

⊗ g

g ⊢

C

t = t

⊗ g

l4.2

g ⊗ m

t

C

t = t

⊗ g

⊗ m

t

-r

x = y

⊗ m

x

C

m

y

t = t

⊗ m

t

C

m

t

g ⊗ m

t

C

g

⊗ m

t

ut

(19)

ˆ

π

endswithentailment:

g ⊗

N m ⊢

C

g

N m

∃x.(g|

m

, t : m) >

C

∃x.(g

|

m

, t : m

)

g ⊗

N m ⊢

C

g

N m

g ⊗

N m

t

C

g

N m

′t

l 4.2

g ⊗

N

m

N m

t

C

g

N

m

N m

′t

-R

∃x.(g ⊗

N

m

N m

t

) ⊢

C

∃x.(g

N

m

N m

′t

)



Theorem4.4(Soundness) Let

κ

and

κ

betwo ongurations. If

κ ≡ κ

then

κ

⊣⊢

C

κ

′†

If

κ

−→ κ

then

κ

C

κ

′†

Proof: Byindu tionon

and

−→

:

ˆ forparallel omposition,equivalen eandmodularizeitisimmediate;

ˆ forhiding,

∃x.(A ⊗ B) ⊣⊢ A ⊗ ∃x.B

and

∃x.A ⊣⊢ A

if

x 6∈ fv(A)

;

ˆ fortell:

d ⊢ g ⊗

N

m

⊗ (g|

m

) >

C

hx;

; s{t : d}, Γi −→ hx;

; Γi

d ⊢

C

g ⊗

N m

d

t

C

g ⊗

N m

′t

l4.2

⊗ (g|

m

) >

C

⊗ g ⊗

N m

′t

C

′†

l4.3

⊗ d

t

C

′†

cut

∃x.(

⊗ d

t

⊗ Γ

) ⊢

C

∃x.(

′†

⊗ Γ

)

∃, ⊗

ˆ forask:

>

C

∃y.(g|

m

, t : m) g ⊗

N m ⊢

C

g

N m

⊗ d[~s/~z]

hx;

; t{∀~z(d → A)}, Γi −→

hx; ∃y.(g

|

m

, t : m

); t{A[~s/~z]}, Γi

Firstof allnoti ethatif

y ∩ fv(t) = ∅

then

(A[s/y])

t

= A

t

[s/y]

. Nowlet

= (g|

m

, t :

m)

,

′′

= (g

|

m

, t : m

)

and

B = (d

t

⊸ A

t

)

.

π

1

=

g ⊗

N m ⊢

C

g

N m

⊗ d[~s/~z]

g ⊗

N m

t

C

g

N m

′t

⊗ d

t

[~s/~z]

l4.2

′†

C

′′†

⊗ d

t

[~s/~z]

(20)

π

2

=

>

C

∃y.

C

∃y.

′†

l4.3

π

2

π

1

′′†

⊗ d

t

[~s/~z], B[~s/~z] ⊢

C

′′†

⊗ A

t

[~s/~z]

⊗,

′†

, B[~s/~z], ⊢

C

′′†

⊗ A

t

[~s/~z]

ut

, ∀z.B, ⊢

C

∃y.

′′†

⊗ A

t

[~s/~z]

∃, ∀

∃y.

′†

, ∀z.B, ⊢

C

∃y.

′′†

⊗ A

t

[~s/~z]

ut

∃x.(

⊗ ∀z.B ⊗ Γ

) ⊢

C

∃x.(∃y.

′′†

⊗ A

t

[~s/~z] ⊗ Γ

)

∃, ⊗

ˆ forpersistentask:

> ∃y.(g|

m

, t : m)

g ⊗

N m ⊢ g

N m

⊗ d[~s/~z]

hx;

; t{∀~z(d ⇒ A)}, Γi −→

hx; ∃y.(g

|

m

, t : m

); t{A[~s/~z]}, t{∀~z(d ⇒ A)}, Γi

Byusingthepreviousnotationfor

,

′′

and

B

wehave:

, ∀z.B, !∀z.B, Γ

C

⊗ ∀z.B⊗!∀z.B ⊗ Γ

, !∀z.B, Γ

C

⊗ ∀z.B⊗!∀z.B ⊗ Γ

!

∃x.(

⊗!∀z.B ⊗ Γ

) ⊢

C

∃x.(

⊗ ∀z.B⊗!∀z.B ⊗ Γ

)

∃, ⊗

Byusingtheresultoftheprevious asewe an on lude.



Lemma4.5(Completeness of

>

C

) For all modular stores and d, if

C

d

then

>

C

d. Proof: Let

()

−†

be a partial translation of multi-sets of onstraints into non quantied

storesdened asfollow:

g

−†

=

(g|∅)

m(t, ~s)

˙

−†

=

(∅|t : m(~s))

(!g)

−†

=

(!g|∅)

(! ˙

m(t, ~s))

−†

=

(∅|!t : m(~s))

(c ⊗ c

)

−†

=

c

−†

⊗ c

′−†

(Γ, ∆)

−†

=

Γ

−†

⊗ ∆

−†

First weprovetheintermediary result: foreverymulti-setof onjun tionsof onstraints

Γ

andevery onjun tionof onstraints

d

if

Γ ⊢

C

d

then

Γ

−†

>

C

d

−†

. Weprovethisresultby indu tionontheproof

π

ofthesequent

Γ ⊢

C

d

. ˆ

π

isanaxiomoftheform

Γ

x

C

d

x

su has

Γ ⊢

C

d

: let

x

)

−†

= (g|x : m)

and

(d

x

)

−†

= (g

|x : m

)

. Nowjust usethe entailmentrule to

(21)

ˆ

π

is an axiom of the form

m(x, ~z), x = y ⊢

˙

C

m(y, ~z)

˙

: in su h a ase just use the

substitutionrule.

ˆ

π

endswith ut:

Γ ⊢

C

c

c, ∆ ⊢

C

d

Γ, ∆ ⊢

C

d

Byindu tionhypothesis,

Γ

−†

>

C

c

−†

and

c

−†

⊗ ∆

−†

>

C

d

−†

. Thankstomonotoni ity of

(lemma3.5)and usingthetransitivityrulewe an on ludethat

Γ

−†

⊗ ∆

−†

>

C

d

−†

.

ˆ

π

endswith

-left: trivial

ˆ

π

endswith

-right:

Γ ⊢

C

c

∆ ⊢

C

d

Γ, ∆ ⊢

C

c ⊗ d

Byindu tion hypothesis

Γ

−†

>

C

c

−†

and

−†

>

C

d

−†

. Byusingthemonotoni ityof

(lemma 3.5)wehave

Γ

−†

⊗ ∆

−†

>

C

c

−†

⊗ ∆

−†

and

c

−†

⊗ ∆

−†

>

C

c

−†

⊗ d

−†

. By usingthetransitivityrulewehavenally

Γ

−†

⊗ ∆

−†

>

C

c

−†

⊗ d

−†

.

ˆ

π

endswithoneofthefourrulesfor

!

: Justnoti ethatthefourfollowingsequentsare true:



c ⊗ d ⊢ c⊗!d

fordereli tion;



!c ⊢ c

forpromotion;



c ⊢ c⊗!d

forweakening;



c⊗!d⊗!d ⊢ c⊗!d

for ontra tion.

Nowitis easy toproveby anindu tion on that for everynonquantied store , we

have

(

)

−†

. Hen eweprovetheresultonnonquantiedstore. Fromherewe an on lude

easilybynotingthat if

c ⊢ d

then

∃x.c ⊢ ∃x.d



Lemma4.6 Forany onstraint

c

of

C

,thereexistsasetofvariables

x

notfreein

c

and on-straintwithoutquanti ation

g

of

G

andamulti-setof atomi onstraints(possiblybanged)

m

of

M

su hthat

c ⊣⊢ ∃x.g ⊗

N m

Proof: Byindu tionon

c

:

ˆ

c

isanatomi onstraint(possiblybanged)of

G

: trivial.

ˆ

c

isanatomi onstraint(possiblybanged)of

M

:

c ⊣⊢ 1 ⊗ c

.

ˆ

c = c

⊗ c

′′

: By indu tion hypothesis we have

c

⊣⊢ ∃x

.(g

N m

)

and

c

′′

⊣⊢

∃x

′′

.(g

′′

N m

′′

)

. We ansuppose withoutlost ofgeneralitythat

x

∩ fv(c

′′

) = ∅

and

x

′′

∩ fv(c

) = ∅

(22)

ˆ

c = ∃x

.c

: trivial.



Lemma4.7 For any multi-set of agents

t

1

{A

1

}, . . . , t

k

{A

k

}

and any onstraint

c

, if

A

t

1

1

. . . A

t

k

k

C

c

thenthereexistsaderivation

(∅;

1

; t

1

{A

1

}, . . . , t

k

{A

k

})

−→ (x;

; !Γ)

where

C

c

and

isasequen e ofpersistentasks ,thevariables

x

are freein

c

.

Proof: Letus provethe result,by indu tion onthe sequent

A

t

1

1

, . . . , A

t

k

k

C

c

wherethe

A

i

's areagentsand

c

a onstraint. Weshall onsider withoutlossof generality, that in

π

theleft introdu tion of

and of

are always onse utive(if itis not the ase, therules anbe permuted toobtain su h aproof, see forexample[7℄, notingthat thepromotion is

theonly aseof unpermutability with

-leftappearsonly in the onstraintpart, theright sideofthesequent,andthus neverbellowa

-right).

First remark that this indu tion is meaningful. Indeedthe only utswhi h annot be

eliminatedinanILLproofdealwithnon-logi alaxioms,sotheyareofoneofthefollowing

form:

Γ

C

c

c ⊢

C

d

Γ

C

d

c ⊢

C

c

Γ

, c

C

d

Γ

, c ⊢

C

d

Hen e theappli ationof the utruleintrodu essequentsin whi h thenewformulaonthe

rightis alwaysa onstraint. Ontheother hand theformulaeontheleft hand sideremain

sub-formulaeoftranslationofagents.

Oneremarks also that

(A

t

)

s

= A

t

and

s{t{A}} −→ A

t

hen ewe ansuppose without

lostofgeneralitythatall

A

i

'sarenotoftheform

t

i

{A

i

}

. Byindu tionontheproof

π

of

A

t

1

1

, . . . , A

t

k

k

C

c

: ˆ

π

is an axiom:

c ⊢

C

d

. Sin e

c

is a onstraint,

Γ

is of the form

t{s : c

}

su h that

c

′s

= c

. Let

= ∃y.(g|s : m)

su hthat

∃y.(g⊗N m) ⊣⊢ c

(weknowitispossiblethanks

to thelemma4.6). Thenwehave,byusingtheruletell,

(∅;

1

; t{s : c

}) −→

(∅;

; ∅)

andbyusingthelemma4.2

C

c

. ˆ

π

endswitha ut:

Γ

⊢ c

c ⊢ d

Γ

⊢ d

or

c

1

⊢ c

2

Γ

, c

2

⊢ d

Γ

, c

1

⊢ d

Theformer aseisimmediate. Inthelattertherearetwopossiblesub- asestheaxiom

iseitheroftheform

c

′x

1

C

c

′x

2

su h

c

1

C

c

2

oroftheform

x = y ⊗ ˙

m(x, ~t) ⊢

C

m(y, ~t)

˙

.

Byyindu tionhypothesisweknowthat

(∅;

1

; Γ, c

2

)

−→ (x;

d

; !Γ

)

su hthat

∃x.

d

C

d

. Justnoti ethattheappli ationofthetellrulethatredu estheagent orresponding to

c

2

anbeapplied on

c

1

sin e

c

1

C

c

2

and

⊗ ((x = y)|x : m(~t)) ⊢ c

⊗ (∅|y : m(~t))

.

ˆ

π

endswith

1

-left: notethat

(∅;

1

; t{s : 1}, Γ) −→

(∅;

(23)

ˆ

π

endswitha

-left:

Γ

, A ⊗ B ⊢

C

c

Γ

, A, B ⊢

C

c ⊗ d

 either

B ⊗ B

isthe translationa parallel omposition of twoagents, in su h a

aseone anusetheparallel ompositionrule.

 or

B ⊗ B

isthetranslationofa onstraintoftheform

t : (d ⊗ d

)

,insu ha ase

just noti e that

(∅;

1

; x{t : (d ⊗ d

)}, Γ)

and

(∅;

1

; x{t : d}, x{t : d

}, Γ)

havethe

samepseudo-su esses.

ˆ

π

endswitha

-right:

Γ

C

c

∆ ⊢

C

d

Γ

, ∆

C

c ⊗ d

Byindu tionhypothesis,weknowthereexistsaderivation

(∅;

1

; Γ)

−→ (x;

; !Γ

)

and

(∅;

1

; ∆)

−→ (y;

d

; !∆

)

su h

∃x.

C

c

and

∃y.

d

C

d

. Thankstothemonotoni ity of

−→

we an infer that

(∅;

1

; Γ, ∆)

−→ (x;

; !Γ

, ∆)

−→ (x, y;

d

; !Γ

, !∆

)

. To

on ludewejustnoti ethata ordingtoindu tionhypothesis,

∃x y.(

d

)

C

c ⊗ d

if

x ∩ fv(

d

, d) 6= ∅

and

y ∩ fv(

, c) 6= ∅

.

ˆ

π

endswith

-right: immediate

ˆ

π

endswith

-left:

Γ

, A

t

C

c

Γ

, ∃x.A

t

C

c

Byindu tion hypothesis, wehave

(∅;

1

; t{A}, Γ)

−→ (y;

; !Γ

))

with

∃y.

C

c

. As we an suppose without lost of generality

x 6∈ y ∩ fvΓ

(sin e we work modulo

α

- onversation)andas

(∅;

1

; t{∃x.A}, Γ)

−→ (x;

1

; t{A}, Γ)

,bymonotoni ityof

−→

we have

(∅;

1

; t{∃x.A}, Γ)

−→ (x, y;

; !Γ

)

. Be ause

x 6∈ fv(c)

and

∃y.

C

c

, we have

∃x.∃y.

C

c

ˆ

π

endswith(thankstothepreliminaryremarksonthepermutabilityofrules):

Γ

C

d

t

[~s/~z]

, A

t

[~s/~z] ⊢

C

c

Γ

, ∆

, d

t

[~s/~z] ⊸ A

t

[~s/~x] ⊢

C

c

Γ

, ∆

, ∀~z.(d

t

⊸ A

t

) ⊢

C

c

Byindu tion hypothesis wehave

(∅;

1

; Γ)

−→ (y;

d

; !Γ

)

su h that

∃y.

d

C

d

t

[~s/~z]

.

Bylemma4.6weknowalsothereexistsa onstraint

∃x

.(g ⊗

N m)

su hthat

∃x

.(g ⊗

N m) ⊣⊢ d[~s/~z]

andthenbylemmas4.2and4.5weinferthatd

>

C

∃x

.(g|t : m)

. Thus

byusingthemonotoni ityof

−→

andbyapplyingtheaskrule,onehas

(∅;

1

; t{∀~z(c →

A)}, !Γ)

−→ (x;

d

; t{∀~z(c → A)}, !Γ

) −→ (x;

1

; Γ

, t{A[~s/~z]})

. Moreoverbyindu tion

(24)

hypothesis,

(∅;

1

; t{A[~s/~z]}, ∆)

−→ (y;

; !∆

)

with

∃y.

C

c

, hen e by using on e againthemonotoni ityof

−→

weinfer

(∅;

1

; Γ, ∆, t{∀~z(c → A)})

−→ (x, y;

; !Γ

, !∆

)

. As

∃y

′′

y.

C

c

if

∃y.

C

c

and

y

′′

∩ fv(c) = ∅

we an on lude.

ˆ

π

endswithadereli tion. Thankstothepreliminaryremarksonthepermutabilityof rulesthereareonlytwosub- ases:

Γ

, d

t

C

c

Γ

, !d

t

C

c

or

Γ

, ∀~z.(d

t

⊸ A

t

) ⊢

C

c

Γ

, !∀~z.(d

t

⊸ A

t

) ⊢

C

c

In the former ase, it is lear, just re all that

!c ⊢ c

. In the latter by indu tion hypothesis,

(∅;

1

; Γ, t{∀~x(d → A)})

−→ (y;

; !Γ

)

, with

∃y.

C

c

. Therefore by repla ingin thepreviousderivationtheaskrulethatredu e the

t{∀~x(d → A)}

agent (this redu tionisne essary, otherwise

would notbeasequen e ofpersistentasks

only), bythe persistent ask ruleweobtain

(∅;

1

; t{∀~x(d ⇒ A)}, Γ)

−→ (y;

; ∀~x(d ⇒

A)}, !Γ

)

. Theresultisthenimmediate.

ˆ

π

endswithapromotion:

C

!c

C

c

By indu tion hypothesis,

(∅;

1

; !Γ)

−→ (y;

; !Γ

)

with

∃y.

C

c

. Just re all that

!c ⊢ c

to on lude.

ˆ

π

endswithaweakening:

Γ

C

c

Γ

, !d

t

C

c

or

Γ

C

c

Γ

, !∀x(d

t

⊸ A

t

) ⊢

C

c

In the former ase it is enough to noti e that

(∅;

1

; s{t :!d}, Γ)

−→ (∅;

1

; Γ)

sin e

!d

t

⊢ 1

. In thelatteronejust remarks thattheaddition ofsomepersistent asksto a

multi-setofanagentdoesnot hange itspseudo-su esses.

ˆ

π

endswitha ontra tion:

Γ

, !d

t

, !d

t

C

c

Γ

, !d

t

C

c

or

Γ

, !∀x(d

t

⊸ A

t

), !∀x(d

t

⊸ A

t

) ⊢

C

c

Γ

, !∀x(d

t

⊸ A

t

) ⊢

C

c

Intheformer,just note thatford su h thatd

⊣⊢!d

t

(thatispossiblethankstothe

lemma 4.6),wehave

!d

t

d

d

. Inthelatterhavingtwoo urren esoftheagent

∀z(d ⇒ A)

doesnot hange anything, sin eall onstraint onsumedbytwoidenti al

(25)



Now,forasetSof onstraintof

C

,letus note

↓ S = {c ∈ C

|∃d ∈ S, d ⊢

C

c}

Proposition 4.8(Observationof pseudo-su esses) ForeveryMLCC(C)agent

A

,we have:

↓ (O

p-s

(A)

) = {c ∈ C

| A

C

c}

Proof: Onein lusionisobviousbyapplyingthesoundnesstheoremandbynotingthatfor

!Γ, c ⊢ c

. Theotherisadire t onsequen eofthepreviouslemma.



Theorem4.9(Observationof stores) For everyMLCC(C)agent

A

,wehave:

↓ (O

store

(A)

) = {c ∈ C

| A

C

c ⊗ ⊤}

Proof: Onein lusion is stillobviousby applyingthe previoustheorem 4.4and by noting

that

Γ, c ⊢ c ⊗ ⊤

. For the other in lusion use the previous proposition, above the right

introdu tionofthetensor onne tivein

c ⊗ ⊤

andnotethatthepropertyispreservedbyall

leftintrodu tionrules.



Be ause ourtranslationofMLCCagentsimpliestheuseof bangs(!) forthepersistent

asks,wearenotabletoexa tly hara terizenal stores(and hen esu esses). Indeedthe

rule of weakeningfor the ! allows forgetting a formula orresponding to apersistent ask

beforeit onsumesany onstraintsit ould. Nonethelessbysupposingsomepropertiesover

the onstraints onsumedbythepersistentasks,we an hara terizepre iselyaninteresting

subsetofsu esses.

Denition4.10(

D

-over agent) An agent is

D

-over if no guard

c

of its persistent asks belongsto

D

.

Denition4.11(

D

-proof system) We willsay that

C

isa

D

-proof onstraintsystem, if for any onstraint

d

of

D

andany onstraint

c

of

C

wehave:

if

d ⊢

C

c ⊗ ⊤

then

c ∈ D

Theorem4.12(Observation of

D

-su ess) For any

D

-over agent

A

,if

C

isa

D

-proof systemwe have:

↓ (O

D

-su

(A)

) = {d ∈ D | A

C

d}

Proof: One in lusion is obvious. Thank to the proposition 4.8, we know that for

ev-ery onstraint

d

of

D

, there exists a derivation

(∅;

1

; x{A})

−→ κ = (y;

d

; t

1

{∀z

1

(c

1

A

1

)}, . . . , t

k

{∀z

k

(c

k

⇒ A

k

)})

su h that

∃y.

d

C

d

. Now toprovetheother in lusion,we justneedtoprovethatsu ha

κ

isirredu ible.

First note that if

C

is

D

-proof, then

C

is

D

-proof too. Then let us suppose that

κ

is redu ible,inotherwordthereexistsapersistentask

t

i

{∀z

i

(c

i

⇒ A

i

)}

(

1 ≤ i ≤ k

)in

κ

su h

thatd

>

C

∃z.(g|

m

, t

i

: m)

and

g ⊗

N m ⊢

C

g

N m

⊗ c

i

[~s/~

z

i

]

. Thankstolemma 4.3,we have

∃z.(g ⊗

N

m

⊗ m

t

i

) ⊢

C

c

andthen, sin e

C

is

D

-proof,weinferthat

g ∈ D

,m

= ∅

and

m = ∅

. Hen e we have

g ⊗ 1 ⊢

C

c

i

[~s/~

z

i

] ⊗ ⊤

whi h ontradi ts thehypotheses,sin e

Références

Documents relatifs

La mise en place du plan de vigilance impliquerait des sociétés françaises qu’elles imposent à leurs entreprises partenaires des normes plus exigeantes, compatibles

C'est pour cette raison que L'Algérie a déployé les moyens pour l'enseignement préparatoire pour les préscolaire et compte généraliser l'opération pour tout enfant ayant

Le 18 juin 1997, par requeˆte unilate´rale fonde´e sur l’article 584 du Code judi- ciaire, les e´poux Depus-Festraets demandent au Pre´sident du tribunal de premie`re instance

The contributions of the this paper are four-fold (1) the defini- tion of an elegant lcc semantics of AP for an object oriented con- current programming language; (2) the definition

We represent these equations by a timed concurrent constraint (ntcc) language, which can deal with partial information and the time for a reaction to occur.. We describe a

The new calculus called Universal Timed Concurrent Constraint (utcc) increases the expressiveness of tcc languages allowing infinite behaviour and mo- bility.. the later can be

The distinctive confluent nature of this fragment is necessary for showing that our notion of bisimilarity coincides with the observational equivalence for infinite ccp processes

on Principles and Practice of Con- straint Programming (CP’95), volume 976 of Lecture Notes in Computer Science, pages 362–379. Abstracting synchronization in con- current