Lectures onType Theory
Typed potentials and session protocols
appendix sectionrules

Typed potentials and session protocols

Chapter 57: polynomial AARA

The fixed resource metric is Kpair=Kcons=1,Kic=0 otherwise. Evaluation is terminating big-step V,Hqqev,H and typing is Σ;Γppe:A. Degree-d list potential uses φ(n,p)=i=1dpi(ni),C(p1,,pd)=(p1+p2,,pd1+pd,pd). The identity φ(n+1,p)=p1+φ(n,Cp) drives both list construction and matching. The evaluation rules used by the soundness proof are

V(x1)=v1V(x2)=v2ldom(H)
V,Hqq+Kpair(x1,x2)l,H[l(v1,v2)]
E-Pair
V(xh)=vhV(xt)=vtldom(H)
V,Hqq+Kconscons(xh,xt)l,H[l(vh,vt)]
E-Cons
V,Hq2q1K1lete1v1,H1V[xv1],H1q3+K3letq2K2lete2v2,H2
V,Hq3q1let x=e1 in e2v2,H2
E-Let
[y1fv1,,ykfvk],Hu+K2appuK1appefv,H
V,Huuf(x1,,xk)v,H
E-FunApp

List construction and the structural typing rules are

p=(p1,,pd)
Σ;xh:A,xt:LC(p)(A)0p1+Kconscons(xh,xt):Lp(A)
T-Cons
Σ;Γ1pqK1lete1:AΣ;Γ2,x:Aq+K3letpK2lete2:B
Σ;Γ1,Γ2qqlet x=e1 in e2:B
T-Let
Σ;Γ,x:A1,y:A2qqe:Bshare(A;A1,A2)
Σ;Γ,z:Aqqe[z/x,z/y]:B
T-Share
Σ;Γqqe:Bxdom(Γ)
Σ;Γ,x:Aqqe:B
T-Weak

Function application, empty lists, subtyping, and relaxation are

Σ(f)=(A1,,Ak)q/qA
Σ;x1:A1,,xk:AkqK2appq+K1appf(x1,,xk):A
T-FunApp
A type
Σ;0Knil[]:L0(A)
T-Nil
Σ;Γ,x:Aqqe:BA0<:A
Σ;Γ,x:A0qqe:B
T-Supertype
Σ;Γqqe:BB<:B0
Σ;Γqqe:B0
T-Subtype
Σ;Γppe:Bqpqpqp
Σ;Γqqe:B
T-Relax

Sharing splits coefficients additively; affine weakening adds an unused assumption; same-shape subtyping may only discard potential. Soundness assumes a well-formed stack and heap, an existing terminating evaluation, a typing derivation, and nonnegative slack. It returns the same value and heap with residual resource at least the output potential plus the promised residual annotation and slack.

Chapter 21: finite logical sessions

The selected provider judgment is Γ;ΔP::z:A, with unrestricted Γ, linear Δ, and pairwise-disjoint interface names. The type constructors 1,AB,AB,AB,A&B,!A follow the intuitionistic-linear right/left rules. The unit, tensor, implication, and cut rules are

Γ;0::z:1
1R
Γ;ΔP::z:C
Γ;Δ,x:1P::z:C
1L
Γ;Δ1P::y:AΓ;Δ2Q::x:B
Γ;Δ1,Δ2(νy)xy.(PQ)::x:AB
Γ;Δ,y:A,x:BP::z:C
Γ;Δ,x:ABx(y).P::z:C
Γ;Δ,y:AP::x:B
Γ;Δx(y).P::x:AB
μltimapR
Γ;Δ1P::y:AΓ;Δ2,x:BQ::z:C
Γ;Δ1,Δ2,x:AB(νy)xy.(PQ)::z:C
μltimapL
Γ;Δ1P::x:AΓ;Δ2,x:AQ::z:C
Γ;Δ1,Δ2(νx)(PQ)::z:C
Cut

Cut connects exactly one provider to one client. Replicated provision has an empty linear context. Principal cut reductions synchronize send/receive and selection/branch. The unit has no communication action: 1R is inaction and 1L leaves its process unchanged. The additive rules are

Γ;ΔP::x:A
Γ;Δx.inl;P::x:AB
⊕R_1
Γ;ΔP::x:B
Γ;Δx.inr;P::x:AB
⊕R_2
Γ;Δ,x:AP::z:CΓ;Δ,x:BQ::z:C
Γ;Δ,x:ABx.case(P,Q)::z:C
⊕L
Γ;ΔP::x:AΓ;ΔQ::x:B
Γ;Δx.case(P,Q)::x:A&B
Γ;Δ,x:AP::z:C
Γ;Δ,x:A&Bx.inl;P::z:C
_1
Γ;Δ,x:BP::z:C
Γ;Δ,x:A&Bx.inr;P::z:C
_2

Replication is governed by

Γ;P::y:A
Γ;!x(y).P::x:!A
!R
Γ,u:A;ΔP::z:C
Γ;Δ,x:!AP[x/u]::z:C
!L
Γ,u:A;Δ,y:AP::z:C
Γ,u:A;Δ(νy)uy.P::z:C
Copy
Γ;P::y:AΓ,u:A;ΔQ::z:C
Γ;Δ(νu)(!u(y).PQ)::z:C
Cut!

Preservation retains the same judgment. Closed progress requires ;P::x:1 and a live nonreplicated top-level prefix. The local recursive extension is both contractive and tail-recursive: every transmitted session type is closed with respect to the surrounding recursion variables. Naive syntactic duality commutes with unfolding only on that fragment; arbitrary contractive types require message closure or another corrected duality. The recursive equality and typing closure rules are

S[μt.S/t]T
μt.ST
Eq-Unfold-L
ST[μt.T/t]
Sμt.T
Eq-Unfold-R
Γ;Δ,x:SP::z:CST
Γ;Δ,x:TP::z:C
T-Rec-Conv

The separate graded journal card first defines buffered(C,Δ). It says exactly that every runtime channel typed Chan(Recv A P) has a head value. Term/global progress and post-context preservation require the paper’s separately typed term, process, and channel configurations. Primitive rules use SingleAction and ExactSemiring, ReceivePrefix, or Sends where displayed; Graded n P is a protocol type function in the multicast channel type, not a predicate premise.

Chapter 59: repaired MPST and Pirouette

The repaired global/local types have explicit queue addresses. Full projection is partial. A global type is coherent exactly when it is projectable, linear, and coinductively unstuck: every relaxed barb has a true global transition to another unstuck type. Local and decomposed local/queue environments inherit coherence through full projection and a path decomposition. Subject reduction allows the coherent global specification either to remain fixed or to make one labelled interaction step, and yields a possibly changed process typing environment and queue specification. Linearity closes the input- and output-dependency relations by

IO(a0,a1)InDep(a1,,an)
InDep(a0,a1,,an)
I-Step
IO(a0,a1)OO(a0,a1)
OutDep(a0,a1)
O-Base
IO(a0,a1)OO(a0,a1)OutDep(a1,,an)
OutDep(a0,a1,,an)
O-Step

The process and queue interfaces are connected by

Γe:UΓDPCΔ,sp:T;Q
ΓDsp[k]!e;PCΔ,sp:!kU.T;Q
T-Send
Γv:UΓDs[k]::h~CΔ;Q
ΓDs[k]::(h~p!v)CΔ;Q(k,p,U)
T-Queue

Communication safety follows; progress, deadlock freedom, orphan freedom, fairness, and liveness do not.

Pirouette is a separate synchronous calculus parameterized by a local language with decidable location equality, substitution laws, closed values, unique typing and structural/substitution rules. Relative progress also needs Boolean inversion and local progress; relative preservation needs local preservation. The choreography semantics uses block sets for out-of-order steps and synchronizes higher-order calls globally. Endpoint projection uses partial merge. Global projection soundness assumes LN(C)L. The reached-projection deadlock corollary separately assumes PirExprClosed(C), the displayed choreography typing judgment, and a choreography type system with progress and preservation.

Search the book

Type to search the local edition.