Lecture 18: PCF Böhm trees, Innocent strategies, Hyland-Ong Games

Lecture 18

λ-calculus: Normal forms of the form

Mλx0,,xn.WWncase xAM1Mp is [n1W1nqWq] where A=σ1σpnat

NB: this term is not allowed λf.f, where f:natnat in PCF Böhm trees, because of the form of A above. Only way to fix it: η-expand it: λf,x.fx

Exercise: Show that any real PCF term reduces to a some (infinite) Böhm tree.

⟹ Infinite Böhm trees are η-long normal forms.

σnatσσ

NB: so σ is of the form σ1σnnat.

Typing rules:

W:natλx1σ1,,xnσn.W:σ1σnnat n:nat M1:σ1Mp:σpW1:natWq:natx:σ1σpnatcase xM is [niWi]:nat

First goal: Compile PCF Btrees into “strategies” written using the following vocabulary:

(natnat)natnat is turned into

%3 nat_11 nat_11 nat_1 nat_1 nat_11->nat_1 nat_ε nat_ε nat_1->nat_ε nat_2 nat_2 nat_2->nat_ε

The vocabulary will consist of moves of the form

?unu

with the convention that

  • ?ε: Opponent (O)
  • nε: Player (P)

and

  • If ?v is O for σi, then ?iv is a P for A
  • If ?v is P for σi, then ?iv is a O for A

NB: this is reminiscient of values of MM being either values of M or cells of M

+ an equipement of pointers from P moves back to O moves

cf. picture

Innocent Strategies

Innocent strategies: between memoryless ones and those retaining complete history.

Warmup Example:

lor:nat1nat2natε hλf. case f(3) is [47,69]:(nat11nat1)natε

Kierstead (student of Curry (who was working on higher-order recursive functions)) terms:

From now on,

case xM is an abbrev. for case xM of [00,11,,22,]infinite list Kierstead:((natnat)nat)natKierstead1:λf.case f(λx.case f(λy.case x))Kierstead2:λf.case f(λx.case f(λy.case y))

cf. picture


We will define a cartesian closed category of Hyland-Ong Games.

  • Morphisms = innocent strategies

    Two equivalent forms:

    • meager (set of views):

      • where Opponent moves point to their direct Player parent move

      • composition via abstract machines

    • fat (set of plays)

      • composition is defined in one line

    NB: it’s similar to what we had with sequential algorithms: meager (AM) vs. fat (abstract algorithms)

Example: cf. picture

Kierstead applied to h

Arenas (HO)

An arena is given by

(M,λ:M{O,P})

where

  • M stands for the moves
  • ⊢⊆MM×M

    • if m, then m is an O
    • if mn, then m and n are of opposite polarities

Cartesian Product

A=(M,λ,)A=(M,λ,) A×A=((M.1)(M.2)M,λ,)

where

λ(m.1)=λ(m)mm.1nn.2m1m2m1.1m2.1

Function Space

AA=(M,λ,) M=M.1M.2λ(m.1)=λ(m) (P becomes O and vice versa)λ(n.2)=λ(n)

And the rules are the same as the ones of the product, except the intial rules:

nn.2 mnn.2m.1 m1m2m1.1m2.1 n1n2n1.2n2.2

Strategies (morphisms in our category)

A play is an alternating sequence of moves in M starting with O, equipped with pointers from all occurrences (of non-initial moves) in the sequence in such a way that

  • if mi points to mj for j<i, then mjmi

(cf. picture)

A strategy:

is a set σ of even-length plays closed under even prefixes

NB: definition by Russ Harmer. It is very practical for non-determinism.

A strategy σ is deterministic:

if moreover: whenever sm1,sm2σ, where the mi’s point in s, it comes that m2=m1

Innocent strategies

A strategy σ of A is called innocent (Hyland Ong (HO)):

if for all s (ranging over plays of A):

sσsP view of sσ

where the view of a play is defined as:

ε=εsn=sn if λ(n)=Psm=m if λ(m)=O and msnsm=snm if m points inside n

Exercise: When we had the interaction h(f), we spotted a play s that belonged to h. Compute s.

A view:

is a sequence s such that s=s

Meager strategies

Given an innocent strategy σ, we can define

meager(σ){set of views ssσ}

Prop: meager is injective.

Innocent strategies can be composed in two ways:

  • either as strategies (parallel composition + hiding)
  • or as meager strategies (abstract machines)

Parallel composition

Let

  • σ be a strategy of AA
  • σ be a strategy of AA

Then we define

σσ{vvplays(AA) and usequence of moves taken in A,A,A together with pointers st v=u|A,A,wu|A,Aσ,wu|A,Aσ}

NB:

  • Hiding: because the everything related to A has been kept private (hidden) in the final result
  • Parallel composition: because w and w are obtained from the same u

  • This definition works even without determinism nor innocence, but the equivalence with meager strategies holds only when we have innocence

nat={{?}{λ(?)=O,λ(n)=P?,?n}

Next time:

  • give a precise definition of the compilation from PCF Böhm trees to innocent strategies

  • Suggest: the characterisation of the image of this compilation (which is injective: two different Böhm tress give rise to different strategies)

  • Well-parenthesisation: exclude catch and or_tester

  • How to interpret some imperative features in the setting of HO games (imperative features ⟶ non-innocent strategies)

Leave a comment