Fair testing vs. must testing in a fair setting
Tom Hirschowitz and Damien PousGoal
Reconcile, in the particular case of Milner’s CCS,
Joyal, Nielsen, and Winskel’s 1993 (JNW) approach to concurrency theory,
with
theinteractive approach to behavioural equivalences:
I testing semantics in process algebra (Hennessy and De Nicola, Beffara),
I Krivine realisability,
I game semantics (Hyland and Ong, Abramsky et al.), Girard’s ludics.
Review of JNW
CategoryP of (non-empty)paths, i.e.:
I objects: non-empty words over an alphabetA; I morphisms: prefix extensions, e.g.,abc →abcd.
Presheaves bP, i.e., functorsPop →Set.
Presheaves are like trees. Examplesab+ac anda(b+c). Natural transformations are like functional simulations. Example.
Positions
LetCbe:
. . . n . . . p . . .
?. 0
n−1
...
0
p−1
...
Definition
Positions are presheaves onC.
Example
F(?) ={a,b},
F(1) ={X1,X3},
F(2) ={X2},
F(?−→0 1)(X1) =a,
Notation: X1·0 =a.
X2·0 =a,X2·1 =b,
X3·0 =b.
X1 X2 X3
a b
0 0 1 0
The category of elementsR F.
Moves from natural deduction, example: input
a1, . . . ,an`P
a1, . . . ,an`ai.P
Add an objectι−n,i to C:
? n ι−n,i
0
n−1
s t
·· ·
Motivating the definition
The category of elements of the representableι−3,2 is the partially ordered set generated by
t·0
t t·2
t·1
ι−3,2
s·0
s s ·2
Forking
The category of elements of the representableπ3 is the partially
ordered set generated by
t10 =t20
t1 t2 t12 =t20
t11 =t21
π3
s0
s s2
Name creation
The category of elements of the representableν2 is the partially
ordered set generated by
t·0
t t·2
t·1
ν2
s·0
s s·1.
Tick
t0
t t2
t1
♥3
s0
s s2
Synchronisation: the 4th dimension
ρt0
ρt ρt2 =t1 t t0
ρt1
ρ
ρs0
ρs ρs2 =s1 s s0
ρs1.
Examples
The two maximal executions ofa|b, which are actually equal. Ifa=b, one more execution.
An execution ofa|µX.(X |X). Some “wrong” examples.
Restrictions and moves
A restrictionfrom X to Y is a cospan Y ,→X ←id−-X.
A movefromX toY is a cospanY ,→M ←-X of presheaves
obtained
I from a cospanY0
t’s
,−−→M0 s
←−-X0, I withM0a representable of dim 2 or 3, I by identifying some names.
Observations
DefinitionAnobservationis a presheaf U ∈Cb isomorphic to a possibly denumerable “composition” of moves and restrictions in
Cospan(Cb):
X0 X1 . . . Xn Xn+1 Xn+2 . . .
M0 . . . Mn Mn+1 . . .
U
The category
E
of observations
Objects: X ,→U in Cb withI U an observation, I X its base;
Morphisms: all commuting squares
U V
X Y.
Obvious functor to positionsπ:E→B:
A Grothendieck topology
Let? have dimension 0,n have dimension 1, and so on up to 3.
Definition
Let a sieveS onX ,→U inE beview-covering when it is jointly
Elementary views
Anelementary view fromX toY is a composite of a move from a representable,
followed by a restriction to a representable:
n0 ,→X ←id−-X ,→M ←-n.
Views
Definition
Aviewis an observation X ,→U isomorphic to a possibly
Views are a canonical covering
Proposition
For any observation X ,→U, the sieve generated by morphisms
from finite views into U is covering.
Proposition
The categories
E
XHere we want to relativise to a base positionX. Definition
LetEX have as objects U ←-Y →X, and morphisms
transformations between such withX fixed.
U U0
Y Y0
X
Strategies as sheaves
Definition
The stack of strategies
Proposition
This X 7→SX extends to a functorS : Bop →CAT, which is a
stackfor the restriction of the view-covering topology to B.
Why stacks?
Strategies are only sensible up to iso.
Intuitively, only the number of possible states should matter, not the precise set of states.
Canonical spatial decomposition
LetSq(X) =a
n
X(n).
Proposition
SX '
Y
(n,x)∈Sq(X)
Temporal decomposition
Let MX be the set of moves fromX (explain the size).
For eachi ∈MX, letXi be the domain of i.
Theorem
Sn'Fam
Y
i∈Mn
SXi
.
A strategy is determined by its initial states, and
what remains of them after each possible move. Almost a sketch: would be Sn∼=Qi∈MnSXi.
Scenarioses
In concurrency,
Physical, or fair scenario: players are really independent; Interpreted, orpotentially unfairscenario: a scheduler is responsible for parallelism.
Must testing
Supposing a fixed move♥: Definition
A processP is must orthogonalto a contextC, when all maximal
traces ofC[P] play ♥at some point. Notation: P⊥mC,P⊥m
. Definition
P andQ aremust equivalent, notationP ∼m Q, when
Must testing in an unfair setting
Usually, only the unfair scenario is formalised:
P = (Ω|a) and Q = Ω
are must equivalent.
The obvious testC =a.♥ | is not orthogonal toP. Indeed, there is an infinite looping trace, maximal.
Fair testing in an unfair setting
The example(Ω|a)∼mΩ
takes potential unfairness of the scheduler into account. Usually people do not want to, and resort to:
Definition
A processP isfair orthogonal to a contextC, when all finite traces ofC[P] extend to traces that play♥at some point.
Notation: P⊥fC,P⊥f
. Definition
Closed-world observations
Definition
An observationX ,→U isclosed-world when both
a
n,i
U(ι+n,i)←− a n,i,m,j
U(τn,i,m,j) ρ − →a
n,i
U(ι−n,i) (1)
Global behaviours
Let W,→E be the full subcategory of closed-world
observations.
Let W(X) be the fibre overX for the projection functor W→B.
Definition
Let the category ofglobal behavioursonX be simply GX =W\(X).
The inclusion W(X),→WX ,→EX induces a functor
Observable criterion
Definition
Anobservable criterion consists for all positions X, of a subcategory⊥⊥X ,→GX.
Interactive equivalence
DefinitionFor any strategyS onX and any pushoutP
I Y
X Z
(2)
of positions withI of dimension 0, letS⊥⊥P be the class of all
strategiesT onY such that Gl(S kT)∈ ⊥⊥Z.
Herek denotes amalgamation in the stack S.
Fair testing
Definition
A closed-world story issuccessful when it contains a♥n.
Definition
Given a global behaviourG ∈GX, anextension of a state
s ∈G(U) toU0 is an s0 ∈G(U0) withi:U →U0 ands0·i =s. Definition
Thefair criterion⊥⊥fX contains all global behaviours G such that any states ∈G(U) for finiteU admits a successful extension.
Must testing
DefinitionAn extension ofs ∈G(U) is strictwhen U →U0 is not surjective. Definition
For any global behaviourG ∈GX, a states ∈G(U) isG-maximal
when it has no strict extension. Definition
Let themustcriterion ⊥⊥mX consist of all global behavioursG such that for all closed-worldU, and G-maximals ∈G(U),U is successful.
The key result
Theorem
For any strategy S , any state s∈Gl(S)(U) admits a
Fair vs. must
Thanks to the theorem, we have: Lemma
For all S∈SX,Gl(S)∈ ⊥⊥mX iff Gl(S)∈ ⊥⊥fX.
Proof.
LetG = Gl(S).
(⇒) By the theorem, any states ∈G(U) has aG-maximal extensions0 ∈G(U0), for which U0 is successful by hypothesis, hences has a successful extension.
(⇐) AnyG-maximals ∈G(U) admits by hypothesis a successful
extension which may only be onU byG-maximality, and henceU
Fair equals must
TheoremFor all S,S0∈SX, S ∼mS0 iff S ∼f S0.
Proof.
(⇒) Consider two strategies S andS0 onX, and a strategyT on
Y (as in the pushoutP). We have:
Gl(S kT)∈ ⊥⊥f iff Gl(S kT)∈ ⊥⊥m
iff Gl(S0 kT)∈ ⊥⊥m
iff Gl(S0 kT)∈ ⊥⊥f.
Perspectives
Short term:
Link with CCS. Kleene theorem. Longer term:
Treat π, λ, . . .
Understand the abstract structure. What is a compilation?