• No results found

2.2 Formalization and Notation

2.2.5 Executions

We define executions of anesmoresm-skAby first choosing aninterpretationI. An inter- pretationImust satisfy the following: (1)Imaps each functionf ∈F\Uto its predefined or nominal interpretation, and (2)Imaps each functionfu ∈Uto some valid interpretation. Given the set of state variables V ofA, a valuation σmaps each each variablev ∈ V to a value of the appropriate type,σ(v). Let SV be the set of all such valuations, given a set of

variablesV. Given a valuationσ∈SV, a variablex /∈Vand a valuevx∈typeof(x), we write

σ[x7→vx]∈SV{x}to denote the valuation that maps all variablesy6=xtoσ(y)and mapsx tovx.

Astateof anesmoresm-skAis defined as a pair(l,σ), wherel∈Landσ∈SV. Given

a transitionr ∈ R, ofA, of the formr , hl,m,guard,updates,l0i, and an interpretationI, we say thatrisenabledwith respect toIat a state(p,σ), if and only if (1) substituting each variablev∈Vwithσ(v)in the expression forguardresults in the guard being equivalent to true, and (2)p=l. Note that given an interpretationI, the expressionguarddefines a set of valuations where the transitionris enabled. We write [[guard,I]] to denote this set. Similarly, given the interpretationI,updatesdefines a function:

• [[updates,I]] :SV →SV{m

p}, ifris an output transition; heremp∈/ Vis a variable that represents the payload of the outgoing messagemand has typemtype(m).

• [[updates,I]] :SV{mp} → SV, ifris an input transition; heremp ∈/ V is a variable that represents the payload of the incoming messagemand has typemtype(m).

• [[updates,I]] :SV →SV, ifris an internal transition.

We define anexecutionofA, under an interpretationIby describing the sequence of states

• (l,σ) m?vm

−−−−→ (l0,σ0) if and only ifAhas aninputtransitionr ∈ Ri, which has the form r,hl,m,guard,updates,l0i,σ∈ [[guard,I]], and [[updates,I]] (σ[mp7→vm])≡σ0. • (l,σ) m!vm

−−−−→ (l0,σ0)if and only ifAhas anoutputtransitionr ∈Ro, which has the form r,hl,m,guard,updates,l0i,σ∈ [[guard,I]], and [[updates,I]] (σ)≡σ0[mp7→vm].

• (l,σ) (l0,σ0) if and only if Ahas an internaltransition r ∈ R, which has the form

r,hl,m,guard,updates,l0i,σ∈ [[guard,I]], and [[updates,I]] (σ)≡σ0.

For notational convenience we write(l,σ) → (l0,σ0) if (1) there existmandvmsuch that

(l,σ0) m?vm

−−−−→ (l0,σ0), or (2) there exist m and vm such that (l,σ) −m−−−!v→m (l0,σ0), or (3)

(l,σ) (l0,σ0). Further, given a named transitiont,hl,m,guard,updates,l0i, we also write (l,σ)t (l0,σ0), to denote(l,σ) m?vm

−−−−→(l0,σ0), or(l,σ) m!vm

−−−−→(l0,σ0), or(l,σ) (l0,σ0)if

t∈Ri,t∈Ro, ort∈Rrespectively.

An executione of anesmoresm-skAunder an interpretationIis thus a sequence of the following form: e ,(l00)→ (l11)→ · · · → (lnn) → · · ·, where for everyj >0,

(ljj)is a state ofA,(l00)is an initial state ofA, and for everyj>0,(ljj)→(lj+1j+1). An execution may be finite or infinite.

A state(l,σ)of anesmoresm-skAisreachableunder an interpretationIif and only ifA has a finite execution of the form(l00)→(l11)→ · · · →(l,σ), underI. A state(l,σ)ofA is calleddeadlockedunder an interpretationIif and only if there does not exist a state(l0,σ0)

such that(l,σ) →(l0,σ0). In other words, no transitions ofAare enabled in a deadlocked state. Anesmoresm-skAis calleddeterministicunder an interpretationIif for every state s= (l,σ)ofA, if it is the case that there are multiple transitions enabled in states, then each of them is an input transition and each of them corresponds to the receipt of adistinctmessage.

Lastly, an infinite executione,(l00)→(l11)→ · · · of anesmoresm-skA, under an interpretationIis called afairexecution if and only if both of the following hold:

1. For eachF∈Fw, if there exists aksuch that for alli>k, some transitiont0∈Fis enabled

at state(lii)ineunderIthen there existsj>k, such that(lkk)t (lk+1k+1)is a step ine, wheret∈F. Informally, if some transition inF∈Fwis enabled at every point in an executioneunder an interpretationIafter a finite prefix ofe, then some transition inF must be taken in the infinite suffix of the executione.

2. For each F ∈ Fs, if there exist infinitely manyi in such that some transitiont0 ∈ F is

enabled at state(lii)ine, underI, then there must also exist infinitely manyj such that(ljj) t (lj+1j+1) is a step ine, wheret ∈F. Informally, if some transition in

F∈Fwis enabled infinitely often in an executione, under an interpretationI, then some transition inFmust also be executed infinitely often in the executione.