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
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
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: cd meansthatthe informationdcanbededucedfromtheinformationrepresentedbyc.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,
)whereC
isasetofformulas(constraints)builtfrom afirst-ordersignatureandthegrammarF
:= true |
A|
F∧
F| ∃
x.
Fwhere A isanatomicformula.Weshallusec
,
c,
d,
d ,etc,todenoteelementsofC
.Moreover,letbeasetofnon-logical axiomsoftheform
∀
x.
[
c⊃
c]
whereallfreevariablesinc andc areinx.Wesaythatd entails c,writtenasdc,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|
PQ| (
local x)P|
p(
x)
Theprocess
tell
(
c)
addsc tothecurrentstored producingthenewstored∧
c.Theprocessask 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 whereD
isaset ofprocessdefinitionsand P is aprocess. Itisassumedthatevery processname p(
·)
hasauniquedefinitioninD
.The structural operational semantics (SOS) ofCCP is given by the transitionrelation
γ
−→
γ
satisfying the rules inFig. 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 P1P2...Pn.Weshallindistinguishablyuseboth notationstodenoteparallelcompositionofprocesses.
Processesarequotientedbyastructuralcongruencerelation
∼
=
satisfying:(1)P∼
=
Q iftheydifferonlybyarenamingof bound variables(alpha-conversion);(2)P Q∼
=
QP ;and(3) P(
Q R)
∼
= (
PQ)
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.,cc 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.(X; ;c) ∼= (X ; ;c )−→ (Y ; ;d ) ∼= (Y; ;d) (X; ;c)−→ (Y; ;d) REQUIV (X;tell(c), ;d)−→ (X; ;c∧d) 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 ϒ: ; ,F⇒G ϒ: ; ⇒FG R ϒ: ; ,F,H⇒G ϒ: ; ,F⊗H⇒G ⊗L ϒ: ; ⇒F ϒ: ; ⇒G ϒ: ; ⇒F & G &R ϒ: ; ⇒G{y/x} ϒ: ; ⇒ ∀x.G ∀R ϒ: ; ,F{y/x} ⇒G ϒ: ; , ∃x.F⇒G ∃L ϒ: ; ,F⇒G ϒ: ; ,H⇒G ϒ: ; ,F⊕H⇒G ⊕L ϒ,F: ; ⇒G ϒ: ; , !F⇒G !L PositivePhase ϒ: 1; · → [H] ϒ : 1; · → [G] ϒ: 1, 2; · → [H⊗G] ⊗ R ϒ: 1; · → [ F] ϒ : 1,[H]; · →G ϒ: 1, 2,[FH]; · →G L ϒ: ; · → [G{t/x}] ϒ: ; · → [∃x.G] ∃R ϒ: , [F{t/x}]; · →G ϒ: , [∀x.F]; · →G ∀L ϒ: , [Fi]; · →G ϒ: , [F1& F2]; · →G &Li ϒ: ; · → [Gi] ϒ: ; · → [G1⊕G2] ⊕Ri ϒ: ·; · ⇒G ϒ: ·; · → [!G] !R ϒ: ·; · → [1] 1R ϒ: ; · → [A] IRgiven A∈ ( ∪ ϒ)and(⊆ {A}) StructuralRules ϒ: ,Na; ⇒G ϒ: ; ,Na⇒G store ϒ: ; · → [P] ϒ: ; · ⇒P DR ϒ,F: , [F]; · →G ϒ,F: ; · ⇒G DLC ϒ: , [N]; · →G ϒ: ,N; · ⇒G DLL ϒ: ;P⇒F ϒ: , [P]; · →F RL ϒ: ; · ⇒N ϒ: ; · → [N] RR
Fig. 2. FocusedproofsystemforILLF.A isanatomicformula;P isapositiveformula;N isanegativeformula;andNaisanegativeoratomicformula. Variabley in∀Rand∃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 underinputtrue
.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.Constraints Processes true = 1 A = !A F1∧F2 = F1⊗ F1 ∃x.F = ∃x.F ∀x.[c⊃c ] = ∀x.[c−◦ c ] L[[tell(c)]] = c L[[PQ]] = 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 contextusingthe
store
rule.Whenthisphaseends,sequentshavetheform(
ii)
.Thepositivephasebeginsbychoosing,viaoneofthedeciderules DLL
,
DLC orDR,aformulaonwhichtofocus,enablingsequentsoftheforms
(
iii)
or(
i v)
.Rulesarethenappliedonthefocusedformulauntileitheranaxiomisreached(inwhich case theproof ends), the rightpromotion rule!
R is applied (andfocusing will be lost) ora negative subformula ontherightorapositivesubformulaontheleftisderived(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.Functionmapsconstraints (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.Inwhatfollowswecall p in
∀
x.
p(
x)
L[
[
P]
]
thehead oftheformulawhilec incL[
[
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π
11
,
Fdπ
22
c
1
,
2,
cFd LNotethat
π
2 couldcontainsub-derivationsthathavenothingtodowiththeproofoftheguardc.Forinstance,processes definitions could be unfolded or other processes could be executed. This wouldcorrespond, operationally, to the act of triggeringanaskprocessask c then P with
noguaranteethatitsguardc willbederivableonlyfromthesetofnon-logical axiomsandthecurrentstore.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.
GP
:=
G|
P⊗
P|
P & P|
GP| ∃
x.
P|
p(
t)
P D
:= ∀
x.
p(
x)
P,
where A isan atomicformula(constraint)in
C
and p isalsoatomicbutp∈
/
C
.Theprocesscorresponding totheformulaP & 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 encodinghavestrictlypositiveformulasontheright.Therearethreecasestoconsider.
– Theformulaontherightistheheadp ofaprocessdefinition,i.e.,itispositiveandatomic.
– The main connective inthe goal isnot
!
.Hence, the connective should be 1,⊗
or∃
. In all thesescases focusingcannot belostontheright,andthefocusedformulawillbeentirely decomposedintoformulasoftheshape1 or
!
A.– Focusingonagoaloftheform
!
A isonlypossibleifthelinearcontextisempty(seerule!
R inFig. 2).Thismeansthatonlythetheory
,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,parallelcomposition and locality that do not need anyinteraction withthe context. We call these actions negative. As an example, the parallel composition P
Q is translated asL[
[
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,resultingfromtheencodingoftell
(
∃
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
cL[
[
P]
]
resultingfromtheencoding ofask c then P . Notethat
isnegative,hencedecomposingthisformulaontheleftsideofasequentwillbedonein apositivephase.1 Thetop()erasestheformulascorrespondingtoprocessesthatwerenotexecuted.Wewilldenoteby!L[[]]themappingof! L[[·]]toelementsin andby! themappingof! toelementsin.
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 sequentL
[[]], : ·;
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]
hasaproofinILLFifandonlyifG,
: ·;
·
→ [
G]
isprovableinILLF.Moreover,if∀
x.
p(
x)
L[
[
P]
]
∈
L[
[]
]
thenthefollowingsequentisnotprovableL
[[]],
G
,
: [∀
x.
p(
x)
L
[[
P]]]; · →
GProof. Consider aproofof
L[
[]
],
G,
: ·;
·
→ [
G]
.NotethatalltheformulasinG arestrictlypositiveandtheconnectives∃
and⊗
(ontheright) donotlosefocus.Hence, weendupeitherwithasequentL[
[]
],
G,
: ·;
·
→ [
1]
(thatfinishes immediately)orwithaderivationoftheshapeπ
L
[[]],
G
,
: ·; · ⇒
AL
[[]],
G
,
: ·; · → [!
A] !
RThe derivation
π
theneithercontinuesby focusingon A oronsome formulainL[
[]
],
G
or.Assumethat
∀
x.
p(
x)
L[
[
P]
]
∈
L[
[]
]
ischosenforfocusing.Since∀
and−◦
arenegative,focuswillnotbelostandπ
musthavetheshapeL
[[]],
G
,
: [
L
[[
P]]]; · →
GL
[[]],
G
,
: ·; · → [
p(
t)
]
L
[[]],
G
,
: [∀
x.
p(
x)
L
[[
P]]]; · →
G∀
L,
−◦
LL
[[]],
G
,
: ·; · ⇒
G DLCButthe sequent
L[
[]
],
G,
: ·;
·
→ [
p(
t)
]
isnot provablesince p isatomic, positiveandnota constraint.Thatis,focus cannotbelostandtheproofcannotfinishwiththeinitialaxiom,since p isnotinL[
[]
]
∪
G ∪
.2
Now let usexplain why, evenwith focusing,we do notobtain an adequacy atthe FCD level. Let P
=
ask c then P . HencefocusingonL[
[
P]
]
wouldproducethederivationπ
1ϒ
: , [
L
[[
P]]]; · →
Gπ
2ϒ
: ·; · → [
c]
ϒ
: , [
cL
[[
P]]]; · →
G∀
L,
Lϒ
: ; · ⇒
G DLObservethatc isaguard,hence
c willbedecomposedentirelyintosubformulasoftheshape1 and!
A.FromLemma 4.1weknowthattheproofof
!
A mustproceedbyusingconstraintsandnon-logicalaxiomsonly,matchingexactly the seman-ticsgivenbyruleRA.However,notethatL[
[
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,
−◦
Lwhere
π
1istheproofofc fromtheclassicalformulasinϒ
,andA
disthemulti-setofatomicsubformulasofd.IfG isnotatomicandthelastruleappliedin
π
2 is DR,thenmustbeempty, G willbecompletelydecomposedintoitsatomic
. . .
π
1ϒ
: ·; · → [
c]
π
2ϒ,
A
d: ·; · ⇒
Aϒ
: ·;
d⇒
Aϒ
: [
d]; · →
A Rlϒ
: [
c−◦
d]; · →
A−◦
Lϒ
: ·; · ⇒
A DLC. . .
ϒ
: ·; · → [
G]
ϒ
: ·; · ⇒
G DRwhere 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
.Allsuchtransitionsstartwiththenegativeactiontell
(
a∧
b)
:Trace
1: ∅;
P; true −→ ∅;
A1A2;
a∧
b−→ ∅;
ask b then tell(ok)A2;
a∧
b−→ ∅;
tell(ok)A2;
a∧
b−→ ∅;
A2;
a∧
b∧ ok −→
∗∅; ·;
d−→
Trace 2
: ∅;
P; true −→ ∅;
A1A2;
a∧
b−→ ∅;
A1ask a then tell(ok)
;
a∧
b−→ ∅;
A1tell(ok)
;
a∧
b−→ ∅;
A1;
a∧
b∧ ok
−→
∗∅; ·;
d−→
Trace 3
: ∅;
P; true −→ ∅;
A1A2;
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−→
∗∅; ·;
dTrace
1
andTrace
2
correspondexactly toadifferentfocusedproof ofthesequentL[
[
P]
]
−→
L[
[
d]
]
: onefocusing firstonL[
[
A1]
]
andtheotherfocusingfirstonL[
[
A2]
]
.Ontheotherhand,Trace
3
correspondstoaninterleaved execution of A1 and A2.Wenote thatsuch atracedoesnothaveanycorrespondentderivationintheILLFsystem.Infact,since isanegative connective,focusingonL[
[
A1]
]
willdecomposetheformulaab
ok
producingthefocusedformula bok
,whichisstillnegative.Hencefocusingcannotbelostandtheinneraskhastobetriggered.Remark 4.1. This last example shows something really interesting: although the formulas A
⊗
B−◦
C and A−◦
B−◦
Care logicallyequivalent, they areoperationallydifferent whenconcurrentcomputations areconsidered. Infact,ifwe allow processestoconsumeconstraints[15],aninterleavingexecutionastheonein
Trace
3
maynotoutputtheconstraintok
, sinceagentsmaycompeteforthesameresources.Onlooking fora 1–1 correspondencebetweenproofsin ILLFandoperational steps,one hastwo options: (1)to force theoperationalsemanticstoexecuteatoncenestedaskagents,thusrulingoutbehaviorsastheonein
Trace
3above;or (2)tointroducethesocalledlogicaldelaysintheencodingofL[
[·]
]
,allowing ILLFderivationstomimicTrace
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,respectivelyd
c1∧ ... ∧
cn(
X;
P,
;
d)
; (
X;
Q,
;
d)
RAMp
(
x)
=
P d(
c1∧ ... ∧
cn)
[
y/
x]
(
X;
p(
y),
;
d)
−→ (
X;
Q[
y/
x], ;
d)
RCMwherethesidecondition
meansthat P isaprocessoftheshape:
ask c1then ask c2then
...ask c
nthen Q (1)andQ isnotanaskagent.InRCM,ifP isnotanaskagentthenn
=
0 andthesideconditiond(
c1∧...
∧
cn)
[
y/
x]
becomethe 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 inTrace 3
ofExample 4.1.Onthecontrary,inamaximalderivationγ
;
γ
,an askhavingtheformofEquation(1)above hastowait untilalltheguardsc1,...
,
cn can beentailedfromthe store.Then,itexecutes Q inone step(asinTrace
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)
cProof. 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.
emc.Wenotethatthestoreevolvesmonotonically,i.e.,eiej forall j≤
i.Moreover,askagentsquerythestorewithout affectingit(RuleRA). Consider aprocess R
=
ask c1 then ask c2 then...
ask cn then Q in agivenconfigurationin thederivation above. Weknowthat R can addinformation tothe store iff Q isexecuted. Thishappensiff thereisa configuration
γ
kwithstoreekentailingthelastguardofR (i.e.,ekcn).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 sequentL
[[]], : ·;
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−◦
Frespectively.
Observe that
δ
+(
F)
≡ δ
−(
F)
≡
F , hence delayscan be used inorder toreplace a formulawith a provablyequivalent formulaofagivenpolarity.WedefinetheencodingL[
[·]
]
+asL[
[·]
]
butreplacingthefollowingcases:L
[[
ask c then P]]
+=
cδ
+(
L
[[
P]]
+)
L
[[
p(
x)
=
P]]
+= ∀
x.
p(
x)
δ
+(
L
[[
P]]
+)
Theuseoftheencodingaboveforcesthefocusingphasetoend.Inthiscase,wecanhaveastrongeradequacytheorem forthewholeCCPsystem.
Theorem 4.5 (Strongadequacy–standardderivations).LetP beaprocess,
beasetofprocessdefinitionsand
beasetof non-logicalaxioms.Then,foranyconstraintc,
P
⇓
c iff there is a proof of the sequentL
[[]]
+,
: ·;
L
[[
P]]
+⇒
c⊗
inILLF.TheadequacylevelisFCD.Proof. By straightforwardcaseanalysis.Toillustrate,considerthederivation
L
[[]], : ·;
L
[[
P]] ⇒
GL
[[]], : ·; δ
+(
L
[[
P]]) ⇒
G⊗
L,
1LL
[[]], : [δ
+(
L
[[
P]])]; · →
G RLL
[[]], : ·; · → [
c]
L
[[]], : [
cδ
+(
L
[[
P]]
+)
]; · →
G∀
L,
−◦
LL
[[]], : ·; · ⇒
G DLCObservethatthepositiveformula
δ
+(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 Qtell(
d)
. P mayproceedbyaddingc tothestore,thenreducingtheaskagentto Q andfinallyaddingd tothestore.TheILLFderivationsfor
L[
[
P]
]
startswithanegativephasedecomposingc andd.Then itfocusesontheencodingoftheaskagenttoproduce Q .Inotherwords,thefocusingdisciplineforcestopostponethe executionoftheaskagentafterintroducingbothc andd.2. Theoperationalsemanticsstoresc in
tell
(
c)
tothecurrentstored producingc∧
d inonestep.Theencodingc mayuseseveralapplicationofthenegativerules
⊗
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
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 IPi.
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=
&IL
[[
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:
•
PciffthereisaproofofthesequentL[
[]
],
: ·;
L[
[
P]
]
⇒
c⊗
•
P⇓
ciffthereisaproofofthesequentL[
[]
]
+,
: ·;
L[
[
P]
]
+⇒
c⊗
Moreover,thelevelofadequacyinbothcasesisFCD.Negativeactions.ThediscussiononSection4.3takesanewperspectiveinthecaseofguardedchoices.NotethatGCprocesses areaffectedbytheschedulingpolicyoftheparalleloperator.Thismeansthat,ingeneral,GCprocessesarenotconfluentin thesenseof[16].TakeforinstancetheprocessP
=
tell(
c)
Q where Q=
asktrue
then Q1+
ask c then Q2.IfQ isfirst chosen forexecution,theonlyalternativeforQ istoexecute Q1.Onthecontrary,iftell
(
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 exhibitsatransition(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]
PositivePhase ϒ: 1; · → [P] ϒ : 2; · → [Q] ϒ: 1, 2; · → [P⊗Q] ⊗ r ϒ: , , [ Ni]; · →P ϒ: , , [N1& N2]; · →P &Li ϒ: 1; · → [P] ϒ : 2, ,[N]; · →Q ϒ: 1, 2, ,[P−◦N]; · →Q −◦ l ϒ: ; · → [ Pi] ϒ: ; · → [P1⊕P2] ⊗Ri ϒ: ; · → [P{t/x}] ϒ: ; · → [∃xP] ∃r ϒ: , , [N{t/x}]; · →P ϒ: , , [∀xN]; · →P ∀l ϒ: ·; · ⇒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 ϒ: ; ,Aa⇒R 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)
| ↑
PwhereP
,
Q arepositivewhileM,
N arenegativeformulas.Thesymbols↑
and↓
markthechangingofpolarities.Thesyntax forcontextsisthefollowing:= ,
Nϒ
:= · |
:= ϒ,
A:= []
:= ϒ,
PTheintuitionisthefollowing:
,
ϒ,
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↓
arrowsandthecontextandrestricting
toasingleton inmDL,mILLcollapsestoILLF.
2
5.2. Maximalmulti-focusing
Thefollowingareadaptedversionsofdefinitionsin[10,9].
Definition 5.1. Theproofs
1
and2
ofthesamemILLsequentarelocallypermutableequivalent,written1
∼
2,ifeach can be rewritten to theother using intra-phase permutations, that is, permutationsinside a phase step.1
and2
arepermutableequivalent, written