Lectures onType Theory
Interaction trees and compositional linearizability
appendix sectionrules

Interaction trees and compositional linearizability

Guarded interaction trees

For E:UiUi and R:Ui, the complete constructor rules used in chapter 86 are

Γr:R
ΓRet(r):ITree(E,R)
ITree-Ret
Γt:ITree(E,R)
ΓTau(t):ITree(E,R)
ITree-Tau
Γe:E(X)Γk:XITree(E,R)
ΓVis(e,k):ITree(E,R)
ITree-Vis

Recursive calls must occur below Tau or inside a continuation of Vis. Bind and interpretation are governed by the six equations (Bind-Ret)(Bind-Vis) and (Interp-Ret)(Interp-Vis).

For a candidate subtree relation S, the complete one-layer weak rules are

a=b
EuttF(S,Ret(a),Ret(b))
Eutt-Ret
e:E(X) is identical on both sidesx:X. S(k(x),h(x))
EuttF(S,Vis(e,k),Vis(e,h))
Eutt-Vis
S(t,u)
EuttF(S,Tau(t),Tau(u))
Eutt-Tau
EuttF(S,t,u)
EuttF(S,Tau(t),u)
Eutt-TauL
EuttF(S,t,u)
EuttF(S,t,Tau(u))
Eutt-TauR

eutt is the greatest fixed point of this monotone operator. The two asymmetric rules remain inside the inductive layer and therefore remove only finitely many unmatched silent steps.

The LTS and module rules

The artifact-local type ProgE(A) is the greatest fixed point of F(X):=A+X+BE(B)×(BX), with observations Return, Tau, and Vis. Its productive substitution is the mutually corecursive pair subst and bindSubst whose six observation equations are displayed in definition 87.3; in particular, substM(Vis(m,k))Tau(bindSubstM(k,M(m))). The sequential-consistency judgment for finite thread traces is generated by

SeqCons(a,[])
CL-Seq-nil
a(i)=nonea(i)=someA,mji. a(j)=a(j)SeqCons(a,p)
SeqCons(a,i:call(m)::p)
CL-Seq-call
a(i)=someA,ma(i)=noneji. a(j)=a(j)SeqCons(a,p)
SeqCons(a,i:ret(m,v)::p)
CL-Seq-ret

For M:Impl(E,F) and V:SpecT(E), the four visible thread-local linking rules are

q(i)=Idle
qi:call(m)q[iCont(m,M(m))]
CL-Overlay-call
q(i)=Cont(m,Return(v))
qi:ret(m,v)q[iIdle]
CL-Overlay-ret
q(i)=Cont(m,Vis(u,k))sStepV(i:call(u))s
(q,s)CL(q[iUCall(m,u,k)],s)
CL-Underlay-call
q(i)=UCall(m,u,k)sStepV(i:ret(u,v))s
(q,s)CL(q[iCont(m,k(v))],s)
CL-Underlay-ret

The silent case changes Cont(m,Tau(p)) to Cont(m,p) and leaves the underlay state fixed. Interleaving chooses one thread name and applies one thread-local rule; there is no scheduler state.

Possibility commits and LHL program rules

For possibilities ρ,σ over VF, the two target commits are

ρSStepVF(i:call(m))σSρC(i)=CallPoss(m)σC(i)=CallDone(m)ρR(i)=σR(i)=RetIdleji. (ρC(j),ρR(j))=(σC(j),σR(j))
ρPossStepiσ
LHL-Commit-call
ρSStepVF(i:ret(m,v))σSρC(i)=σC(i)=CallDone(m)ρR(i)=RetIdleσR(i)=RetPoss(m,v)ji. (ρC(j),ρR(j))=(σC(j),σR(j))
ρPossStepiσ
LHL-Commit-ret

Every lifted commit and return step separately requires an inhabited successor predicate and predecessor/successor reachability coverage.

For SameExcepti(f,g):=ji.g(j)=f(j) and possibility predicates X,Y, put Advance(X,Y):=(σ.Yσ)σ.Yσρ.XρPossSteps(ρ,σ). For interaction states s=(q,x) and t=(q,x), the exact commit obligation is Commiti(G,P,e,Q)s,X,t.P(s,X)SameExcepti(q,q)UnderStep(q(i),Some(e),q(i))xStepVE(i:e)xY.Advance(X,Y)Q(s,X,t,Y)G(s,X,t,Y). The silent obligation replaces Some(e) by None and requires both the underlay state and possibility predicate to remain fixed. Use the reset and consumption operations from definition 88.6, and put ZY:=ConsumeSeti,m,v(Y). The exact return obligation is s=(q,x),X.P(s,X)q(i)=Cont(m,Return(v))Y.Advance(X,Y)σ.YσσR(i)=RetPoss(m,v)σC(i)=CallDone(m)Q(s,X,Reseti(s),ZY)G(s,X,Reseti(s),ZY).

The program judgment is the greatest relation closed by exactly these three outer-form rules:

PQ(v)
R,G,i{P}Return(v){Q}
LHL-Return
Stable(R,S)Silenti(G,P,S)R,G,i{P;S} p {Q}
R,G,i{P}Tau(p){Q}
LHL-Tau
Stable(R,I)Stable(R,Sv) (v:A)Commiti(G,P,call(m),I)v:A. Commiti(G,P;I,ret(m,v),Sv)v:A. R,G,i{P;I;Sv} k(v) {Q}
R,G,i{P}Vis(m,k){Q}
LHL-Vis

The module record additionally contains the eight field families listed in definition 88.8, including C and all_return.

Search the book

Type to search the local edition.