• Nenhum resultado encontrado

On concurrent behaviors and focusing in linear logic

N/A
N/A
Protected

Academic year: 2021

Share "On concurrent behaviors and focusing in linear logic"

Copied!
19
0
0

Texto

(1)

Contents lists available atScienceDirect

Theoretical

Computer

Science

www.elsevier.com/locate/tcs

On

concurrent

behaviors

and

focusing

in

linear

logic

Carlos Olarte

a

,

,

Elaine Pimentel

b

,

aEscoladeCiênciaseTecnologia,UniversidadeFederaldoRioGrandedoNorte,Natal,Brazil bDepartamentodeMatemática,UniversidadeFederaldoRioGrandedoNorte,Natal,Brazil

a

r

t

i

c

l

e

i

n

f

o

a

b

s

t

r

a

c

t

Articlehistory: Received12July2015

Receivedinrevisedform17August2016 Accepted23August2016

Availableonline20September2016 Keywords:

Linearlogic

Concurrentconstraintprogramming Proofsystems

Focusing Multi-focusing Fixedpoints

ConcurrentConstraintProgramming(CCP)isasimpleandpowerfulmodelofconcurrency where processesinteract by telling and asking constraints intoaglobal store ofpartial information.Sinceitsinception,CCPhasbeenendowedwithdeclarativesemanticswhere processesare interpretedas formulasinagivenlogic.Thisallowsforthe useoflogical machineryto reason about the behavior ofprograms and to prove properties ofthem. Nevertheless,thelogicalcharacterizationofCCPprogramsexhibitsnormallyaweaklevel ofadequacysinceproofs inthe logicalsystemmay not corresponddirectlytotraces of theprogram.Inthispaper,westudydifferentencodingsfromCCPintointuitionisticlinear logic(ILL)andwecomparethelevelofadequacyattainedineach.Byrelyingonafocusing discipline,weshow thatitis possibletogive alogicalcharacterizationto CCPwiththe highestlevel ofadequacy. Moreover,we show howto characterize maximal-parallelism semanticsforCCPbyrelyingonamulti-focusingdisciplineforILL.Theseresults,besides giving proof techniques for CCP, entail (safe) optimizations for the execution of CCP programs.Finally,weshow howtointerpret CCPprocedure calls asfixedpoints inILL, thusopeningthepossibilityofreasoningbyinductionaboutpropertiesofCCPprograms.

©2016ElsevierB.V.Allrightsreserved.

1. Introduction

ConcurrentConstraintProgramming(CCP)[44,45]isasimpleandpowerfulmodelofconcurrencybaseduponthe shared-variables communicationmodel.Inthismodel,agentsinteractby tellingconstraints(i.e.,formulas inlogic)intoashared store ofpartialinformationandsynchronizebyasking ifagiveninformationcanbe deducedfromthestore.Hence, pro-cessescanbeseenasinformationtransducers.

The connectionbetweenlogicandCCPprocesses(andconstraintsystems)hasbeenstudiedsinceitsinception:in[45]

a losureoperatorsemanticsisgiventodeterministicCCPprogramsthatwaslaterrelatedtothelogicofconstraintsin[38]. In [13] acalculus forproving propertiesofCCP programs isdefinedwhereproperties areexpressed inan enriched logic of theconstraintsystem.The worksin[42,15]relate operationalsteps ofCCPanditslinearvariant

lcc

withderivations in intuitionistic linear logic (ILL) [18]. We can also mention the works in [28,13] that give logical semantics to timed CCP languagesand provide calculito verifytemporal properties of programs. The readermay find a survey of all these developmentsin[36].

ThelogicalfoundationsofCCPmakeitanideallanguageforthespecificationofconcurrent systems:complex synchro-nizationpatternscanbeexpresseddeclarativelybymeansofconstraintentailment.Moreover,thedualviewofprocessesas

*

Correspondingauthors.

E-mailaddresses:[email protected](C. Olarte),[email protected](E. Pimentel). http://dx.doi.org/10.1016/j.tcs.2016.08.026

(2)

computingagentsandasformulasinlogicallowsfortheuseoftechniquesfrombothprocesscalculiandlogicforreasoning aboutthebehaviorofprocesses.Thesefeatureshavebeenextensivelyusedforthespecificationandverificationofsystems indifferentapplicationsdomainssuchasbiochemical,multimediainteraction,physical/mechanicalandmobilesystems(see e.g.[36]).

Unfortunately,the relationofCCP programs andderivations inlogic studiedso farexhibitsa weaklevel ofadequacy: proofsin the logicalsystemmay not correspond toan operational derivation. Moreover, differentnotions ofobservables in CCP cannot be directly (and accurately)traced inthe logical system. This paper closesthis gapby studyingdifferent encodingsofCCPintoILLandbystatingpreciselythelevelofadequacyattainedineach.Moreover,weshowhowdifferent forms of focusing in ILLgive rise to differentforms of concurrent behaviors in CCP. We then striveat establishing the foundationstobuildbetterproofproceduresfortheverificationofCCPprogramsandtoguidethedesignofinterpretersfor CCPlanguages.

Werely ona focusingdiscipline forILL[2](ILLF)andclassify actionsinCCP aspositive ornegative,depending onthe polarityoftheoutermostconnective obtainedintheirtranslationasformulasinILL.The positiveactionsneed tointeract withthe environment,either forchoosing a pathto follow, orforwaiting for aguard (i.e.,a constraint) tobe available. Negativeactionsdonotneedanyinteractionwiththecontext,andcanbeexecutedanytimeandconcurrently,notaltering thefinalresultofthecomputation. Weprovethatitispossibletogive anILLinterpretationtoCCPwiththehighestlevel ofadequacy,whereafocusedphaseinILLFcorrespondsexactly toanoperationalstepinCCP,andviceversa.Theresultsin thispapernotonlyextendtheonesin[15](sincewepresentastrongeradequacyresult),butalsotheonesin[20],witha betterunderstandingofoperationalderivability.

The idea of usingfocusing for ensuring a higher levelof adequacy is not atall new. In fact, [29] shows how to use focusing,fixedpointsanddelaysinordertospecifysequential programs:thiscanbeachievedonlybyusingsubexponentials

[12]inlinearlogic.Inthiswork,wedealwithconcurrentinsteadofsequentialprogramsand,differentlyfrom[29]andour previousworkin[31],we donotmakeuseofsubexponentials:weinterpretCCPprocessesusingpure linearlogic.Hence, theencodingsaremorenaturalanddirect,andwecanusealltherichandalreadyestablishedmeta-theoryofILLtohelpin drawingconclusionsaboutCCPsystems.Moreover,westudydifferentnotionsofobservablesnotconsideredin[31](seee.g.

Definition 4.1).Inparticular,weshowthatthereareCCPcomputationsthatcannot bemimickedbythestandardencoding ofprocessesasILLFformulas.Werecovertheone-to-one correspondencebetweenILLFderivationsandCCPcomputations by introducinglogical delays. We alsostudythebehavior ofnon-deterministic processes withblind andguardedchoices notpresentin[31].

ForrepresentingCCP systemswithmaximalparallelism semantics,weproposemILL,amulti-focusingproofsystemfor ILL. Weshow that,relying onamulti-focusing discipline,itispossibleto accuratelyrepresentCCPsystems whereallthe enabled actions must be executed at once in a single step. We show also that we can give an ILL characterization to

tccp

[14], atimed extension ofCCP. In thislanguage, thenotion oftime isidentified withthe time neededto tell/ask constraintsandamaximalparallelismsemanticsisassumed.

Previousencodings fromCCPintoILL[15,31] treat proceduredefinitions asformulas oftheshape

∀

x

.

p

(



x

)

−◦

B where B istheformularepresentingthe bodydefining theprocedure p

(

·)

.Such technique allowsformimickingtheoperational behaviorofprocedurecalls(i.e.,unfoldingthedefinition)butitisnotstrongenoughtoverifypropertiesofinfinite compu-tations.Forthat,asstandardlydone,itisneededtoincludefixpointoperatorsintothesystem.Forinstance,[13]enhances thelanguage ofpropertieswithaleastfixpoint operator,andScottinductioncanbe usedtoderive (semantic)properties ofrecursiveCCPprograms.Wehenceconcludethispaperbyencodingprocedurecallsasfixedpointformulas,showingthe possibilityofusinginductiontoprovemoreinterestingpropertiesforCCPprograms.Althoughthisideaisalreadypresent in[42],hereweexploitbettertheuseofintuitionisticlinearlogicwithfixedpoints(

μ

ILL)[3].

Ourcontributions are: (a)we propose alternativesemantics to CCPsystems, basedonly on differentlogical strategies. Thisallowsforcodeoptimizationproceduresbasedonstronglogicalgrounds.Thatislogicguidingcomputation;(b)weput toworksomealreadydevelopedprooftheoryforILL,givingitastrongcomputationalmeaning.Thatiscomputationgiving meaning to logic; and(c)we propose a newlogical system(mILL), capable of capturingmaximal parallelism andtimed executions.

Therestofthispaperisorganizedasfollows.WestartinSection 2by presentingthebaseCCPlanguage, determinate-CCP,withtell,ask,parallel,localityandrecursionoperators.WethenpresentinSection3afocusedsystemforintuitionistic linearlogic(ILLF).InSection4westudydifferentencodingsofCCPintoILLFandidentify,ineachcase,thelevelofadequacy attainedw.r.t.toacertainkindofobservables(outputs).Next,weintroducetheindeterminate-CCPlanguagewithtwokinds ofchoice operators:blindchoice (a.k.a.internal choice)andone-step guardedchoice. Weshow that asimpleadjustment inour encoding sufficesto capturesuch behaviorskeepingthe highestlevelof adequacy. Themultifocus systemmILLis introducedinSection 5aswelltheadequacyresultsforthetimedCCPlanguage proposedin[14].InSection 6,weshow how to interpretprocedure calls using fixed points. We alsopresentsome examplesof propertiesof CCP programs that requiretheinductionprinciplederivedfrom

μ

ILL.Finally,Section7concludesthepaper.

Apreliminaryshortversionofthispaperwaspublishedin[34].Inthispaperwegivemanymoreexamplesand explana-tions.Wealsorefineseveraltechnicaldetailsandpresentfullproofs.Thenewcontributionswithrespectto[34] are:(1) we giveabetterclassificationofeachencodingw.r.t.thelevelofadequacyattained;(2)weintroduceamultifocussystemthat isabletogiveprecisemeaning tomaximal-parallelismsemanticsinCCP;(3)weusethemultifocussystemtoencodethe

(3)

timedlanguage in[14];and, finally,(4)we notonlyintroduce fixpointstogive meaningtoprocedure callsasin[34]but wealsoshowhowthisencodingcanbeusedtoinductivelyreasonaboutcomputationsinCCP.

2. CCP calculi

ConcurrentConstraint Programming(CCP)[44,45] (see[36] forasurvey)isa modelofconcurrencythat combinesthe traditionaloperational viewofprocesscalculiwithadeclarativeview basedonlogic.Thisallows CCPtobenefitfromthe largesetofreasoningtechniquesofbothprocesscalculiandlogic.

ProcessesinCCP interactwitheachother by tellingandasking constraints(piecesofinformation)in acommonstore of partial information. The type of constraints processes mayact on is not fixed but parametric in a constraintsystem. Intuitively, aconstraintsystemprovidesa signature fromwhichconstraintscan bebuiltfrombasictokens (e.g. predicate symbols) andvariables,andtwo basicoperations: conjunction(

)andvariable hiding (

). The constraintsystemdefines also an entailment relation(



) specifyinginter-dependencies betweenconstraints: c



d meansthatthe informationd

canbededucedfromtheinformationrepresentedbyc.SuchsystemscanbeformalizedasaScottinformationsystem[46]

as in[45],or they can be built upon a suitable fragment of logic e.g. asin [47,15,28].Here we shall followthe second approachandconstraintsareseenasformulasinintuitionisticlogic[17].

Definition 2.1 (Constraintsystem).Aconstraintsystemisatuple(

C,



)where

C

isasetofformulas(constraints)builtfrom afirst-ordersignatureandthegrammar

F

:= true |

A

|

F

F

| ∃

x

.

F

where A isanatomicformula.Weshallusec

,

c

,

d

,

d ,etc,todenoteelementsof

C

.Moreover,let



beasetofnon-logical axiomsoftheform

x

.

[

c

c

]

whereallfreevariablesinc andc areinx.Wesaythatd entails c,writtenasd



c,iffthe sequent

,

d

−→

c isprobableinLJ[17].

CCPprocesses.Inthespiritofprocess calculi(seee.g. [6,27]),thelanguageofprocessesinCCP isgivenbyasmallnumber ofprimitiveoperatorsorcombinators.Usually,aCCPlanguagefeatures thefollowingoperators:a tell operatortoaddnew information (constraints) to thestore; an ask operatorquerying if a constraintcan be deduced from the store; parallel

composition combining processes concurrently; a local (alsoknown as hiding orrestriction) introducing local variables, thusrestrictingtheinterfaceaprocesscanusetointeractwithothers;finally,infinitecomputationsareobtainedbymeans of recursion.

Someformsofnon-determinismarealsoallowedinCCPbyaddinga choice operator.Forthemoment,weintroducethe syntaxforthedeterministiccalculusandlaterwedealwithnon-deterministicbehavior.

Definition 2.2 (SyntaxofdeterministicCCP).Processesarebuiltfromconstraintsin theunderlyingconstraintsystemas fol-lows:

P

,

Q

::=

tell(c

)

|

ask c then P

|

P

Q

| (

local x)P

|

p

(

x

)

Theprocess

tell

(

c

)

addsc tothecurrentstored producingthenewstored

c.Theprocess

ask c then P evolves

into P ifthecurrentstoreentailsc.Otherwise,theprocessremains blockeduntilenough informationisaddedto thestore.This providesapowerfulsynchronizationmechanismbasedonentailmentofconstraints.

The process P

Q represents the parallel (interleaved)execution of P and Q , i.e., P and Q running inparallel and possiblycommunicatingviathesharedstore.

Theprocess

(

local x

)

P behavesasP andbindsthevariablex tobelocaltoit.

Given a process definition p

(

y

)

=

 P ,where all free variables of P arein the setof pairwise distinct variables y, the process p

(

x

)

evolvesinto P

[

x

/

y

]

.

CCP programstake theform

D.

P where

D

isaset ofprocessdefinitionsand P is aprocess. Itisassumedthatevery processname p

(

·)

hasauniquedefinitionin

D

.

The structural operational semantics (SOS) ofCCP is given by the transitionrelation

γ

−→

γ

satisfying the rules in

Fig. 1.Here wefollowthesemanticspresentedin[15] wherethelocalvariables createdby theprogramappearexplicitly inthetransitionsystem.Moreprecisely,aconfiguration

γ

isatripleoftheform

(

X

;



;

c

)

,wherec isaconstraint(alogical formulaspecifyingthestore),



isamultisetofprocesses,andX isasetofhidden(local)variablesofc and



.Themultiset



=

P1,P2,

. . . ,

Pn representstheprocess P1

P2...

Pn.Weshallindistinguishablyuseboth notationstodenoteparallel

compositionofprocesses.

Processesarequotientedbyastructuralcongruencerelation

=

satisfying:(1)P

=

Q iftheydifferonlybyarenamingof bound variables(alpha-conversion);(2)P

Q

=

Q

P ;and(3) P

(

Q

R

)

= (

P

Q

)

R.Furthermore,



= {

P1,

...,

Pn

}

=

{

P 1

,

...,

Pn

}

= 

iff Pi

=

P i forall1

i

n.Finally,

(

X

;



;

c

)

= (

X

;



;

c

)

iff X

=

X ,

 ∼

= 

andc

≡

c (i.e.,c



c and c



c).

RulesRTandRC areself-explanatory.RuleREQUIV saysthatstructurallycongruentprocesseshavethesamederivations. RuleRLaddsthevariablex tothesetofvariables X whenthefree-variableconditionissatisfied.Inothercase,RuleREQUIV canbeusedtoapplyalphaconversion.Finally,ruleRA saysthattheprocess Q

=

ask c then P evolves into P ifthecurrent store d entailsc.

(4)

(X; ;c) ∼= (X ;  ;c )−→ (Y ;  ;d ) ∼= (Y; ;d) (X; ;c)−→ (Y; ;d) REQUIV (X;tell(c), ;d)−→ (X; ;cd) RT dc X;ask c then P, ;d −→ X;P, ;d RA x/fv(X, ,d) (X; (local x)P, ;d)−→ (X∪ {x};P, ;d) RL p(x)=P (X;p(y), ;d)−→ (X;P[y/x], ;d) RC

Fig. 1. Operational semantics of CCP. fv(,d)means fv()fv(d). fv(X, ,d)means fv(,d)X .

NegativePhase ϒ: ;  ⇒  R ϒ: ;  ⇒G ϒ: ; ,1⇒G 1L ϒ: ; ,FG ϒ: ;  ⇒FG R ϒ: ; ,F,HG ϒ: ; ,FHGL ϒ: ;  ⇒F ϒ: ;  ⇒G ϒ: ;  ⇒F & G &R ϒ: ;  ⇒G{y/x} ϒ: ;  ⇒ ∀x.GR ϒ: ; ,F{y/x} ⇒G ϒ: ; , ∃x.FGL ϒ: ; ,FG ϒ: ; ,HG ϒ: ; ,FHGL ϒ,F: ;  ⇒G ϒ: ; , !FG !L PositivePhase ϒ: 1; · → [H] ϒ : 1; · → [G] ϒ: 1, 2; · → [HG] ⊗ R ϒ: 1; · → [ F] ϒ : 1,[H]; · →G ϒ: 1, 2,[FH]; · →G  L ϒ: ; · → [G{t/x}] ϒ: ; · → [∃x.G] ∃R ϒ: , [F{t/x}]; · →G ϒ: , [∀x.F]; · →GL ϒ: , [Fi]; · →G ϒ: , [F1& F2]; · →G &Li ϒ: ; · → [Gi] ϒ: ; · → [G1G2] ⊕Ri ϒ: ·; · ⇒G ϒ: ·; · → [!G] !R ϒ: ·; · → [1] 1R ϒ: ; · → [A] IRgiven A∈ ( ∪ ϒ)and(⊆ {A}) StructuralRules ϒ: ,Na;  ⇒G ϒ: ; ,NaG store ϒ: ; · → [P] ϒ: ; · ⇒P DR ϒ,F: , [F]; · →G ϒ,F: ; · ⇒G DLC ϒ: , [N]; · →G ϒ: ,N; · ⇒G DLL ϒ: ;PF ϒ: , [P]; · →F RL ϒ: ; · ⇒N ϒ: ; · → [N] RR

Fig. 2. FocusedproofsystemforILLF.A isanatomicformula;P isapositiveformula;N isanegativeformula;andNaisanegativeoratomicformula. Variabley inRand∃Lrulesdoesnotoccurelsewhere.

WeconcludewiththenotionofobservablesthatwillplayacentralroleintheadequacytheoremsinSection 4.

Definition 2.3 (Observables).Let

−→

∗ be the reflexive and transitive closure of

−→

. If

(

X

;



;

d

)

−→

(

X

;



;

d

)

and

X

.

d



c wewrite

(

X

;



;

d

)

c.If X

= ∅

andd

= true

wesimplywrite



c.

Intuitively,ifP isaprocessthen P

c saysthat P outputsc underinput

true

.

ThenextsectionintroducesthelogicalframeworkweshalluseforgivingadeclarativemeaningtoCCPprocesses.

3. ILLF: a focused system for intuitionistic linear logic

Focusing[2]isadisciplineonproofsaimingatreducingthenon-determinismduring proofsearch. Focusedproofscan beinterpretedasthenormalformproofs.Thefocusedintuitionisticlinearlogicsystem(ILLF)isdepictedinFig. 2.

ILLconnectives are separatedinto two classes,the negative:

,

&

,

,

andthe positive:

⊗,

⊕,

∃,

!,

1. The polarity of non-atomicformulasisinheritedfromitsoutermostconnectiveandpositive biasisassignedtoatomicformulas.Itisworth noticingthat,althoughthebiasassignedtoatomsdoesnotinterferewithprovability[24],itchangesconsiderably theshape ofproofs(see[40]).Inthepresentwork,itisextremelyimportant,forthesakeofguaranteeingthehighlevelofadequacy, thatatomshaveapositivebehavior.

(5)

Constraints Processes true = 1 A = !A F1F2 = F1⊗ F1 ∃x.F = ∃x.F ∀x.[cc ] = ∀x.[c−◦ c ] L[[tell(c)]] = c L[[P Q]] = L[[P]] ⊗ L[[Q]] L[[ask c then P]] = c L[[P]] L[[(local x)P]] = ∃x.L[[P]] L[[p(y)]] = p(y) L[[p(x)=P]] = ∀x.p(x) L[[P]]

Fig. 3. Interpretationofconstraints,non-logicalaxioms(oftheconstraintsystem),CCPprocessesandprocessdefinitionsasILLformulas. A isanatomic formula.

Observe,inFig. 2,thatthenegativeconnectiveshaveinvertibleright rules,whilethepositiveconnectiveshaveinvertible

left rules. This separation induces a two phase proof construction: a negative, where no backtracking onthe selection of inference rules is necessary, anda positive, wherechoices within inference rules canlead to failuresfor whichone may needtobacktrack.

WeseparatetheleftcontextofsequentsinILLFinthree:theset

ϒ

willalwaysdenotetheunboundedcontext,containing onlybangedformulas;



isalinearcontextcontainingonlynegativeoratomicformulas;and



isagenerallinearcontext. We willdifferentiate focused andunfocusedsequentsby usingdifferentarrowsymbols:“

”forunfocusedand“

” for focused.Inthisway,ILLFcontainsfourtypesofsequents:

i.

ϒ

: ;



G isanunfocusedsequent.

ii.

ϒ

: ;

·

G isanunfocusedsequentrepresentingtheendofanegativephase. iii.

ϒ

: ;

·

→ [

F

]

isasequentfocusedontheright.

iv.

ϒ

: ,

[

F

];

·

G isasequentfocusedontheleft.

Inthenegativephase,sequentshavetheshape

(

i

)

aboveandallthenegativeformulasontherightandallthepositive non-atomicformulasontheleftareintroduced.Also,atomicandnegativeformulasontheleftaremovedtotheleftlinear context



usingthe

store

rule.Whenthisphaseends,sequentshavetheform

(

ii

)

.

Thepositivephasebeginsbychoosing,viaoneofthedeciderules DLL

,

DLC orDR,aformulaonwhichtofocus,enabling

sequentsoftheforms

(

iii

)

or

(

i v

)

.Rulesarethenappliedonthefocusedformulauntileitheranaxiomisreached(inwhich case theproof ends), the rightpromotion rule

!

R is applied (andfocusing will be lost) ora negative subformula onthe

rightorapositivesubformulaontheleftisderived(andtheproofswitchestothenegativephaseagain).Thismeansthat focused proofscanbeseen(bottom-up)asasequenceofalternationsbetweennegativeandpositivephases.Wewillcalla

focusedphase apositivephasefollowedbyanegativeone.

Rulesforintuitionistic linearlogic(ILL) are thesame asin ILLF,butnot consideringfocusing, andthestructuralrules beingsubstitutedbytheusualbangleftrules(dereliction,contractionandweakening).SequentsinILLwillbedenotedby





C .

4. From CCP processes to ILLF formulas

Itiswellknown[15,31]thatprocessesinCCPcanbeinterpretedasformulasinILL.Itturnsout,though,thatthereare severalwaysofproposing such aninterpretation. And,quiteinterestingly,thesepossible differentapproachescanleadto differentlogicalandcomputationalbehaviors,asweshallseeinthissection.

Anyinterpretationofasystemintoanothermustbeadequate,inthesensethattheremustbea1–1 relationbetweenthe setsofinterpretedobjectswiththesetoftheirinterpretations.Thelevelofadequacycanthendeterminehowtightarethose systems.Following[30],wewillclassifyourinterpretationsofCCPprocessesasILLformulasintotwolevelsofadequacy:

FCP (full completenessofproofs) claims that processes outputting an observable are in 1–1 correspondence with the correspondingcompletedproofs.

FCD (full completenessofderivations) claims that one step of computation (in CCP) should correspond to one step of logicalreasoning.

While onestepofcomputation isrigidlydetermined bythe operationsemantics oftheCCP systemconsidered,onestep oflogicalreasoning depends strongly on the logical framework chosen. In ILL, one step of logical reasoning means one applicationofa logicalrule;inILLFitmeansone focusedphase; andinmILL(seeSection 5) itmeansone multi-focused phase.

ThelogicalinterpretationofCCPisdefinedwiththeaidofafunction

L[

[·]

]

definedinFig. 3.Function



mapsconstraints (Definition 2.1) into ILL formulas. Recallthat the store in CCP is monotonic, i.e., constraints cannot be removed. Hence, atomic constraints ( A in Fig. 3) are marked witha bang. In the case ofprocesses, as expected, parallel composition is identified withmultiplicative conjunctionand ask processes correspond to linear implication. Non-logical axioms of the form

x

.

[

c

c

]

willbetranslatedas

x

.

[

c

−◦ 

c

]

.Moreover,process definitionsare (universallyquantified)implications toallowtheunfoldingofitsbody.

(6)

Inwhatfollowswecall p in

x

.

p

(

x

)



L[

[

P

]

]

thehead oftheformulawhilec in



c



L[

[

P

]

]

theguard oftheformula. Notethatthoseformulasresultfromtheencodingofprocessdefinitionsandaskprocessesrespectively.

Thefollowingresultstatesthattheinterpretation

L[

[·]

]

isadequate.

Theorem 4.1 (Adequacy–ILL[15]).LetP beaprocess,



beasetofprocessdefinitionsand



beasetofnon-logicalaxioms.Then,for anyconstraintc,P

ciffthereisaproofofthesequent

!

L[

[]

],

! ,

L[

[

P

]

]

 

c

⊗ 

inILL.1ThelevelofadequacyisFCP.

The lowlevel ofadequacyof thisinterpretationimpliesthat theremay belogical stepsnot corresponding toany op-erational step and vice versa. For instance, consider the case where the last rule applied on a proof of an ILL sequent is

−◦

L

π

1



1

,

F



d

π

2



2

 

c



1

, 

2

,



c



F



d



L

Notethat

π

2 couldcontainsub-derivationsthathavenothingtodowiththeproofoftheguardc.Forinstance,processes definitions could be unfolded or other processes could be executed. This wouldcorrespond, operationally, to the act of triggeringanaskprocess

ask c then P with

noguaranteethatitsguardc willbederivableonlyfromthesetofnon-logical axioms



andthecurrentstore.In otherwords,it maybethecasethat



c will be laterproduced bya process Q such

that

L[

[

Q

]

]

∈ 

2,forexample.Observethatthisisnot allowedbyCCP’soperationalsemantics(seeruleRA inFig. 1). On what follows, we will show, step-by-step,how the encoding (and, later on, the logical system) can be enhanced forhavinga betterlevelofadequacy w.r.t.concurrentcomputations.The importanceofthisdiscussion isnotonly proof-theoretical: wewillbeabletouseall linearlogic’s richtheory inordertopropose bettercomputationalstrategiesinCCP languages.

AsimpleinspectiononFig. 3showsthatthefragmentofILLneededforencodingCCPprocessesandprocessesdefinitions isgivenbythefollowinggrammarforguards/goals G,processes P andprocessesdefinitions P D.

CCP Grammar

G

:=

1

| !

A

|

G

G

| ∃

x

.

G

P

:=

G

|

P

P

|

P & P

|

G



P

| ∃

x

.

P

|

p

(

t

)

P D

:= ∀

x

.

p

(

x

)



P

,

where A isan atomicformula(constraint)in

C

and p isalsoatomicbutp

/

C

.Theprocesscorresponding totheformula

P & P isthenon-deterministicchoice,thatwillbeintroducedinSection4.4.

Notethat,duetothissyntax,wewillonlyusethenegativerules1L

,

L

,

L

,

!

L

,



R andthepositiverules

R

,



L

,

R

,

!

R,

&L

,

L.Theformulasalsohavespecialformsandbehavior,asdescribedbellow.

Formulasontheright(guards/goalsG,headsp).Thecorrespondentlogicalfragment ofthe encodinghavestrictlypositive

formulasontheright.Therearethreecasestoconsider.

– Theformulaontherightistheheadp ofaprocessdefinition,i.e.,itispositiveandatomic.

– The main connective inthe goal isnot

!

.Hence, the connective should be 1,

or

. In all thesescases focusing

cannot belostontheright,andthefocusedformulawillbeentirely decomposedintoformulasoftheshape1 or

!

A.

– Focusingonagoaloftheform

!

A isonlypossibleifthelinearcontextisempty(seerule

!

R inFig. 2).Thismeansthat

onlythetheory



,the encodingofconstraintsandprocedurecalls canbeinthecontext,since theyareclassical, i.e.,formulas proceededby

!

. Lemma 4.1bellowshowsthat theencoding ofprocedurecalls cannot be usedinthe proofofA.

Formulasontheleft(programsP ).Ontheotherhand,itispossibletohavepositiveornegativeformulasontheleft. – Positiveformulas ontheleft(thatcannotbefocused)comefromtheinterpretationofoneoftheactions:tell,parallel

composition and locality that do not need anyinteraction withthe context. We call these actions negative. As an example, the parallel composition P

Q is translated as

L[

[

Q

]

]

L[

[

P

]

]

. Notice that

is a positive connective, decomposing it on the left side of a sequentwill be done in a negative phase. As another example,the formula

x

.

!

A1

⊗ !

A2,resultingfromtheencodingof

tell

(

x

.

A1

A2),canbeentirelydecomposedinanegativephaseusing therules

L,

L and

!

L.

– Negativeformulas ontheleft (thatcanbe chosen forfocusing)comefromone oftheactions: ask,non-deterministic choice (see Definition 4.3) and procedurecalls. They doneed to interact with the environment, either for choos-ing a path to follow (in non-deterministic choices), or waiting for a guard to be available (in asks or procedure calls).We calltheseactionspositive. Consider,forexample,theformula



c



L[

[

P

]

]

resultingfromtheencoding of

ask c then P . Notethat



isnegative,hencedecomposingthisformulaontheleftsideofasequentwillbedonein apositivephase.

1 Thetop()erasestheformulascorrespondingtoprocessesthatwerenotexecuted.Wewilldenoteby!L[[]]themappingof! L[[·]]toelementsin andby! themappingof! toelementsin.

(7)

ThefollowingtheoremisanimmediatecorollaryofTheorem 4.1,sinceILLFiscompletew.r.t.ILL[2].

Theorem 4.2 (Adequacy–ILLF).LetP beaprocess,



beasetofprocessdefinitionsand



beasetofnon-logicalaxioms.Then,for anyconstraintc,

P

c iff there is a proof of the sequent

L

[[]],  : ·;

L

[[

P

]] ⇒ 

c

⊗ 

inILLF.ThelevelofadequacyisFCP.

Althoughwe didnot yetenhancethelevelofadequacy,theuseoffocusing introducesomeimprovementswhen com-paredtoILL.Moreprecisely, thenextlemmashowstheshapeofderivations inaproofinvolvinggoals:such formulasare derivablefromotherguards(i.e.,theencodingofconstraints)andnon-logicalaxiomsin



only.Actually,theresultiseven stronger:thereisnoproof ofaguardG ifaprocessdefinitionischosentobefocusedon.

Lemma 4.1. LetG beaguard,

G

beasetofatomicguards,



beasetofprocessdefinitionsand



beasetofnon-logicalaxioms.Then

L[

[]

],

G,



: ·;

·

→ [

G

]

hasaproofinILLFifandonlyif

G,



: ·;

·

→ [

G

]

isprovableinILLF.Moreover,if

x

.

p

(

x

)



L[

[

P

]

]

L[

[]

]

thenthefollowingsequentisnotprovable

L

[[]],

G

,

 : [∀

x

.

p

(

x

)



L

[[

P

]]]; · →

G

Proof. Consider aproofof

L[

[]

],

G,



: ·;

·

→ [

G

]

.NotethatalltheformulasinG arestrictlypositiveandtheconnectives

and

(ontheright) donotlosefocus.Hence, weendupeitherwithasequent

L[

[]

],

G,



: ·;

·

→ [

1

]

(thatfinishes immediately)orwithaderivationoftheshape

π

L

[[]],

G

,

 : ·; · ⇒

A

L

[[]],

G

,

 : ·; · → [!

A

] !

R

The derivation

π

theneithercontinuesby focusingon A oronsome formulain

L[

[]

],

G

or



.Assumethat

x

.

p

(

x

)



L[

[

P

]

]

L[

[]

]

ischosenforfocusing.Since

and

−◦

arenegative,focuswillnotbelostand

π

musthavetheshape

L

[[]],

G

,

 : [

L

[[

P

]]]; · →

G

L

[[]],

G

,

 : ·; · → [

p

(

t

)

]

L

[[]],

G

,

 : [∀

x

.

p

(

x

)



L

[[

P

]]]; · →

G

L

,

−◦

L

L

[[]],

G

,

 : ·; · ⇒

G DLC

Butthe sequent

L[

[]

],

G,



: ·;

·

→ [

p

(

t

)

]

isnot provablesince p isatomic, positiveandnota constraint.Thatis,focus cannotbelostandtheproofcannotfinishwiththeinitialaxiom,since p isnotin

L[

[]

]

G ∪ 

.

2

Now let usexplain why, evenwith focusing,we do notobtain an adequacy atthe FCD level. Let P

=

ask c then P . Hencefocusingon

L[

[

P

]

]

wouldproducethederivation

π

1

ϒ

: , [

L

[[

P

]]]; · →

G

π

2

ϒ

: ·; · → [

c

]

ϒ

: , [

c



L

[[

P

]]]; · →

G

L

,



L

ϒ

: ; · ⇒

G DL

Observethatc isaguard,hence



c willbedecomposedentirelyintosubformulasoftheshape1 and

!

A.FromLemma 4.1

weknowthattheproofof

!

A mustproceedbyusingconstraintsandnon-logicalaxiomsonly,matchingexactly the seman-ticsgivenbyruleRA.However,notethat

L[

[

P

]

]

isalsofocusedontheleft.Operationally,thismeansthat,if P isapositive action(i.e.,anask), P hastobe executedimmediately,whichisnotenforcedbyCCP’soperationalsemantics.Thiswillbe analyzedinthenextsection.

Another important aspect to consider is the use of non-logical axioms. Although this is not an operational step in CCP, focusing on such axiomscountsasa focused step inILLF. However, observethat focusing over a non-logical axiom necessarilyproducesaderivationofthefollowingtype

π

1

ϒ

: ·; · → [

c

]

π

2

ϒ,

A

d

: ; · ⇒

G

ϒ

: ; 

d

G

ϒ

: , [

d

]; · →

G Rl

ϒ

: , [∀

x

.



c

−◦ 

d

]; · →

G

L

,

−◦

L

where

π

1istheproofof



c fromtheclassicalformulasin

ϒ

,and

A

disthemulti-setofatomicsubformulasof



d.IfG is

notatomicandthelastruleappliedin

π

2 is DR,then



mustbeempty, G willbecompletelydecomposedintoitsatomic

(8)

. . .

π

1

ϒ

: ·; · → [

c

]

π

2

ϒ,

A

d

: ·; · ⇒

A

ϒ

: ·; 

d

A

ϒ

: [

d

]; · →

A Rl

ϒ

: [

c

−◦ 

d

]; · →

A

−◦

L

ϒ

: ·; · ⇒

A DLC

. . .

ϒ

: ·; · → [

G

]

ϒ

: ·; · ⇒

G DR

where A isanatomicsubformulaofG.Thatis,non-logicalaxiomspermuteup,anditisalwayspossibletoapply themat thetopofproofs.The samehappensifanyleftruleisappliedin

π

2.Hence wecanmimic,inlogic,thesamebehaviorof usingnon-logicalaxiomsonlyforentailingconstraints.

Fromnowon,weshallassumethatnon-logicalaxiomsareappliedjustbeforetheleafsofproofsandwewillnotcount thisstepinouradequacytheorems.

4.1. Maximalderivationsandinterleavinginaskagents

In this section we show how to obtain the highest level of adequacy when considering standard derivations in the operationalsemanticsofCCP.

Example 4.1 (Traces,proofsandfocusing).ConsidertheCCPprocess

P

=

tell(a

b

)

ask a then ask b then tell(ok)

ask b then ask a then tell(ok

)

Wedenotethe twoexternalask agentsin P as A1 and A2 respectively.The operationalsemanticsdictatesthat thereare threepossibletransitionsleading tothefinalstored

=

a

b

∧ ok ∧ ok

.Allsuchtransitionsstartwiththenegativeaction

tell

(

a

b

)

:

Trace

1

: ∅;

P

; true −→ ∅;

A1

A2

;

a

b

 −→ ∅;

ask b then tell(ok)

A2

;

a

b



−→ ∅;

tell(ok)

A2

;

a

b

 −→ ∅;

A2

;

a

b

∧ ok −→

∅; ·;

d

 −→

Trace 2

: ∅;

P

; true −→ ∅;

A1

A2

;

a

b

 −→ ∅;

A1

ask a then tell(ok

)

;

a

b



−→ ∅;

A1

tell(ok

)

;

a

b

 −→ ∅;

A1

;

a

b

∧ ok

 −→

∅; ·;

d

 −→

Trace 3

: ∅;

P

; true −→ ∅;

A1

A2

;

a

b

 −→ ∅;

ask b then tell(ok)

A2

;

a

b



−→ ∅;

ask b then tell(ok)

ask a then tell(ok

)

;

a

b



−→ ∅;

tell(ok)

ask a then tell(ok

)

;

a

b

 −→ ∅;

tell(ok)

tell(ok

)

;

a

b



−→

∅; ·;

d



Trace

1

and

Trace

2

correspondexactly toadifferentfocusedproof ofthesequent

L[

[

P

]

]

−→

L[

[

d

]

]

: onefocusing firston

L[

[

A1

]

]

andtheotherfocusingfirston

L[

[

A2

]

]

.Ontheotherhand,

Trace

3

correspondstoaninterleaved execution of A1 and A2.Wenote thatsuch atracedoesnothaveanycorrespondentderivationintheILLFsystem.Infact,since



isanegative connective,focusingon

L[

[

A1

]

]

willdecomposetheformula



a

 

b

 ok

producingthefocusedformula



b

 ok

,whichisstillnegative.Hencefocusingcannotbelostandtheinneraskhastobetriggered.

Remark 4.1. This last example shows something really interesting: although the formulas A

B

−◦

C and A

−◦

B

−◦

C

are logicallyequivalent, they areoperationallydifferent whenconcurrentcomputations areconsidered. Infact,ifwe allow processestoconsumeconstraints[15],aninterleavingexecutionastheonein

Trace

3

maynotoutputtheconstraint

ok

, sinceagentsmaycompeteforthesameresources.

Onlooking fora 1–1 correspondencebetweenproofsin ILLFandoperational steps,one hastwo options: (1)to force theoperationalsemanticstoexecuteatoncenestedaskagents,thusrulingoutbehaviorsastheonein

Trace

3above;or (2)tointroducethesocalledlogicaldelaysintheencodingof

L[

[·]

]

,allowing ILLFderivationstomimic

Trace

3

.Inthe followingweexploreoption(1)andinSection4.2weexplore(2).

Nextdefinitionintroduces anoperational rulethatallows executing atonce nestedaskprocesses.Theuse ofthisrule givesrisetowhatwecallmaximalderivations. Sincethelanguage wearedealingwithisdeterministic,itisnotdifficultto showthatthenewsemanticscoincideswiththeoneinSection2.3(Theorem 4.3).

Definition 4.1 (Standardandmaximalderivationsandobservables).Aderivation inCCPusingthe relation

−→

asinFig. 1is calledstandard.Themaximal transitionrelation

;

isastandardderivationobtainedbyreplacingtherulesRA andRC with therulesRAM andRCM,respectively

(9)

d



c1

∧ ... ∧

cn

(

X

;

P

, 

;

d

)

; (

X

;

Q

, 

;

d

)

RAM

p

(

x

)

=

P d





(

c1

∧ ... ∧

cn

)

[

y

/

x

]

(

X

;

p

(

y

), 

;

d

)

−→ (

X

;

Q

[

y

/

x

], ;

d

)

RCM

wherethesidecondition

meansthat P isaprocessoftheshape:

ask c1then ask c2then

...ask c

nthen Q (1)

andQ isnotanaskagent.InRCM,ifP isnotanaskagentthenn

=

0 andthesideconditiond



(

c1

∧...

cn

)

[

y

/

x

]

become

the trivial assertion d



true

. We define the observablesof a process under the

;

relation, denoted by

(

X

;



;

d

)



c,

similarlyasinDefinition 2.3.

Intuitively, in a standard derivation of the shape

γ

−→

γ

, interleaved executions of ask agents are allowed as in

Trace 3

ofExample 4.1.Onthecontrary,inamaximalderivation

γ

;

γ

,an askhavingtheformofEquation(1)above hastowait untilalltheguardsc1,

...

,

cn can beentailedfromthe store.Then,itexecutes Q inone step(asin

Trace

1

and

Trace

2

ofExample 4.1).

Thenexttheoremrelatestheoutputsobtainedbythestandardandthemaximalsemantics.

Theorem 4.3. LetP beaprocess.Then,foranyconstraintc,

(

X

;

P

;

e

)

c if and only if

(

X

;

P

;

e

)



c

Proof. The (

) partof the proof isimmediate since

;

is a particularscheduling fora

−→

derivation. As forthe (

) part, assume that

(

X1

;

1

;

e1)

c, i.e., there is a derivation of the shape

(

X1

;

1

;

e1)

−→ · · · −→ (

Xm

;



m

;

em

)

such that

Xm

.

em



c.Wenotethatthestoreevolvesmonotonically,i.e.,ei



ej forall j

i.Moreover,askagentsquerythestore

without affectingit(RuleRA). Consider aprocess R

=

ask c1 then ask c2 then

...

ask cn then Q in agivenconfiguration

in thederivation above. Weknowthat R can addinformation tothe store iff Q isexecuted. Thishappensiff thereisa configuration

γ

kwithstoreekentailingthelastguardofR (i.e.,ek



cn).BymonotonicityandRuleRA,itmustbethecase that ek



(

c1

∧ ...

cn

)

.We concludebynoticingthat thereisa(maximal) derivationusingRAM endinginthe storeem.

Suchderivationdiffersfromthestandardderivationinthatitdelaystheexecutionof R untilthestoreekisproduced.The

sameargumentationfollowsforprocedurecallsandtheruleRCM.

2

Remark 4.2. Interestinglyenough,thetheoremabovereflectsawell-knownprooftheoreticalresult:negativerulespermute downwithpositiverules,meaningthatallnegativeactionscanbedonebeforethepositiveones.

Wecannowstateastrongeradequacyresult,restrictedtomaximalderivations.

Theorem 4.4 (Strongadequacy–maximalderivations).LetP beaprocess,



beasetofprocessdefinitionsand



beasetof non-logicalaxioms.Then,foranyconstraintc,

P



c iff there is a proof of the sequent

L

[[]],  : ·;

L

[[

P

]] ⇒ 

c

⊗ 

inILLF.Moreover,thelevelofadequacyisFCD.

Proof. The resultfollows immediatelyfromRemark 4.2,sincepositive andnegative actionsin CCPwithmaximal deriva-tions correspondexactly to positive andnegative phases inthe logicalsystem. In particular, observethat, in theprocess

ask c then P , theonlypossibilityof

L[

[

P

]

]

beinganegative formulaiswhen P isalsoan ask.The samewithprocedure calls.

2

4.2. Interleavinganddelays

Interleaving executionsastheone in

Trace

3

can behandled inafocused systemby meansofthe socalledlogical delays[29].

Definition 4.2. The positive andnegative delay operators

δ

+

(

·),

δ

(

·)

are defined as

δ

+

(

F

)

=

F

1 and

δ

(

F

)

=

1

−◦

F

respectively.

Observe that

δ

+

(

F

)

≡ δ

(

F

)

F , hence delayscan be used inorder toreplace a formulawith a provablyequivalent formulaofagivenpolarity.Wedefinetheencoding

L[

[·]

]

+as

L[

[·]

]

butreplacingthefollowingcases:

L

[[

ask c then P

]]

+

= 

c

 δ

+

(

L

[[

P

]]

+

)

L

[[

p

(

x

)

=

P

]]

+

= ∀

x

.

p

(

x

)

 δ

+

(

L

[[

P

]]

+

)

Theuseoftheencodingaboveforcesthefocusingphasetoend.Inthiscase,wecanhaveastrongeradequacytheorem forthewholeCCPsystem.

(10)

Theorem 4.5 (Strongadequacy–standardderivations).LetP beaprocess,



beasetofprocessdefinitionsand



beasetof non-logicalaxioms.Then,foranyconstraintc,

P

c iff there is a proof of the sequent

L

[[]]

+

,

 : ·;

L

[[

P

]]

+

⇒ 

c

⊗ 

inILLF.TheadequacylevelisFCD.

Proof. By straightforwardcaseanalysis.Toillustrate,considerthederivation

L

[[]],  : ·;

L

[[

P

]] ⇒

G

L

[[]],  : ·; δ

+

(

L

[[

P

]]) ⇒

G

L

,

1L

L

[[]],  : [δ

+

(

L

[[

P

]])]; · →

G RL

L

[[]],  : ·; · → [

c

]

L

[[]],  : [

c

 δ

+

(

L

[[

P

]]

+

)

]; · →

G

L

,

−◦

L

L

[[]],  : ·; · ⇒

G DLC

Observethatthepositiveformula

δ

+

(L[

[

P

]

]

+

)

forcestheendofthepositivephaseontheleftpremise.

2

Remark 4.3. ObservethatTheorem 4.4givesacanonicaltracetoCCPsuccessfulcomputationsviafocusing.Inthiscase,the guardsof nestedaskagentsare evaluated atonceto decidewhethertheprocess continuesblocked ornot.Onthe other hand,Theorem 4.5showsthatderivationinlogichaveaone-to-onecorrespondencewithtracesofacomputationinaCCP program.

4.3. Acloserviewtonegativeactions

So farwe have shownthat the focus discipline andthe useofdelays allow usto havea one-to-one correspondence betweenCCP positive actions (i.e., ask agentsand procedure calls)and ILLFpositive phases. In thissection we show in detailthebehaviorofnegativeactionsaswell.

Recallthatnegativeactionsarethosethatdonotneedtointeractwiththeenvironment,i.e.,parallelcomposition,local andtellprocessesinCCP.Fromthelogicalpointofview,theformulasresultinginILLfromtheencodingofthoseprocesses areallintroduced(inanyorder)inanegativephasesincetherulesgoverningthemareallinvertible(

L

,

L

,

!

L).

We thushavetwo sources ofdon’tcare non-determinismthat mayseparate derivations inCCP andthe corresponding derivationsinILLF:

1. Let P

=

tell

(

c

)

ask c then Q

tell

(

d

)

. P mayproceedbyaddingc tothestore,thenreducingtheaskagentto Q and

finallyaddingd tothestore.TheILLFderivationsfor

L[

[

P

]

]

startswithanegativephasedecomposing



c and



d.Then itfocusesontheencodingoftheaskagenttoproduce Q .Inotherwords,thefocusingdisciplineforcestopostponethe executionoftheaskagentafterintroducingbothc andd.

2. Theoperationalsemanticsstoresc in

tell

(

c

)

tothecurrentstored producingc

d inonestep.Theencoding



c may

useseveralapplicationofthenegativerules

L

,

L

,

!

L untiltheatomicsubformulasofc arestoredintothecontext.

ThereareatleasttwooptionsforhavingalsoamatchbetweennegativeactionsinCCPandderivationsinILLF.

(i) Proposeanewsemanticsthateagerlyexecutesallthenegative actions(ina parallelcomposition)andthenworkson positiveactions.ItisnotdifficultthenprovinganadequacyresultsimilartoTheorem 4.3forsuchsemantics.Forthat, note that if

ask c then P can

exhibit a transitionona store d then it can dothe sameon a stronger stored (i.e.,

d



d).

(ii) Introduce negative delays inthe encoding oftells andlocal processes. Hence they must be introduced in a positive (focused)phaseandtheonlynegative actionswillbethesteps neededtostore theconstraintsinthecontext.Inthis way,wehaveaperfectmatchbetweenpolaritychangesinILLFandoperationalsteps.

Weshallexploreindetailthealternative(ii)inSection5whereweanalyzeatimedextensionofCCP.Inthatlanguage, thelogicaladequacycannotbeestablishedwithoutforcingalltheactionstobepositive.

4.4. IndeterminateCCPlanguages

Non-determinismisintroducedinCCPbymeansofthechoiceoperator.

Definition 4.3 (IndeterminateCCP).IndeterminateCCPprocessesareobtainedbyadding



I

(11)

x; I Pi, ;c −→ x;Pi, ;c RBCH x;Pi, ;c −→ x ;  ;c  x; I Pi, ;c −→ x ;  ;c  RGCH (a) Blind Choice (b) One-step guarded choice

Fig. 4. Operational rules for the non-deterministic choice. The process



I

Pi chooses one ofthe Pj forexecution. The choice ofone ofthe processesprecludes the othersfrom

execution.When

|

I

|

=

2,weshallwrite P1

+

P2insteadof



I

Pi.

We can give at least two possible interpretations of the non-deterministic choice as shownin Fig. 4. The Rule RBCH corresponds to the blind (or internal) choice (BC ). This rule says that a process Pi is chosen for execution regardless

whethertheprocess Pi canevolveornot.ThelocalchoicefragmentofindeterminateCCPenjoysinteresting propertiesas

confluence,i.e.,theoutputofaprocessisindependentoftheschedulingpolicyoftheparalleloperator[16].

In the Rule RGCH, the chosen process Pi must not block, i.e., it must exhibit at least one transition. Since the only

blockingagentinSyntax2.2istheaskagent,thiskindofnon-deterministicchoiceisusuallywrittenasasummationofask agentsasin



i

ask ci then Pi.Thus,theruleforone-stepguardedchoice(GC )canbereadas: Pi ischosen forexecution

wheneveritsguardcicanbeentailedfromthecurrentstore.WenotethataBCcanbeseenalsoasaGCwheretheguard ci

= true

forall i.

Thelogicalclausesrepresentingblindandguardedchoiceare,respectively:

L

[[



I Pi

]]

BC

=

&I

+

(

L

[[

Pi

]]))

L

[[



I Pi

]]

GC

=

&I

L

[[

Pi

]]

Observethatwecapturewellthebehaviorofchoosingoneprocessfromthechoiceswehave.Atthesametime,forcing formulas tobepositive inthe BC caseimpliesthatthechosen processwillnot blockinthe positivephase.Ontheother hand, Pi beinganegativeformulainthecaseGC ,assuresthatthechoicewillbetriggeredonlyif theguardcanbeinferred

from the context (store) andnon-logical axioms. Hence, we continue having a neat logicalcontrol corresponding tothe operationalsemantics,andresultsinTheorems 4.4 and4.5remainvalidforindeterminateCCP.

Theorem 4.6 (AdequacyforindeterminateCCP).LetP beaprocessfromDefinition 4.3,



beasetofprocessdefinitionsand



bea setofnon-logicalaxioms.Then,foranyconstraintc:

P



ciffthereisaproofofthesequent

L[

[]

],



: ·;

L[

[

P

]

]

⇒ 

c

⊗ 

P

ciffthereisaproofofthesequent

L[

[]

]

+

,



: ·;

L[

[

P

]

]

+

⇒ 

c

⊗ 

Moreover,thelevelofadequacyinbothcasesisFCD.

Negativeactions.ThediscussiononSection4.3takesanewperspectiveinthecaseofguardedchoices.NotethatGCprocesses areaffectedbytheschedulingpolicyoftheparalleloperator.Thismeansthat,ingeneral,GCprocessesarenotconfluentin thesenseof[16].TakeforinstancetheprocessP

=

tell

(

c

)

Q where Q

=

ask

true

then Q1

+

ask c then Q2.IfQ isfirst chosen forexecution,theonlyalternativeforQ istoexecute Q1.Onthecontrary,if

tell

(

c

)

isfirstexecuted, Q maychose both Q1 orQ2.

Alternatives(i) and(ii)proposed inSection 4.3(in ordertoexhibit anadequacyresultbetweenILLFandbothnegative and positiveactions) are alsoapplicable inthe context ofindeterminate CCP.The semantic approachin (i) isvalidsince augmentingthestoreenablesmorechoicesinaGCprocess(i.e.,analternativecannotbediscardedbyconsideringastronger store);ontheother hand,byaddingnegativedelaysasin(ii),wecanrecoveraone-to-onecorrespondencebetweenboth positiveandnegativeactionsinindeterminateCCPandILLF.

5. Maximal parallelism and multi-focusing

Thereductionrelations

−→

(Definition 2.3)and

;

(Definition 4.1)defineinterleavingsemanticsfortheparalleloperator. This meansthat,in aconfigurationofthe shape

γ

= 

X

;

P1

· · ·

Pn

;

d



,if

γ

−→

γ

, thenonlyone ofthe Pi exhibitsa

transition(andtheotherprocessesremainthesame).

Inthissection,weshowhowtocapturemaximalparallelism inCCPusingthesocalledmaximalmulti-focusingdiscipline inILL.Bymaximalparallelismwemeanthatall theenabled processesareexecutedatthesametime.Asweshallsee,this kindofsemanticsisneededforcharacterizingtimedCCPprocesses[14].Finally,weestablishadequateILLcharacterizations tothesystemsmentionedabove.

5.1. Multi-focusedILL

WestartbypresentingmILL,amulti-focusedsystemforILL,whichisanextensionofthesystemmLJFintroducedin[40]

(12)

PositivePhase ϒ: 1; · → [P] ϒ : 2; · → [Q] ϒ: 1, 2; · → [PQ] ⊗ r ϒ: , , [ Ni]; · →P ϒ: , , [N1& N2]; · →P &Li ϒ: 1; · → [P] ϒ : 2, ,[N]; · →Q ϒ: 1, 2, ,[P−◦N]; · →Q −◦ l ϒ: ; · → [ Pi] ϒ: ; · → [P1P2] ⊗Ri ϒ: ; · → [P{t/x}] ϒ: ; · → [∃xP] ∃r ϒ: , , [N{t/x}]; · →P ϒ: , , [∀xN]; · →Pl ϒ: ·; · ⇒N ϒ: ·; · → [!N] !R ϒ: ·; · → [1] 1R ϒ: ; · → [A] IR given A∈ ( ∪ ϒ)and(⊆ {A}) StructuralRules ϒ: , [ϒ, ]; · →P ϒ: , ; · ⇒P mDL ϒ: ; · → [P] ϒ: ; · ⇒Pu mDR ϒ: ;  ⇒P ϒ: , [↑ ]; · →P mRL ϒ: ; · ⇒N ϒ: ; · → [↓N] mRR ϒ: , ;  ⇒R ϒ: ; , ↓ ⇒R storeN ϒ: ,A;  ⇒R ϒ: ; ,AaR storeA

Fig. 5. mILLsystem.HereA isatomic,P,Q positive,N negative,Purepresentseitheranegativeformulaofthekind↑P orapositiveformulaandAais eitheratomicoraformulaofthekind↑A.ϒ∗representsamultisetofarbitrarynumbersofcopiesofformulasinϒ.InmDL,ϒisnon-empty.

ThesystemmILLhastwokindsofformulas:

P

,

Q

:=

A

|

1

|

P

Q

|

P

Q

| ∃

x

.

P

(

x

)

| !

N

| ↓

N M

,

N

:=  |

M & N

|

P

−◦

N

| ∀

x

.

N

(

x

)

| ↑

P

whereP

,

Q arepositivewhileM

,

N arenegativeformulas.Thesymbols

and

markthechangingofpolarities.Thesyntax forcontextsisthefollowing

:= ,

N

ϒ

:= · |



:= ϒ,

A



:= [ ]



:= ϒ,

P

Theintuitionisthefollowing:

,

ϒ,



aresetsthatcontainnegativeformulas,where

isnon-emptyand



mayalsohave atomicformulas;



isanon-emptysetoffocusednegativeformulas,and



isanysetofformulas.

TherearethreekindofsequentsinmILL:

thesequent

ϒ

: ;



R isunfocused;

thesequent

ϒ

: ,

[ ];

·

R ismulti-focusedontheleft;

thesequent

ϒ

: ;

·

→ [

R

]

isfocusedontheright.

ThenegativephaseinmILListhesameasinILL.TherestoftherulesformILLaresimilartotheonespresentedinFig. 2, nowconsideringpossiblymulti-focusedcontexts (Fig. 5).Theonlydifferenceisthewayoftriggeringthereleaserules:the positivephaseendsonlywhenallthefocusedformulasaremarkedwitharrows.Thismeansthat thefocusing persistsup tothepointthateveryfocusedformulareachesanegativeformula,andthefocusingisreleasedatoncetoallofthem.

Theorem 5.1. mILLissoundandcompletewithrespecttoILL.

Proof. The proofisstandard:justnotethaterasingthe

and

arrowsandthecontext



andrestricting

toasingleton inmDL,mILLcollapsestoILLF.

2

5.2. Maximalmulti-focusing

Thefollowingareadaptedversionsofdefinitionsin[10,9].

Definition 5.1. Theproofs

1

and

2

ofthesamemILLsequentarelocallypermutableequivalent,written

1

2,ifeach can be rewritten to theother using intra-phase permutations, that is, permutationsinside a phase step.

1

and

2

are

permutableequivalent, written

1

2,ifthey are locallypermutable equivalent andeach canbe rewritten tothe other usinginter-phasepermutations,i.e.,permutationsofrulesindifferentphasesteps.

Referências

Documentos relacionados

Tendo em vista ser a adolescência um período de importantes alterações ligadas ao desenvolvimento biopsicosocial, as(os) jovens dessa faixa etária devem ser incluídas(os) em

Em ambos os casos, a intervenção começou por ter uma componente de observação e registo das sessões da técnica responsável. Após esta observação e durante o período de um

Basta utilizar o lema anterior (4.6.3): dados dois pontos em X a distˆ ancia entre eles ´ e a mesma que a distˆ ancia entre os que lhes correspondem no semi-eixo positivo dos yy, o

(3) The B/M complex, which transforms information into meanings, deals with problems by means of both logical and non-logical mechanisms; while logic allows the mind to arrange

In this paper, we study the distribution on the eigenvalues of the preconditioned matrices that arise in solving two-by-two block non-Hermitian positive semidefinite linear systems

For time domain signal interpretation, several methods have been proposed, including recommendations related to the excita- tion shape and frequency of the input wave, which effect

Considerando-se que o aglomerado urbano metro- politano, aqui denominado ‘Primeiro patamar de adensa- mento’, da Região Metropolitana de Curitiba seja a base socioeconômica e

O projeto ou proposta de revisão deverá ser votado pelas duas assem - bléias em term os idênticos, sendo que ela será definitiva depois de aprovada pelo referendum. Todavia, o