Representing permutations without permutations The expressive power - - PowerPoint PPT Presentation

representing permutations without permutations
SMART_READER_LITE
LIVE PREVIEW

Representing permutations without permutations The expressive power - - PowerPoint PPT Presentation

Representing permutations without permutations The expressive power of sequential intersection Pierre VIAL Equipe Gallinette Inria (LS2N CNRS) June 10, 2018 Non-idempotent typing P. Vial 0 1 /33 Outline Non-idempotent Rigid vs.


slide-1
SLIDE 1

Representing permutations without permutations

The expressive power of sequential intersection Pierre VIAL ´ Equipe Gallinette Inria (LS2N CNRS) June 10, 2018

Non-idempotent typing

  • P. Vial

1 /33

slide-2
SLIDE 2

Outline

Context Non-idempotent intersection types

Using type A once or twice not the same

Rigid vs. non-rigid paradigms

Proof red. deterministic vs. non-deterministic

Question 1 Rigid collapses on non-rigid

(A, A, B) and (A, B, A) collapse on [A, A, B]

Is this collapse surjective? Question 2 In rigid fw., red. paths captured by permutations

(A, B, A) → (A, A, B)

Is it possible to capture red. paths without perm. ?

All this in a coinductive fw. (no productivity)!

Non-idempotent typing

  • P. Vial

2 /33

slide-3
SLIDE 3

Resource calculi (intuitions)

Girard (87), Boudol (93), Kfoury (96), Ehrhard-R´ egnier (03)

Bag arguments: t [u1, . . . , un] (and not t u) Linear substitution and reduction: if t = x [x, y] then x [u1, u2] gives u1 [u2, y] or u2 [u1, y]. Taylor expansion of a λ-term (linearization): TE of t u = formal series involving ˜ t[ ], ˜ t[˜ u], ˜ t[˜ u, ˜ u], ˜ t[˜ u, ˜ u, ˜ u]. . . Adequation: B¨

  • hm tree and Taylor expansion.

Tsukada, Ong, Asada (LiCS17 and LiCS18) “compositional enumeration problem”

Rigid bags: t (u1, . . . , un) Isomorphisms to identify equivalent bags. Deterministic reduction. Adequation.

Non-idempotent typing

  • P. Vial

3 /33

slide-4
SLIDE 4

Plan

1 Non-idempotent intersection types 2 System S (Sequential Interection) 3 Encoding Reduction Paths 4 Perspectives

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 4 /33

slide-5
SLIDE 5

Terminal states and execution/reduction strategies 2 + 3 × 5

→ 2 + 15 − → 17

Reducible (non-terminal) states Terminal state

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 5 /33

slide-6
SLIDE 6

Terminal states and execution/reduction strategies 2 + 3 × 5

→ 2 + 15 − → 17

Reducible (non-terminal) states Terminal state Let f(x) = x × x × x. What is the value of f(3 + 4)?

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 5 /33

slide-7
SLIDE 7

Terminal states and execution/reduction strategies 2 + 3 × 5

→ 2 + 15 − → 17

Reducible (non-terminal) states Terminal state Let f(x) = x × x × x. What is the value of f(3 + 4)?

Kim (smart)

f(3 + 4) → f(7) → 7 × 7 × 7 → 49 × 7 → 343

Lee (not so)

f(3 + 4) → (3 + 4) × (3 + 4) × (3 + 4) → 7 × (3 + 4) × (3 + 4) → 7 × 7 × (3 + 4) → 7 × 7 × 7 → 49 × 7 → 343

Thurston (don’t be Thurston)

f(3 + 4) → (3 + 4) × (3 + 4) × (3 + 4) → 3 × (3 + 4) × (3 + 4) + 4 × (3 + 4) × (3 + 4) → dozens of computation steps . . . . . . . . . . . . . . . . . . . . . → 343

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 5 /33

slide-8
SLIDE 8

Terminal states and execution/reduction strategies 2 + 3 × 5

→ 2 + 15 − → 17

Reducible (non-terminal) states Terminal state

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 5 /33

slide-9
SLIDE 9

Terminal states and execution/reduction strategies

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 5 /33

slide-10
SLIDE 10

Terminal states and execution/reduction strategies

Initial state Terminal state

Infinite path (keeps running, never reaches the terminal state)

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 5 /33

slide-11
SLIDE 11

Terminal states and execution/reduction strategies

Initial state Terminal state Reduction strategy

Infinite path (keeps running, never reaches the terminal state)

Reduction strategy

Choice of a reduction path. Can be complete (w.r.t. termin.). Must be certified.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 5 /33

slide-12
SLIDE 12

Intersections types (Coppo, Dezani, 1980)

Goal

Equivalences of the form “the program t is typable iff it can reach a terminal state” Idea: several certificates to a same subprogram.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 6 /33

slide-13
SLIDE 13

Intersections types (Coppo, Dezani, 1980)

Goal

Equivalences of the form “the program t is typable iff it can reach a terminal state” Idea: several certificates to a same subprogram. Proof: by the “circular” implications: Some reduction strategy normalizes t t can reach a terminal state t is typable

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 6 /33

slide-14
SLIDE 14

Intersections types (Coppo, Dezani, 1980)

Goal

Equivalences of the form “the program t is typable iff it can reach a terminal state” Idea: several certificates to a same subprogram. Proof: by the “circular” implications: Some reduction strategy normalizes t t can reach a terminal state t is typable

Intersection types

Perhaps too expressive. . . . . . but certify reduction strategies!

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 6 /33

slide-15
SLIDE 15

Non-idempotency

Computation causes duplication.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 7 /33

slide-16
SLIDE 16

Non-idempotency

Computation causes duplication.

Non-idempotent intersection types

Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 7 /33

slide-17
SLIDE 17

Non-idempotency

Computation causes duplication.

Non-idempotent intersection types

Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases.

Initial certificate

Initial state

  • f the prog.

Execution

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 7 /33

slide-18
SLIDE 18

Non-idempotency

Computation causes duplication.

Non-idempotent intersection types

Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases.

Initial certificate

Initial state

  • f the prog.

Execution

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 7 /33

slide-19
SLIDE 19

Non-idempotency

Computation causes duplication.

Non-idempotent intersection types

Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases.

Initial certificate

Initial state

  • f the prog.

Execution

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 7 /33

slide-20
SLIDE 20

Non-idempotency

Computation causes duplication.

Non-idempotent intersection types

Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases.

Initial certificate

Initial state

  • f the prog.

Execution

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 7 /33

slide-21
SLIDE 21

Non-idempotency

Computation causes duplication.

Non-idempotent intersection types

Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases.

Initial certificate

Initial state

  • f the prog.

STOP

(cannot be reduced more)

Execution

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 7 /33

slide-22
SLIDE 22

Non-idempotency

Computation causes duplication.

Non-idempotent intersection types

Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases.

Initial certificate

Initial state

  • f the prog.

STOP

(cannot be reduced more)

Terminal state reached!!

Execution

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 7 /33

slide-23
SLIDE 23

Non-idempotency

Computation causes duplication.

Non-idempotent intersection types

Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 7 /33

slide-24
SLIDE 24

Non-idempotency

Computation causes duplication.

Non-idempotent intersection types

Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases.

Comparative (dis)advantages

Insanely difficult to type a particular program. Whole type system easier to study! Easier proofs of termination! Easier proofs of characterization! Easier to certify a reduction strategy!

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 7 /33

slide-25
SLIDE 25

Intersection types (Coppo-Dezani 80)

Type constructors: o ∈ O, → and ∧ (intersection).

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 8 /33

slide-26
SLIDE 26

Intersection types (Coppo-Dezani 80)

Type constructors: o ∈ O, → and ∧ (intersection). Strict types: no ∧ on the right h.s. of → (e.g., (A ∧ B) → A, not A → (B ∧ C))

no intro/elim. rules for ∧

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 8 /33

slide-27
SLIDE 27

Intersection types (Coppo-Dezani 80)

Type constructors: o ∈ O, → and ∧ (intersection). Strict types: no ∧ on the right h.s. of → (e.g., (A ∧ B) → A, not A → (B ∧ C))

no intro/elim. rules for ∧

(A ∧ B) ∧ C ∼ A ∧ (B ∧ C), A ∧ B ∼ B ∧ A (assoc. and comm.)

subtyping or permutation rules e.g.,

Γ, x : A1 ∧ A2 ∧ . . . ∧ An ⊢ t : B ρ ∈ Sn Γ, x : Aρ(1) ∧ . . . ∧ Aρ(n) ⊢ t : B perm

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 8 /33

slide-28
SLIDE 28

Intersection types (Coppo-Dezani 80)

Type constructors: o ∈ O, → and ∧ (intersection). Strict types: no ∧ on the right h.s. of → (e.g., (A ∧ B) → A, not A → (B ∧ C))

no intro/elim. rules for ∧

(A ∧ B) ∧ C ∼ A ∧ (B ∧ C), A ∧ B ∼ B ∧ A (assoc. and comm.)

subtyping or permutation rules e.g.,

Γ, x : A1 ∧ A2 ∧ . . . ∧ An ⊢ t : B ρ ∈ Sn Γ, x : Aρ(1) ∧ . . . ∧ Aρ(n) ⊢ t : B perm Idempotency? A ∧ A ∼ A (Coppo-D) or not (Gardner 94-de Carvalho 07) idem: typing = qualitative info non-idem: qual. and quant.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 8 /33

slide-29
SLIDE 29

Intersection types (Coppo-Dezani 80)

Type constructors: o ∈ O, → and ∧ (intersection). Strict types: no ∧ on the right h.s. of → (e.g., (A ∧ B) → A, not A → (B ∧ C))

no intro/elim. rules for ∧

(A ∧ B) ∧ C ∼ A ∧ (B ∧ C), A ∧ B ∼ B ∧ A (assoc. and comm.)

subtyping or permutation rules e.g.,

Γ, x : A1 ∧ A2 ∧ . . . ∧ An ⊢ t : B ρ ∈ Sn Γ, x : Aρ(1) ∧ . . . ∧ Aρ(n) ⊢ t : B perm Idempotency? A ∧ A ∼ A (Coppo-D) or not (Gardner 94-de Carvalho 07) idem: typing = qualitative info non-idem: qual. and quant. Collapsing A ∧ B ∧ C into [A, B, C] (multiset) no need for perm rules etc.

[A, B, A] = [A, B, A] = [A, B] [A, B, A] = [A, B] + [A]

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 8 /33

slide-30
SLIDE 30

System R0 (Gardner-de Carvalho)

(Strict Types) τ, σ :=

  • ∈ O | I → τ

(Intersection Types) I := [σi]i∈I Strict types syntax directed rules: x : [τ] ⊢ x : τ ax Γ; x : [σi]i∈I ⊢ t : τ Γ ⊢ λx.t : [σi]i∈I → τ abs Γ ⊢ t : [σi]i∈I → τ (Γi ⊢ u : σi)i∈I Γ +i∈I Γi ⊢ t u : τ app Remark Relevant system (no weakening) In app-rule, pointwise multiset sum e.g., (x : [σ]; y : [τ]) + (x : [σ, τ]) = x : [σ, σ, τ]; y : [τ]

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 9 /33

slide-31
SLIDE 31

Head Normalization (λ)

x head variable t1 @ tq @

λxp

Head Normal Form

r λx s @ head redex t1 @ tq @

λxp

Head Reducible Term

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 10 /33

slide-32
SLIDE 32

Head Normalization (λ)

x head variable t1 @ tq @

λxp

Head Normal Form

r λx s @ head redex t1 @ tq @

λxp

Head Reducible Term t is head normalizing (HN) if ∃ reduction path from t to a HNF.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 10 /33

slide-33
SLIDE 33

Head Normalization (λ)

x head variable t1 @ tq @

λxp

Head Normal Form

r λx s @ head redex t1 @ tq @

λxp

Head Reducible Term t is head normalizing (HN) if ∃ reduction path from t to a HNF. The head reduction strategy: reducing head redexes while it is possible.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 10 /33

slide-34
SLIDE 34

Head Normalization (λ)

t is head normalizing (HN) if ∃ reduction path from t to a HNF. The head reduction strategy: reducing head redexes while it is possible.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 10 /33

slide-35
SLIDE 35

Head Normalization (λ)

the head reduction strategy terminates on t t is HN (∃path from t to a HNF)

  • bvious

true but not obvious

t is head normalizing (HN) if ∃ reduction path from t to a HNF. The head reduction strategy: reducing head redexes while it is possible.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 10 /33

slide-36
SLIDE 36

Head Normalization (λ)

the head reduction strategy terminates on t t is HN (∃path from t to a HNF)

  • bvious

true but not obvious

The head reduction strategy: reducing head redexes while it is possible.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 10 /33

slide-37
SLIDE 37

Head Normalization (λ)

the head reduction strategy terminates on t t is HN (∃path from t to a HNF)

  • bvious

true but not obvious

Intersection types come to help!

The head reduction strategy: reducing head redexes while it is possible.

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 10 /33

slide-38
SLIDE 38

Subject Reduction and Subject Expansion

A good intersection type system should enjoy: Subject Reduction (SR): Typing is stable under reduction. Subject Expansion (SE): Typing is stable under anti- reduction.

SE is usually not verified by simple or polymorphic type systems

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 11 /33

slide-39
SLIDE 39

Subject Reduction and Subject Expansion

A good intersection type system should enjoy: Subject Reduction (SR): Typing is stable under reduction. Subject Expansion (SE): Typing is stable under anti- reduction.

SE is usually not verified by simple or polymorphic type systems

Some reduction strategy normalizes t t can reach a terminal state t is typable typing the

  • term. states + SE

SR + extra arg.

  • bvious

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 11 /33

slide-40
SLIDE 40

Properties (R0)

Weighted Subject Reduction

Reduction preserves types and environments, and. . . . . . head reduction strictly decreases the nodes of the deriv. tree (size).

Subject Expansion

Anti-reduction preserves types and environments.

Theorem (de Carvalho)

Let t be a λ-term. Then equivalence between:

1 t is typable (in R0) 2 t is HN 3 the head reduction strategy terminates on t ( certification!)

Bonus (quantitative information)

If Π types t, then size(Π) bounds the number of steps of the head red. strategy on t

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 12 /33

slide-41
SLIDE 41

Subject reduction and expansion in R0

From a typing of (λx.r)s . . . to a typing of r[s/x]

ax x:[σ1] ⊢ x:σ1 ax x:[σ2] ⊢ x:σ2 ax x:[σ1] ⊢ x:σ1 Γ; x :[σ1, σ2, σ1] ⊢ r : τ abs Γ ⊢ λx.r : [σ1, σ2, σ1] → τ app Γ + ∆a

1 + ∆b 1 + ∆2 ⊢ (λx.r)s : τ

∆a

1 ⊢s:σ1

Πa

1

∆2 ⊢s:σ2 Π2 ∆b

1 ⊢s:σ1

Πb

1

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 13 /33

slide-42
SLIDE 42

Subject reduction and expansion in R0

From a typing of (λx.r)s . . . to a typing of r[s/x]

ax x:[σ1] ⊢ x:σ1 ax x:[σ2] ⊢ x:σ2 ax x:[σ1] ⊢ x:σ1 Γ; x :[σ1, σ2, σ1] ⊢ r : τ abs Γ ⊢ λx.r : [σ1, σ2, σ1] → τ app Γ + ∆a

1 + ∆b 1 + ∆2 ⊢ (λx.r)s : τ

∆a

1 ⊢s:σ1

Πa

1

∆2 ⊢s:σ2 Π2 ∆b

1 ⊢s:σ1

Πb

1

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 13 /33

slide-43
SLIDE 43

Subject reduction and expansion in R0

From a typing of (λx.r)s . . . to a typing of r[s/x]

ax x:[σ1] ⊢ x:σ1 ax x:[σ2] ⊢ x:σ2 ax x:[σ1] ⊢ x:σ1 Γ; x :[σ1, σ2, σ1] ⊢ r : τ abs Γ ⊢ λx.r : [σ1, σ2, σ1] → τ app Γ + ∆a

1 + ∆b 1 + ∆2 ⊢ (λx.r)s : τ

∆a

1 ⊢s:σ1

Πa

1

∆2 ⊢s:σ2 Π2 ∆b

1 ⊢s:σ1

Πb

1

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 13 /33

slide-44
SLIDE 44

Subject reduction and expansion in R0

From a typing of (λx.r)s . . . to a typing of r[s/x]

ax x:[σ1] ⊢ x:σ1 ax x:[σ2] ⊢ x:σ2 ax x:[σ1] ⊢ x:σ1 Γ; x :[σ1, σ2, σ1] ⊢ r : τ abs Γ ⊢ λx.r : [σ1, σ2, σ1] → τ app Γ + ∆a

1 + ∆b 1 + ∆2 ⊢ (λx.r)s : τ

∆a

1 ⊢s:σ1

Πa

1

∆2 ⊢s:σ2 Π2 ∆b

1 ⊢s:σ1

Πb

1

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 13 /33

slide-45
SLIDE 45

Subject reduction and expansion in R0

From a typing of (λx.r)s . . . to a typing of r[s/x]

ax x:[σ1] ⊢ x:σ1 ax x:[σ2] ⊢ x:σ2 ax x:[σ1] ⊢ x:σ1 Γ; x :[σ1, σ2, σ1] ⊢ r : τ abs Γ ⊢ λx.r : [σ1, σ2, σ1] → τ app Γ + ∆a

1 + ∆b 1 + ∆2 ⊢ (λx.r)s : τ

∆a

1 ⊢s:σ1

Πa

1

∆2 ⊢s:σ2 Π2 ∆b

1 ⊢s:σ1

Πb

1

By relevance and non-idempotence !

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 13 /33

slide-46
SLIDE 46

Subject reduction and expansion in R0

From a typing of (λx.r)s . . . to a typing of r[s/x]

ax x:[σ1] ⊢ x:σ1 ax x:[σ2] ⊢ x:σ2 ax x:[σ1] ⊢ x:σ1 Γ; x :[σ1, σ2, σ1] ⊢ r : τ abs Γ ⊢ λx.r : [σ1, σ2, σ1] → τ app Γ + ∆a

1 + ∆b 1 + ∆2 ⊢ (λx.r)s : τ

∆a

1 ⊢s:σ1

Πa

1

∆2 ⊢s:σ2 Π2 ∆b

1 ⊢s:σ1

Πb

1

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 13 /33

slide-47
SLIDE 47

Subject reduction and expansion in R0

From a typing of (λx.r)s . . . to a typing of r[s/x]

ax x:[σ1] ⊢ x:σ1 ax x:[σ2] ⊢ x:σ2 ax x:[σ1] ⊢ x:σ1 Γ; x :[σ1, σ2, σ1] ⊢ r : τ abs Γ ⊢ λx.r : [σ1, σ2, σ1] → τ app Γ + ∆a

1 + ∆b 1 + ∆2 ⊢ (λx.r)s : τ

∆a

1 ⊢s:σ1

Πa

1

∆2 ⊢s:σ2 Π2 ∆b

1 ⊢s:σ1

Πb

1

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 13 /33

slide-48
SLIDE 48

Subject reduction and expansion in R0

From a typing of (λx.r)s . . . to a typing of r[s/x]

∆a

1 ⊢s:σ1

Πa

1

∆2 ⊢s:σ2 Π2 ∆b

1 ⊢s:σ1

Πb

1

Γ + ∆a

1 + ∆b 1 + ∆2 ⊢ r[s/x] : τ

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 13 /33

slide-49
SLIDE 49

Subject reduction and expansion in R0

From a typing of (λx.r)s . . . to a typing of r[s/x]

∆a

1 ⊢s:σ1

Πa

1

Non-determinism of SR ∆2 ⊢s:σ2 Π2 ∆b

1 ⊢s:σ1

Πb

1

Γ + ∆a

1 + ∆b 1 + ∆2 ⊢ r[s/x] : τ

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 13 /33

slide-50
SLIDE 50

Subject reduction and expansion in R0

From a typing of (λx.r)s . . . to a typing of r[s/x]

∆b

1 ⊢s:σ1

Πb

1

Non-determinism of SR ∆2 ⊢s:σ2 Π2 ∆a

1 ⊢s:σ1

Πa

1

Γ + ∆a

1 + ∆b 1 + ∆2 ⊢ r[s/x] : τ

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 13 /33

slide-51
SLIDE 51

Outline

Context Non-idempotent intersection types

Using type A once or twice not the same

Rigid vs. non-rigid paradigms

Proof red. deterministic vs. non-deterministic

Question 1 Rigid collapses on non-rigid

(A, A, B) and (A, B, A) collapse on [A, A, B]

Is this collapse surjective? Question 2 In rigid fw., red. paths captured by permutations

(A, B, A) → (A, A, B)

Is it possible to capture red. paths without perm. ?

All this in a coinductive fw. (no productivity)!

Non-idempotent typing

  • P. Vial

1 Non-idempotent intersection types 14 /33

slide-52
SLIDE 52

Plan

1 Non-idempotent intersection types 2 System S (Sequential Interection) 3 Encoding Reduction Paths 4 Perspectives

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 15 /33

slide-53
SLIDE 53

Motivations

Multiset intersection:

⊕ syntax-direction ⊖ non-determinism of proof red. ⊖ lack tracking: [σ, τ, σ] = [σ

?, τ] + [σ ?].

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 16 /33

slide-54
SLIDE 54

Motivations

Multiset intersection:

⊕ syntax-direction ⊖ non-determinism of proof red. ⊖ lack tracking: [σ, τ, σ] = [σ

?, τ] + [σ ?].

Klop’s Problem: can the set of ∞-WN terms be characterized by an ITS ?

Def: t is ∞-WN iff its B¨

  • hm tree does not contain ⊥

Tatsuta [07]: an inductive ITS cannot do it. Can a coinductive ITS characterize the set of ∞-WN terms?

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 16 /33

slide-55
SLIDE 55

Motivations

Multiset intersection:

⊕ syntax-direction ⊖ non-determinism of proof red. ⊖ lack tracking: [σ, τ, σ] = [σ

?, τ] + [σ ?].

Klop’s Problem: can the set of ∞-WN terms be characterized by an ITS ?

Def: t is ∞-WN iff its B¨

  • hm tree does not contain ⊥

Tatsuta [07]: an inductive ITS cannot do it. Can a coinductive ITS characterize the set of ∞-WN terms?

Answer:

Impossible without tracking (need for a validity criterion).

system R (i.e. R0 with a coinductive type grammar) does not work

YES, with inter. = sequences + validity criterion.

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 16 /33

slide-56
SLIDE 56

Sequential intersection

Strict Types: Sk, T ::= o ∈ O | (k · Sk)k∈K → T Sequence Types (k · Sk)k∈K Example: (7 · o1, 3 · o2, 2 · o1) → o

  • 1
  • 1

2

  • 2

3

  • 1

7

7, 3, 2, 1 = “tracks” Tracking: (3 · σ, 5 · τ, 9 · σ) = (3 · σ, 5 · τ) ⊎ (9 · σ)

  • vs. [σ, τ, σ] = [σ , τ] + [σ ]

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 17 /33

slide-57
SLIDE 57

Sequential intersection

Strict Types: Sk, T ::= o ∈ O | (k · Sk)k∈K → T Sequence Types (k · Sk)k∈K Example: (7 · o1, 3 · o2, 2 · o1) → o

  • 1
  • 1

2

  • 2

3

  • 1

7

7, 3, 2, 1 = “tracks” Tracking: (3 · σ, 5 · τ, 9 · σ) = (3 · σ, 5 · τ) ⊎ (9 · σ)

  • vs. [σ, τ, σ] = [σ , τ] + [σ ]

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 17 /33

slide-58
SLIDE 58

Sequential intersection

Strict Types: Sk, T ::= o ∈ O | (k · Sk)k∈K → T Sequence Types (k · Sk)k∈K Example: (7 · o1, 3 · o2, 2 · o1) → o

  • 1
  • 1

2

  • 2

3

  • 1

7

7, 3, 2, 1 = “tracks” Tracking: (3 · σ, 5 · τ, 9 · σ) = (3 · σ, 5 · τ) ⊎ (9 · σ)

  • vs. [σ, τ, σ] = [σ , τ] + [σ ]

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 17 /33

slide-59
SLIDE 59

Sequential intersection

Strict Types: Sk, T ::= o ∈ O | (k · Sk)k∈K → T Sequence Types (k · Sk)k∈K Example: (7 · o1, 3 · o2, 2 · o1) → o

  • 1
  • 1

2

  • 2

3

  • 1

7

7, 3, 2, 1 = “tracks” Tracking: (3 · σ, 5 · τ, 9 · σ) = (3 · σ, 5 · τ) ⊎ (9 · σ)

  • vs. [σ, τ, σ] = [σ , τ] + [σ ]

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 17 /33

slide-60
SLIDE 60

Sequential intersection

Strict Types: Sk, T ::= o ∈ O | (k · Sk)k∈K → T Sequence Types (k · Sk)k∈K Example: (7 · o1, 3 · o2, 2 · o1) → o

  • 1
  • 1

2

  • 2

3

  • 1

7

7, 3, 2, 1 = “tracks” Tracking: (3 · σ, 5 · τ, 9 · σ) = (3 · σ, 5 · τ) ⊎ (9 · σ)

  • vs. [σ, τ, σ] = [σ

? , τ] + [σ ? ]

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 17 /33

slide-61
SLIDE 61

Derivations of S

x : (k · T) ⊢ x : T ax C; x : (Sk)k∈K ⊢ t : T C ⊢ λx.t : (Sk)k∈K → T abs C ⊢ t : (Sk)k∈K → T (Dk ⊢ u : Sk)k∈K C ⊎ (⊎k∈KDk) ⊢ t u : T app

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 18 /33

slide-62
SLIDE 62

Derivations of S

x : (k · T) ⊢ x : T ax C; x : (Sk)k∈K ⊢ t : T C ⊢ λx.t : (Sk)k∈K → T abs C ⊢ t : (Sk)k∈K → T (Dk ⊢ u : Sk)k∈K C ⊎ (⊎k∈KDk) ⊢ t u : T app System S features pointers (called bipositions).

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 18 /33

slide-63
SLIDE 63

Derivations of S

x : (k · T) ⊢ x : T ax C; x : (Sk)k∈K ⊢ t : T C ⊢ λx.t : (Sk)k∈K → T abs C ⊢ t : (Sk)k∈K → T (Dk ⊢ u : Sk)k∈K C ⊎ (⊎k∈KDk) ⊢ t u : T app System S features pointers (called bipositions). Every S-derivation collapses on a R-derivation.

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 18 /33

slide-64
SLIDE 64

Derivations of S

x : (k · T) ⊢ x : T ax C; x : (Sk)k∈K ⊢ t : T C ⊢ λx.t : (Sk)k∈K → T abs C ⊢ t : (Sk)k∈K → T (Dk ⊢ u : Sk)k∈K C ⊎ (⊎k∈KDk) ⊢ t u : T app System S features pointers (called bipositions). Every S-derivation collapses on a R-derivation. Subject reduction is deterministic in S (= R).

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 18 /33

slide-65
SLIDE 65

Infinitary Typing

Theorem (V,LiCS17)

A ∞-term t is ∞-WN iff t is S-typable in some way. Klop’s Problem solved The hereditary head reduction strategy is complete for infinitary weak normalization.

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 19 /33

slide-66
SLIDE 66

Infinitary Typing

Theorem (V,LiCS17)

A ∞-term t is ∞-WN iff t is S-typable in some way. Klop’s Problem solved The hereditary head reduction strategy is complete for infinitary weak normalization.

Bonus (positive answer to TLCA Problem #20)

System S also provides a type-theoretic characterization of the hereditary permutations (not possible in the inductive case, Tatsuta [LiCS07]).

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 19 /33

slide-67
SLIDE 67

Infinitary Typing

Theorem (V,LiCS17)

A ∞-term t is ∞-WN iff t is S-typable in some way. Klop’s Problem solved The hereditary head reduction strategy is complete for infinitary weak normalization.

Bonus (positive answer to TLCA Problem #20)

System S also provides a type-theoretic characterization of the hereditary permutations (not possible in the inductive case, Tatsuta [LiCS07]).

Theorem (V,LiCS18)

Every term is typable in systems R and S (non-trivial). One can extract from the R-typing the order (arity) of any λ-term. In the infinitary relational model, no term has an empty denotation.

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 19 /33

slide-68
SLIDE 68

The Problem of the Collapse

Coinductive typing (without validity criterion): allow to type all normalizing terms + some unproductive terms e.g., Ω.

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 20 /33

slide-69
SLIDE 69

The Problem of the Collapse

Coinductive typing (without validity criterion): allow to type all normalizing terms + some unproductive terms e.g., Ω. Necessity to replace R (multiset inter.) with S (sequence inter)

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 20 /33

slide-70
SLIDE 70

The Problem of the Collapse

Coinductive typing (without validity criterion): allow to type all normalizing terms + some unproductive terms e.g., Ω. Necessity to replace R (multiset inter.) with S (sequence inter) But do we lose some derivations? Question: given Π a R-derivation, is there a S-deriv. P collapsing on Π?

if true, the infinitary relational model is fully described by system S

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 20 /33

slide-71
SLIDE 71

The Problem of the Collapse

Coinductive typing (without validity criterion): allow to type all normalizing terms + some unproductive terms e.g., Ω. Necessity to replace R (multiset inter.) with S (sequence inter) But do we lose some derivations? Question: given Π a R-derivation, is there a S-deriv. P collapsing on Π?

if true, the infinitary relational model is fully described by system S

Easy in the case of normal forms (i.e. when Π types a NF), not in other cases.

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 20 /33

slide-72
SLIDE 72

Difficulties

In the productive cases (HN,WN,SN,∞-WN), in i.t.s., one types the normal forms and uses subject expansion. normalizing terms ⊆ typable terms Here, no form of productivity/stabilization. We develop a corpus of methods inspired by first order model theory (last part of the talk).

x

[ ] → . . . → [ ] → o

t1 @ tq @

  • λxp

. . . → . . . → . . . → o

λx1

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 21 /33

slide-73
SLIDE 73

Outline

Context Non-idempotent intersection types

Using type A once or twice not the same

Rigid vs. non-rigid paradigms

Proof red. deterministic vs. non-deterministic

Question 1 Rigid collapses on non-rigid

(A, A, B) and (A, B, A) collapse on [A, A, B]

Is this collapse surjective? Question 2 In rigid fw., red. paths captured by permutations

(A, B, A) → (A, A, B)

Is it possible to capture red. paths without perm. ?

All this in a coinductive fw. (no productivity)!

Non-idempotent typing

  • P. Vial

2 System S (Sequential Interection) 22 /33

slide-74
SLIDE 74

Plan

1 Non-idempotent intersection types 2 System S (Sequential Interection) 3 Encoding Reduction Paths 4 Perspectives

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 23 /33

slide-75
SLIDE 75

Deterministic Subject Reduction

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr

λx @

T

P 1

s

P 2

s

reduces into. . .

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 24 /33

slide-76
SLIDE 76

Deterministic Subject Reduction

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr

λx

(2 · S, 7 · S) → T

@

T

P 1

s

P 2

s

reduces into. . .

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 24 /33

slide-77
SLIDE 77

Deterministic Subject Reduction

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr

λx

(2 · S, 7 · S) → T

@

T

P 1

s

S [2]

P 2

s

S [7] reduces into. . .

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 24 /33

slide-78
SLIDE 78

Deterministic Subject Reduction

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

λx

(2 · S, 7 · S) → T

@

T

P 1

s

S [2]

P 2

s

S [7] reduces into. . .

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 24 /33

slide-79
SLIDE 79

Deterministic Subject Reduction

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S) ax x : (2·S)

λx

(2 · S, 7 · S) → T

@

T

P 1

s

S [2]

P 2

s

S [7] reduces into. . .

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 24 /33

slide-80
SLIDE 80

Deterministic Subject Reduction

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S) ax x : (2·S)

λx

(2 · S, 7 · S) → T

@

T

P 1

s

S [2]

P 2

s

S [7] reduces into. . . Pr[s/x]

s : S P 2

s

s : S P 1

s

T

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 24 /33

slide-81
SLIDE 81

How to encode reduction paths?

System S: one red. path, poor dynamic behavior. System R: rich dynamic behavior, impossible to express red. paths (lack of tracking)

Idea 1: use iso. of types (iso of lab. trees) → 1

  • 1

4 → 1

  • 2

3

  • 1
  • 3

8

  • 2

8

T1 = (8·o2, 4·(8·o3, 3·o1) → o2) → o1

→ 1

  • 1

→ 1

  • 2

2

  • 3
  • 1

7 5 3

  • 2

T2 = (5·(7·o1, 2·o3) → o2, 3·o2) → o1

Idea 2: replace app (syntactic eq.) with apph (eq. up to iso) C ⊢ t : (Sk)k∈K → T (Dk ⊢ u : S′

k)k∈K′

(Sk)k∈K ≡ (S′

k)k∈K′

C ⊎ (⊎k∈KDk) ⊢ t u : T apph Hybrid system Sh: every R-deriv. is a Sh-collapse (easy).

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 25 /33

slide-82
SLIDE 82

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr

λx @

T

P 5

s

P 8

s

reduces into. . .

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-83
SLIDE 83

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

P 8

s

reduces into. . .

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-84
SLIDE 84

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into. . .

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-85
SLIDE 85

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into. . .

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-86
SLIDE 86

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into. . .

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-87
SLIDE 87

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into. . .

Assume S2 ≡ S7

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-88
SLIDE 88

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into. . .

Assume S2 ≡ S7

say S2 ≡ S′

8, S7 ≡ S′ 5

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-89
SLIDE 89

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into. . .

Assume S2 ≡ S7

say S2 ≡ S′

8, S7 ≡ S′ 5

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-90
SLIDE 90

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into

Pr[s/x]

s : S′

5

P 5

s

s : S′

8

P 8

s

T ′

Assume S2 ≡ S7

say S2 ≡ S′

8, S7 ≡ S′ 5

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-91
SLIDE 91

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into

Pr[s/x]

s : S′

5

P 5

s

s : S′

8

P 8

s

T ′ with T ′ ≡ T

Assume S2 ≡ S7

say S2 ≡ S′

8, S7 ≡ S′ 5

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-92
SLIDE 92

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into. . .

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-93
SLIDE 93

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into. . .

Assume S2 ≡ S7

s.t. S2 ≡ S7 ≡ S′

5 ≡ S′ 8

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-94
SLIDE 94

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into

Assume S2 ≡ S7

s.t. S2 ≡ S7 ≡ S′

5 ≡ S′ 8

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-95
SLIDE 95

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into

Pr[s/x]

s : S′

?

P ?

s

s : S′

?

P ?

s

T ′

Assume S2 ≡ S7

s.t. S2 ≡ S7 ≡ S′

5 ≡ S′ 8

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-96
SLIDE 96

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into

Pr[s/x]

s : S′

?

P ?

s

s : S′

?

P ?

s

T ′

Assume S2 ≡ S7

s.t. S2 ≡ S7 ≡ S′

5 ≡ S′ 8

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

φ interface (2·S2, 7·S7) ˜ →(5·S′

5, 8·S′ 8)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-97
SLIDE 97

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into

Pr[s/x]

s : S′

5

P 5

s

s : S′

8

P 8

s

T ′

Assume S2 ≡ S7

s.t. S2 ≡ S7 ≡ S′

5 ≡ S′ 8

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

φ interface (2·S2, 7·S7) ˜ →(5·S′

5, 8·S′ 8)

case φ : 2 → 8, 7 → 5

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-98
SLIDE 98

Pseudo-Subject Reduction in Sh

From a typing of (λx.r)s . . . to a typing of r[s/x]

Pr T

ax x : (7·S7) ax x : (2·S2)

λx

(2 · S2, 7 · S7) → T

@

T

P 5

s

S′

5 [5]

P 8

s

S′

8 [8]reduces into

Pr[s/x]

s : S′

8

P 8

s

s : S′

5

P 5

s

T ′

Assume S2 ≡ S7

s.t. S2 ≡ S7 ≡ S′

5 ≡ S′ 8

with (2·S2, 7·S7) ≡ (5·S′

5, 8·S′ 8)

φ interface (2·S2, 7·S7) ˜ →(5·S′

5, 8·S′ 8)

case φ : 2 → 5, 7 → 8

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 26 /33

slide-99
SLIDE 99

Operable Derivations

hybrid deriv. + interfaces for each apph-rule = operable derivation

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 27 /33

slide-100
SLIDE 100

Operable Derivations

hybrid deriv. + interfaces for each apph-rule = operable derivation system Sop: deterministic with hard-coded red. paths. S-derivations: identity interfaces (trivial op. deriv.)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 27 /33

slide-101
SLIDE 101

Operable Derivations

hybrid deriv. + interfaces for each apph-rule = operable derivation system Sop: deterministic with hard-coded red. paths. S-derivations: identity interfaces (trivial op. deriv.) Every R-deriv. Π with a given red. path p can be encoded with a S0-deriv. P. multiset Π → Π1 → Π2 → . . . → Πn → . . .

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 27 /33

slide-102
SLIDE 102

Operable Derivations

hybrid deriv. + interfaces for each apph-rule = operable derivation system Sop: deterministic with hard-coded red. paths. S-derivations: identity interfaces (trivial op. deriv.) Every R-deriv. Π with a given red. path p can be encoded with a S0-deriv. P.

  • perable

P → P1 → P2 → . . . → Pn → . . . ↓ ↓ ↓ ↓ multiset Π → Π1 → Π2 → . . . → Πn → . . .

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 27 /33

slide-103
SLIDE 103

Operable Derivations

hybrid deriv. + interfaces for each apph-rule = operable derivation system Sop: deterministic with hard-coded red. paths. S-derivations: identity interfaces (trivial op. deriv.) Every R-deriv. Π with a given red. path p can be encoded with a S0-deriv. P.

  • perable

P → P1 → P2 → . . . → Pn → . . . ↓ ↓ ↓ ↓ multiset Π → Π1 → Π2 → . . . → Πn → . . . Actually, main theorem: trivial P → P1 → P2 → . . . → Pn → . . . ↓ ↓ ↓ ↓ multiset Π → Π1 → Π2 → . . . → Πn → . . .

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 27 /33

slide-104
SLIDE 104

Operable Derivations

hybrid deriv. + interfaces for each apph-rule = operable derivation system Sop: deterministic with hard-coded red. paths. S-derivations: identity interfaces (trivial op. deriv.) Every R-deriv. Π with a given red. path p can be encoded with a S0-deriv. P.

  • perable

P → P1 → P2 → . . . → Pn → . . . ↓ ↓ ↓ ↓ multiset Π → Π1 → Π2 → . . . → Πn → . . . Actually, main theorem: trivial P → P1 → P2 → . . . → Pn → . . . ↓ ↓ ↓ ↓ multiset Π → Π1 → Π2 → . . . → Πn → . . . Enough to prove: Every operable derivation is isomorphic to a trivial derivation

iso of op-deriv = nested isos of types commuting with interfaces

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 27 /33

slide-105
SLIDE 105

Outline

Context Non-idempotent intersection types

Using type A once or twice not the same

Rigid vs. non-rigid paradigms

Proof red. deterministic vs. non-deterministic

Question 1 Rigid collapses on non-rigid

(A, A, B) and (A, B, A) collapse on [A, A, B]

Is this collapse surjective? Question 2 In rigid fw., red. paths captured by permutations

(A, B, A) → (A, A, B)

Is it possible to capture red. paths without perm. ?

All this in a coinductive fw. (no productivity)!

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 28 /33

slide-106
SLIDE 106

Brother threads

with e.g., φ1 : 8 → 2 9 → 7 and φε : 8 → 5 9 → 3

One thread labelled with 8, one with 9, others with 2, 7, 3 and 5. The threads θ8 and θ9 are brothers.

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 29 /33

slide-107
SLIDE 107

Brother threads

with e.g., φ1 : 8 → 2 9 → 7 and φε : 8 → 5 9 → 3

One thread labelled with 8, one with 9, others with 2, 7, 3 and 5. The threads θ8 and θ9 are brothers. Positive and negative parts in θ8 and θ9.

Positive: ascend to ax. Negative: ascend to abs.

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 29 /33

slide-108
SLIDE 108

Brother threads

with e.g., φ1 : 8 → 2 9 → 7 and φε : 8 → 5 9 → 3

One thread labelled with 8, one with 9, others with 2, 7, 3 and 5. The threads θ8 and θ9 are brothers. Positive and negative parts in θ8 and θ9.

Positive: ascend to ax. Negative: ascend to abs.

Consumption in apph-rules e.g., θ8

⊖ ˜

→θ2, θ8

⊕ ˜

→θ5

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 29 /33

slide-109
SLIDE 109

Brother threads

with e.g., φ1 : 8 → 2 9 → 7 and φε : 8 → 5 9 → 3

One thread labelled with 8, one with 9, others with 2, 7, 3 and 5. The threads θ8 and θ9 are brothers. Positive and negative parts in θ8 and θ9.

Positive: ascend to ax. Negative: ascend to abs.

Consumption in apph-rules e.g., θ8

⊖ ˜

→θ2, θ8

⊕ ˜

→θ5 To have a trivial deriv., one must choose a new value lab(θ) for each thread s.t.:

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 29 /33

slide-110
SLIDE 110

Brother threads

with e.g., φ1 : 8 → 2 9 → 7 and φε : 8 → 5 9 → 3

One thread labelled with 8, one with 9, others with 2, 7, 3 and 5. The threads θ8 and θ9 are brothers. Positive and negative parts in θ8 and θ9.

Positive: ascend to ax. Negative: ascend to abs.

Consumption in apph-rules e.g., θ8

⊖ ˜

→θ2, θ8

⊕ ˜

→θ5 To have a trivial deriv., one must choose a new value lab(θ) for each thread s.t.:

lab(θ8) = lab(θ2), lab(θ9) = lab(θ7), lab(θ8) = lab(θ5), lab(θ9) = lab(θ3)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 29 /33

slide-111
SLIDE 111

Brother threads

with e.g., φ1 : 8 → 2 9 → 7 and φε : 8 → 5 9 → 3

One thread labelled with 8, one with 9, others with 2, 7, 3 and 5. The threads θ8 and θ9 are brothers. Positive and negative parts in θ8 and θ9.

Positive: ascend to ax. Negative: ascend to abs.

Consumption in apph-rules e.g., θ8

⊖ ˜

→θ2, θ8

⊕ ˜

→θ5 To have a trivial deriv., one must choose a new value lab(θ) for each thread s.t.:

lab(θ8) = lab(θ2), lab(θ9) = lab(θ7), lab(θ8) = lab(θ5), lab(θ9) = lab(θ3) No overlap: lab(θ8) = lab(θ9), lab(θ2) = lab(θ7), lab(θ3) = lab(θ5)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 29 /33

slide-112
SLIDE 112

Milestones of the main proof

Prop: let P be an op. deriv. If the interface of P does not prove an eq. of the form lab(θbro1) = lab(θbro2), then P is isomorphic to a trivial deriv.

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 30 /33

slide-113
SLIDE 113

Milestones of the main proof

Prop: let P be an op. deriv. If the interface of P does not prove an eq. of the form lab(θbro1) = lab(θbro2), then P is isomorphic to a trivial deriv. Ad absurdum, assume that such a proof exist.

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 30 /33

slide-114
SLIDE 114

Milestones of the main proof

Prop: let P be an op. deriv. If the interface of P does not prove an eq. of the form lab(θbro1) = lab(θbro2), then P is isomorphic to a trivial deriv. Ad absurdum, assume that such a proof exist.

1

Proof of the form θbro1( ˜ ← ∪ ˜ →)θ2( ˜ ← ∪ ˜ →) . . . θn−1( ˜ ← ∪ ˜ →)θbro2

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 30 /33

slide-115
SLIDE 115

Milestones of the main proof

Prop: let P be an op. deriv. If the interface of P does not prove an eq. of the form lab(θbro1) = lab(θbro2), then P is isomorphic to a trivial deriv. Ad absurdum, assume that such a proof exist.

1

Proof of the form θbro1( ˜ ← ∪ ˜ →)θ2( ˜ ← ∪ ˜ →) . . . θn−1( ˜ ← ∪ ˜ →)θbro2

2

Up to a finite number of red. steps, then θ′

bro1 ⊕ ˜

→θ′

2 ⊕ ˜

→ . . . θ′

ℓ−1 ⊕ ˜

→θ′

bro2 with

ℓ n

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 30 /33

slide-116
SLIDE 116

Milestones of the main proof

Prop: let P be an op. deriv. If the interface of P does not prove an eq. of the form lab(θbro1) = lab(θbro2), then P is isomorphic to a trivial deriv. Ad absurdum, assume that such a proof exist.

1

Proof of the form θbro1( ˜ ← ∪ ˜ →)θ2( ˜ ← ∪ ˜ →) . . . θn−1( ˜ ← ∪ ˜ →)θbro2

2

Up to a finite number of red. steps, then θ′

bro1 ⊕ ˜

→θ′

2 ⊕ ˜

→ . . . θ′

ℓ−1 ⊕ ˜

→θ′

bro2 with

ℓ n

3

Lem: if θa⊕ ˜ →θb then ad(θa) < ad(θb) (applicative depth)

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 30 /33

slide-117
SLIDE 117

Milestones of the main proof

Prop: let P be an op. deriv. If the interface of P does not prove an eq. of the form lab(θbro1) = lab(θbro2), then P is isomorphic to a trivial deriv. Ad absurdum, assume that such a proof exist.

1

Proof of the form θbro1( ˜ ← ∪ ˜ →)θ2( ˜ ← ∪ ˜ →) . . . θn−1( ˜ ← ∪ ˜ →)θbro2

2

Up to a finite number of red. steps, then θ′

bro1 ⊕ ˜

→θ′

2 ⊕ ˜

→ . . . θ′

ℓ−1 ⊕ ˜

→θ′

bro2 with

ℓ n

3

Lem: if θa⊕ ˜ →θb then ad(θa) < ad(θb) (applicative depth)

4

Then ad(θ′

bro1) < ad(θ′ bro2).

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 30 /33

slide-118
SLIDE 118

Milestones of the main proof

Prop: let P be an op. deriv. If the interface of P does not prove an eq. of the form lab(θbro1) = lab(θbro2), then P is isomorphic to a trivial deriv. Ad absurdum, assume that such a proof exist.

1

Proof of the form θbro1( ˜ ← ∪ ˜ →)θ2( ˜ ← ∪ ˜ →) . . . θn−1( ˜ ← ∪ ˜ →)θbro2

2

Up to a finite number of red. steps, then θ′

bro1 ⊕ ˜

→θ′

2 ⊕ ˜

→ . . . θ′

ℓ−1 ⊕ ˜

→θ′

bro2 with

ℓ n

3

Lem: if θa⊕ ˜ →θb then ad(θa) < ad(θb) (applicative depth)

4

Then ad(θ′

bro1) < ad(θ′ bro2).

Absurd (for two brother threads).

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 30 /33

slide-119
SLIDE 119

Milestones of the main proof

Prop: let P be an op. deriv. If the interface of P does not prove an eq. of the form lab(θbro1) = lab(θbro2), then P is isomorphic to a trivial deriv. Ad absurdum, assume that such a proof exist.

1

Proof of the form θbro1( ˜ ← ∪ ˜ →)θ2( ˜ ← ∪ ˜ →) . . . θn−1( ˜ ← ∪ ˜ →)θbro2

2

Up to a finite number of red. steps, then θ′

bro1 ⊕ ˜

→θ′

2 ⊕ ˜

→ . . . θ′

ℓ−1 ⊕ ˜

→θ′

bro2 with

ℓ n

3

Lem: if θa⊕ ˜ →θb then ad(θa) < ad(θb) (applicative depth)

4

Then ad(θ′

bro1) < ad(θ′ bro2).

Absurd (for two brother threads). By the above prop: Every operable deriv. is isomorphic to a trivial deriv.

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 30 /33

slide-120
SLIDE 120

Milestones of the main proof

Prop: let P be an op. deriv. If the interface of P does not prove an eq. of the form lab(θbro1) = lab(θbro2), then P is isomorphic to a trivial deriv. Ad absurdum, assume that such a proof exist.

1

Proof of the form θbro1( ˜ ← ∪ ˜ →)θ2( ˜ ← ∪ ˜ →) . . . θn−1( ˜ ← ∪ ˜ →)θbro2

2

Up to a finite number of red. steps, then θ′

bro1 ⊕ ˜

→θ′

2 ⊕ ˜

→ . . . θ′

ℓ−1 ⊕ ˜

→θ′

bro2 with

ℓ n

3

Lem: if θa⊕ ˜ →θb then ad(θa) < ad(θb) (applicative depth)

4

Then ad(θ′

bro1) < ad(θ′ bro2).

Absurd (for two brother threads). By the above prop: Every operable deriv. is isomorphic to a trivial deriv. Theorem

Every R-deriv. Π is the collapse of a S-deriv. P Every red. path starting from Π can be encoded in such a P.

Non-idempotent typing

  • P. Vial

3 Encoding Reduction Paths 30 /33

slide-121
SLIDE 121

Plan

1 Non-idempotent intersection types 2 System S (Sequential Interection) 3 Encoding Reduction Paths 4 Perspectives

Non-idempotent typing

  • P. Vial

4 Perspectives 31 /33

slide-122
SLIDE 122

Summary

Any dynamic behavior in R (multiset inter.) can be individually represented in S (sequence inter.) Existence of an intermediary system Sop, close to other formalisms (Gardner, Tsukada et al.) Every point of the infinitary relational model can studied thtroug a representant in system S. Emancipation from productivity. Want the details? Phd dissertation, chapter 13

Non-idempotent typing

  • P. Vial

4 Perspectives 32 /33

slide-123
SLIDE 123

Thank you

Thank you for your attention!

Save the date(s):

Types Braga 21th june The infinitary relational model HOR (Floc) Oxford 7th july Some aspects of intersection types (invited talk) LiCS (Floc) Oxford 9th july The infinitary relational model

Non-idempotent typing

  • P. Vial

4 Perspectives 33 /33