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 : A 1 ∧ A 2 ∧ . . . ∧ A n ⊢ t : B ρ ∈ S n perm Γ , x : A ρ (1) ∧ . . . ∧ A ρ ( n ) ⊢ t : B Idempotency? A ∧ A ∼ A (Coppo-D) or not (Gardner 94-de Carvalho 07) idem: typing = qualitative info non-idem: qual. and quant. 1 Non-idempotent intersection types Non-idempotent typing P. Vial 8 /33
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 : A 1 ∧ A 2 ∧ . . . ∧ A n ⊢ t : B ρ ∈ S n perm Γ , x : A ρ (1) ∧ . . . ∧ A ρ ( n ) ⊢ t : B 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 ] 1 Non-idempotent intersection types Non-idempotent typing P. Vial 8 /33
System R 0 (Gardner-de Carvalho) (Strict Types) τ, σ := o ∈ O | I → τ (Intersection Types) I := [ σ i ] i ∈ I Strict types � syntax directed rules : Γ; x : [ σ i ] i ∈ I ⊢ t : τ x : [ τ ] ⊢ x : τ ax Γ ⊢ λx.t : [ σ i ] i ∈ I → τ abs Γ ⊢ t : [ σ i ] i ∈ I → τ (Γ i ⊢ u : σ i ) i ∈ I app Γ + i ∈ I Γ i ⊢ t u : τ Remark Relevant system (no weakening) In app -rule, pointwise multiset sum e.g. , ( x : [ σ ]; y : [ τ ]) + ( x : [ σ, τ ]) = x : [ σ, σ, τ ]; y : [ τ ] 1 Non-idempotent intersection types Non-idempotent typing P. Vial 9 /33
Head Normalization ( λ ) r s λx t 1 t 1 x @ @ @ t q t q head redex head variable @ @ λxp λxp Head Normal Form Head Reducible Term 1 Non-idempotent intersection types Non-idempotent typing P. Vial 10 /33
Head Normalization ( λ ) r s λx t 1 t 1 x @ @ @ t q t q head redex head variable @ @ λxp λxp Head Normal Form Head Reducible Term t is head normalizing (HN) if ∃ reduction path from t to a HNF. 1 Non-idempotent intersection types Non-idempotent typing P. Vial 10 /33
Head Normalization ( λ ) r s λx t 1 t 1 x @ @ @ t q t q head redex head variable @ @ λxp λxp Head Normal Form 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. 1 Non-idempotent intersection types Non-idempotent typing P. Vial 10 /33
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. 1 Non-idempotent intersection types Non-idempotent typing P. Vial 10 /33
Head Normalization ( λ ) obvious t is HN the head reduction strategy ( ∃ path from t to a HNF) terminates on t 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. 1 Non-idempotent intersection types Non-idempotent typing P. Vial 10 /33
Head Normalization ( λ ) obvious t is HN the head reduction strategy ( ∃ path from t to a HNF) terminates on t true but not obvious The head reduction strategy : reducing head redexes while it is possible. 1 Non-idempotent intersection types Non-idempotent typing P. Vial 10 /33
Head Normalization ( λ ) obvious t is HN the head reduction strategy ( ∃ path from t to a HNF) terminates on t true but not obvious Intersection types come to help! The head reduction strategy : reducing head redexes while it is possible. 1 Non-idempotent intersection types Non-idempotent typing P. Vial 10 /33
Subject Reduction and Subject Expansion A good intersection type system should enjoy: Subject Expansion (SE) : Subject Reduction (SR) : Typing is stable under anti- Typing is stable under reduction. reduction. SE is usually not verified by simple or polymorphic type systems 1 Non-idempotent intersection types Non-idempotent typing P. Vial 11 /33
Subject Reduction and Subject Expansion A good intersection type system should enjoy: Subject Expansion (SE) : Subject Reduction (SR) : Typing is stable under anti- Typing is stable under reduction. reduction. SE is usually not verified by simple or polymorphic type systems t is typable typing the term. states + SE SR + extra arg. t can reach a Some reduction strategy terminal state normalizes t obvious 1 Non-idempotent intersection types Non-idempotent typing P. Vial 11 /33
Properties ( R 0 ) 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 R 0 ) 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 1 Non-idempotent intersection types Non-idempotent typing P. Vial 12 /33
Subject reduction and expansion in R 0 From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 2 ] ⊢ x : σ 2 Π a Π b Π 2 1 1 Γ; x :[ σ 1 , σ 2 , σ 1 ] ⊢ r : τ abs ∆ a ∆ b Γ ⊢ λx.r : [ σ 1 , σ 2 , σ 1 ] → τ 1 ⊢ s : σ 1 ∆ 2 ⊢ s : σ 2 1 ⊢ s : σ 1 app Γ + ∆ a 1 + ∆ b 1 + ∆ 2 ⊢ ( λx.r ) s : τ 1 Non-idempotent intersection types Non-idempotent typing P. Vial 13 /33
Subject reduction and expansion in R 0 From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 2 ] ⊢ x : σ 2 Π a Π b Π 2 1 1 Γ; x :[ σ 1 , σ 2 , σ 1 ] ⊢ r : τ abs ∆ a ∆ b Γ ⊢ λx.r : [ σ 1 , σ 2 , σ 1 ] → τ 1 ⊢ s : σ 1 ∆ 2 ⊢ s : σ 2 1 ⊢ s : σ 1 app Γ + ∆ a 1 + ∆ b 1 + ∆ 2 ⊢ ( λx.r ) s : τ 1 Non-idempotent intersection types Non-idempotent typing P. Vial 13 /33
Subject reduction and expansion in R 0 From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 2 ] ⊢ x : σ 2 Π a Π b Π 2 1 1 Γ; x :[ σ 1 , σ 2 , σ 1 ] ⊢ r : τ abs ∆ a ∆ b Γ ⊢ λx.r : [ σ 1 , σ 2 , σ 1 ] → τ 1 ⊢ s : σ 1 ∆ 2 ⊢ s : σ 2 1 ⊢ s : σ 1 app Γ + ∆ a 1 + ∆ b 1 + ∆ 2 ⊢ ( λx.r ) s : τ 1 Non-idempotent intersection types Non-idempotent typing P. Vial 13 /33
Subject reduction and expansion in R 0 From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 2 ] ⊢ x : σ 2 Π a Π b Π 2 1 1 Γ; x :[ σ 1 , σ 2 , σ 1 ] ⊢ r : τ abs ∆ a ∆ b Γ ⊢ λx.r : [ σ 1 , σ 2 , σ 1 ] → τ 1 ⊢ s : σ 1 ∆ 2 ⊢ s : σ 2 1 ⊢ s : σ 1 app Γ + ∆ a 1 + ∆ b 1 + ∆ 2 ⊢ ( λx.r ) s : τ 1 Non-idempotent intersection types Non-idempotent typing P. Vial 13 /33
Subject reduction and expansion in R 0 From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 1 ] ⊢ x : σ 1 By relevance and non-idempotence ! ax x :[ σ 2 ] ⊢ x : σ 2 Π a Π b Π 2 1 1 Γ; x :[ σ 1 , σ 2 , σ 1 ] ⊢ r : τ abs ∆ a ∆ b Γ ⊢ λx.r : [ σ 1 , σ 2 , σ 1 ] → τ 1 ⊢ s : σ 1 ∆ 2 ⊢ s : σ 2 1 ⊢ s : σ 1 app Γ + ∆ a 1 + ∆ b 1 + ∆ 2 ⊢ ( λx.r ) s : τ 1 Non-idempotent intersection types Non-idempotent typing P. Vial 13 /33
Subject reduction and expansion in R 0 From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 2 ] ⊢ x : σ 2 Π a Π b Π 2 1 1 Γ; x :[ σ 1 , σ 2 , σ 1 ] ⊢ r : τ abs ∆ a ∆ b Γ ⊢ λx.r : [ σ 1 , σ 2 , σ 1 ] → τ 1 ⊢ s : σ 1 ∆ 2 ⊢ s : σ 2 1 ⊢ s : σ 1 app Γ + ∆ a 1 + ∆ b 1 + ∆ 2 ⊢ ( λx.r ) s : τ 1 Non-idempotent intersection types Non-idempotent typing P. Vial 13 /33
Subject reduction and expansion in R 0 From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 1 ] ⊢ x : σ 1 ax x :[ σ 2 ] ⊢ x : σ 2 Π a Π b Π 2 1 1 Γ; x :[ σ 1 , σ 2 , σ 1 ] ⊢ r : τ abs ∆ a ∆ b Γ ⊢ λx.r : [ σ 1 , σ 2 , σ 1 ] → τ 1 ⊢ s : σ 1 ∆ 2 ⊢ s : σ 2 1 ⊢ s : σ 1 app Γ + ∆ a 1 + ∆ b 1 + ∆ 2 ⊢ ( λx.r ) s : τ 1 Non-idempotent intersection types Non-idempotent typing P. Vial 13 /33
Subject reduction and expansion in R 0 From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] Π b 1 Π a 1 ∆ b 1 ⊢ s : σ 1 Π 2 ∆ a 1 ⊢ s : σ 1 ∆ 2 ⊢ s : σ 2 Γ + ∆ a 1 + ∆ b 1 + ∆ 2 ⊢ r [ s/x ] : τ 1 Non-idempotent intersection types Non-idempotent typing P. Vial 13 /33
Subject reduction and expansion in R 0 From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] Π b 1 Π a 1 ∆ b 1 ⊢ s : σ 1 Non-determinism of SR Π 2 ∆ a 1 ⊢ s : σ 1 ∆ 2 ⊢ s : σ 2 Γ + ∆ a 1 + ∆ b 1 + ∆ 2 ⊢ r [ s/x ] : τ 1 Non-idempotent intersection types Non-idempotent typing P. Vial 13 /33
Subject reduction and expansion in R 0 From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] Π a 1 Π b 1 ∆ a 1 ⊢ s : σ 1 Non-determinism of SR Π 2 ∆ b 1 ⊢ s : σ 1 ∆ 2 ⊢ s : σ 2 Γ + ∆ a 1 + ∆ b 1 + ∆ 2 ⊢ r [ s/x ] : τ 1 Non-idempotent intersection types Non-idempotent typing P. Vial 13 /33
Outline Non-idempotent Rigid vs. non-rigid Context intersection types paradigms Using type A once or twice Proof red. not the same deterministic vs. non-deterministic Question 1 Rigid collapses on non-rigid Is this collapse surjective? ( A, A, B ) and ( A, B, A ) collapse on [ A, A, B ] In rigid fw., red. paths Is it possible to capture red. Question 2 captured by permutations paths without perm. ? ( A, B, A ) �→ ( A, A, B ) All this in a coinductive fw. (no productivity)! 1 Non-idempotent intersection types Non-idempotent typing P. Vial 14 /33
Plan 1 Non-idempotent intersection types 2 System S (Sequential Interection) 3 Encoding Reduction Paths 4 Perspectives 2 System S (Sequential Interection) Non-idempotent typing P. Vial 15 /33
Motivations Multiset intersection: ⊕ syntax-direction ⊖ non-determinism of proof red. ⊖ lack tracking: [ σ, τ, σ ] = [ σ ? , τ ] + [ σ ? ]. 2 System S (Sequential Interection) Non-idempotent typing P. Vial 16 /33
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¨ ohm tree does not contain ⊥ Tatsuta [07]: an inductive ITS cannot do it. Can a coinductive ITS characterize the set of ∞ -WN terms? 2 System S (Sequential Interection) Non-idempotent typing P. Vial 16 /33
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¨ ohm 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. R 0 with a coinductive type grammar) does not work YES , with inter. = sequences + validity criterion . 2 System S (Sequential Interection) Non-idempotent typing P. Vial 16 /33
Sequential intersection Strict Types: S k , T ::= o ∈ O | ( k · S k ) k ∈ K → T Sequence Types ( k · S k ) k ∈ K Example: (7 · o 1 , 3 · o 2 , 2 · o 1 ) → o o 1 o 2 o 1 o 7 3 2 1 7, 3, 2, 1 = “tracks” → Tracking: (3 · σ, 5 · τ, 9 · σ ) = (3 · σ, 5 · τ ) ⊎ (9 · σ ) vs. [ σ, τ, σ ] = [ σ , τ ] + [ σ ] 2 System S (Sequential Interection) Non-idempotent typing P. Vial 17 /33
Sequential intersection Strict Types: S k , T ::= o ∈ O | ( k · S k ) k ∈ K → T Sequence Types ( k · S k ) k ∈ K Example: (7 · o 1 , 3 · o 2 , 2 · o 1 ) → o o 1 o 2 o 1 o 7 3 2 1 7, 3, 2, 1 = “tracks” → Tracking: (3 · σ, 5 · τ, 9 · σ ) = (3 · σ, 5 · τ ) ⊎ (9 · σ ) vs. [ σ, τ, σ ] = [ σ , τ ] + [ σ ] 2 System S (Sequential Interection) Non-idempotent typing P. Vial 17 /33
Sequential intersection Strict Types: S k , T ::= o ∈ O | ( k · S k ) k ∈ K → T Sequence Types ( k · S k ) k ∈ K Example: (7 · o 1 , 3 · o 2 , 2 · o 1 ) → o o 1 o 2 o 1 o 7 3 2 1 7, 3, 2, 1 = “tracks” → Tracking: (3 · σ, 5 · τ, 9 · σ ) = (3 · σ, 5 · τ ) ⊎ (9 · σ ) vs. [ σ, τ, σ ] = [ σ , τ ] + [ σ ] 2 System S (Sequential Interection) Non-idempotent typing P. Vial 17 /33
Sequential intersection Strict Types: S k , T ::= o ∈ O | ( k · S k ) k ∈ K → T Sequence Types ( k · S k ) k ∈ K Example: (7 · o 1 , 3 · o 2 , 2 · o 1 ) → o o 1 o 2 o 1 o 7 3 2 1 7, 3, 2, 1 = “tracks” → Tracking: (3 · σ, 5 · τ, 9 · σ ) = (3 · σ, 5 · τ ) ⊎ (9 · σ ) vs. [ σ, τ, σ ] = [ σ , τ ] + [ σ ] 2 System S (Sequential Interection) Non-idempotent typing P. Vial 17 /33
Sequential intersection Strict Types: S k , T ::= o ∈ O | ( k · S k ) k ∈ K → T Sequence Types ( k · S k ) k ∈ K Example: (7 · o 1 , 3 · o 2 , 2 · o 1 ) → o o 1 o 2 o 1 o 7 3 2 1 7, 3, 2, 1 = “tracks” → Tracking: (3 · σ, 5 · τ, 9 · σ ) = (3 · σ, 5 · τ ) ⊎ (9 · σ ) vs. [ σ, τ, σ ] = [ σ ? , τ ] + [ σ ? ] 2 System S (Sequential Interection) Non-idempotent typing P. Vial 17 /33
Derivations of S C ; x : ( S k ) k ∈ K ⊢ t : T x : ( k · T ) ⊢ x : T ax C ⊢ λx.t : ( S k ) k ∈ K → T abs C ⊢ t : ( S k ) k ∈ K → T ( D k ⊢ u : S k ) k ∈ K app C ⊎ ( ⊎ k ∈ K D k ) ⊢ t u : T 2 System S (Sequential Interection) Non-idempotent typing P. Vial 18 /33
Derivations of S C ; x : ( S k ) k ∈ K ⊢ t : T x : ( k · T ) ⊢ x : T ax C ⊢ λx.t : ( S k ) k ∈ K → T abs C ⊢ t : ( S k ) k ∈ K → T ( D k ⊢ u : S k ) k ∈ K app C ⊎ ( ⊎ k ∈ K D k ) ⊢ t u : T System S features pointers (called bipositions ). 2 System S (Sequential Interection) Non-idempotent typing P. Vial 18 /33
Derivations of S C ; x : ( S k ) k ∈ K ⊢ t : T x : ( k · T ) ⊢ x : T ax C ⊢ λx.t : ( S k ) k ∈ K → T abs C ⊢ t : ( S k ) k ∈ K → T ( D k ⊢ u : S k ) k ∈ K app C ⊎ ( ⊎ k ∈ K D k ) ⊢ t u : T System S features pointers (called bipositions ). Every S -derivation collapses on a R -derivation. 2 System S (Sequential Interection) Non-idempotent typing P. Vial 18 /33
Derivations of S C ; x : ( S k ) k ∈ K ⊢ t : T x : ( k · T ) ⊢ x : T ax C ⊢ λx.t : ( S k ) k ∈ K → T abs C ⊢ t : ( S k ) k ∈ K → T ( D k ⊢ u : S k ) k ∈ K app C ⊎ ( ⊎ k ∈ K D k ) ⊢ t u : T System S features pointers (called bipositions ). Every S -derivation collapses on a R -derivation. Subject reduction is deterministic in S ( � = R ). 2 System S (Sequential Interection) Non-idempotent typing P. Vial 18 /33
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. 2 System S (Sequential Interection) Non-idempotent typing P. Vial 19 /33
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]). 2 System S (Sequential Interection) Non-idempotent typing P. Vial 19 /33
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. 2 System S (Sequential Interection) Non-idempotent typing P. Vial 19 /33
The Problem of the Collapse Coinductive typing (without validity criterion): allow to type all normalizing terms + some unproductive terms e.g. , Ω. 2 System S (Sequential Interection) Non-idempotent typing P. Vial 20 /33
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) 2 System S (Sequential Interection) Non-idempotent typing P. Vial 20 /33
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 2 System S (Sequential Interection) Non-idempotent typing P. Vial 20 /33
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. 2 System S (Sequential Interection) Non-idempotent typing P. Vial 20 /33
Difficulties [ ] → . . . → [ ] → o In the productive cases (HN,WN,SN, ∞ -WN), in i.t.s., one t 1 types the normal forms and uses x subject expansion. @ t q normalizing terms ⊆ typable terms @ Here, no form of productivity/stabilization. o λx p We develop a corpus of methods inspired by first order model λx 1 theory (last part of the talk). . . . → . . . → . . . → o 2 System S (Sequential Interection) Non-idempotent typing P. Vial 21 /33
Outline Non-idempotent Rigid vs. non-rigid Context intersection types paradigms Using type A once or twice Proof red. not the same deterministic vs. non-deterministic Question 1 Rigid collapses on non-rigid Is this collapse surjective? ( A, A, B ) and ( A, B, A ) collapse on [ A, A, B ] In rigid fw., red. paths Is it possible to capture red. Question 2 captured by permutations paths without perm. ? ( A, B, A ) �→ ( A, A, B ) All this in a coinductive fw. (no productivity)! 2 System S (Sequential Interection) Non-idempotent typing P. Vial 22 /33
Plan 1 Non-idempotent intersection types 2 System S (Sequential Interection) 3 Encoding Reduction Paths 4 Perspectives 3 Encoding Reduction Paths Non-idempotent typing P. Vial 23 /33
Deterministic Subject Reduction From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r P 1 P 2 s s reduces into. . . λx @ T 3 Encoding Reduction Paths Non-idempotent typing P. Vial 24 /33
Deterministic Subject Reduction From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r P 1 P 2 s s reduces into. . . λx (2 · S, 7 · S ) → T @ T 3 Encoding Reduction Paths Non-idempotent typing P. Vial 24 /33
Deterministic Subject Reduction From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r P 1 P 2 s s S [7] reduces into. . . λx S [2] (2 · S, 7 · S ) → T @ T 3 Encoding Reduction Paths Non-idempotent typing P. Vial 24 /33
Deterministic Subject Reduction From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r T P 1 P 2 s s S [7] reduces into. . . λx S [2] (2 · S, 7 · S ) → T @ T 3 Encoding Reduction Paths Non-idempotent typing P. Vial 24 /33
Deterministic Subject Reduction From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r ax x : (2 · S ) ax x : (7 · S ) T P 1 P 2 s s S [7] reduces into. . . λx S [2] (2 · S, 7 · S ) → T @ T 3 Encoding Reduction Paths Non-idempotent typing P. Vial 24 /33
Deterministic Subject Reduction From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r [ s/x ] P r P 1 s ax x : (2 · S ) s : S P 2 s ax x : (7 · S ) s : S T T P 1 P 2 s s S [7] reduces into. . . λx S [2] (2 · S, 7 · S ) → T @ T 3 Encoding Reduction Paths Non-idempotent typing P. Vial 24 /33
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) o 3 o 1 o 2 o 1 o 3 o 2 8 3 → 1 7 2 → 1 o 2 o 1 o 2 o 1 8 4 → 1 5 3 → 1 T 1 = (8 · o 2 , 4 · (8 · o 3 , 3 · o 1 ) → o 2 ) → o 1 T 2 = (5 · (7 · o 1 , 2 · o 3 ) → o 2 , 3 · o 2 ) → o 1 Idea 2: replace app (syntactic eq.) with app h (eq. up to iso) ( D k ⊢ u : S ′ ( S k ) k ∈ K ≡ ( S ′ C ⊢ t : ( S k ) k ∈ K → T k ) k ∈ K ′ k ) k ∈ K ′ app h C ⊎ ( ⊎ k ∈ K D k ) ⊢ t u : T Hybrid system S h : every R -deriv. is a S h -collapse (easy). 3 Encoding Reduction Paths Non-idempotent typing P. Vial 25 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r P 5 P 8 s s reduces into. . . λx @ T 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r P 5 P 8 s s reduces into. . . λx (2 · S 2 , 7 · S 7 ) → T @ T 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r P 5 P 8 s s 8 [8] reduces into. . . λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r T P 5 P 8 s s 8 [8] reduces into. . . λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r ax x : (2 · S 2 ) ax x : (7 · S 7 ) T P 5 P 8 s s 8 [8] reduces into. . . λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r ax x : (2 · S 2 ) ax x : (7 · S 7 ) T P 5 P 8 s s 8 [8] reduces into. . . λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) Assume S 2 �≡ S 7 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r ax x : (2 · S 2 ) ax x : (7 · S 7 ) T P 5 P 8 s s 8 [8] reduces into. . . λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) Assume S 2 �≡ S 7 say S 2 ≡ S ′ 8 , S 7 ≡ S ′ 5 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r ax x : (2 · S 2 ) ax x : (7 · S 7 ) T P 5 P 8 s s 8 [8] reduces into. . . λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) Assume S 2 �≡ S 7 say S 2 ≡ S ′ 8 , S 7 ≡ S ′ 5 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r [ s/x ] P r P 8 s ax x : (2 · S 2 ) s : S ′ P 5 8 s ax x : (7 · S 7 ) s : S ′ 5 T T ′ P 5 P 8 s s 8 [8] reduces into λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) Assume S 2 �≡ S 7 say S 2 ≡ S ′ 8 , S 7 ≡ S ′ 5 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r [ s/x ] P r P 8 s ax x : (2 · S 2 ) s : S ′ P 5 8 s ax x : (7 · S 7 ) s : S ′ 5 T T ′ P 5 P 8 s s 8 [8] reduces into λx S ′ S ′ 5 [5] with T ′ ≡ T (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) Assume S 2 �≡ S 7 say S 2 ≡ S ′ 8 , S 7 ≡ S ′ 5 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r ax x : (2 · S 2 ) ax x : (7 · S 7 ) T P 5 P 8 s s 8 [8] reduces into. . . λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r ax x : (2 · S 2 ) ax x : (7 · S 7 ) T P 5 P 8 s s 8 [8] reduces into. . . λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) Assume S 2 ≡ S 7 s.t. S 2 ≡ S 7 ≡ S ′ 5 ≡ S ′ 8 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r ax x : (2 · S 2 ) ax x : (7 · S 7 ) T P 5 P 8 s s 8 [8] reduces into λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) Assume S 2 ≡ S 7 s.t. S 2 ≡ S 7 ≡ S ′ 5 ≡ S ′ 8 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r [ s/x ] P r P ? s ax x : (2 · S 2 ) s : S ′ P ? ? s ax x : (7 · S 7 ) s : S ′ ? T T ′ P 5 P 8 s s 8 [8] reduces into λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T @ T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) Assume S 2 ≡ S 7 s.t. S 2 ≡ S 7 ≡ S ′ 5 ≡ S ′ 8 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r [ s/x ] P r P ? s ax x : (2 · S 2 ) s : S ′ P ? ? s ax x : (7 · S 7 ) s : S ′ ? T T ′ P 5 P 8 s s 8 [8] reduces into λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T φ interface @ (2 · S 2 , 7 · S 7 ) ˜ → (5 · S ′ 5 , 8 · S ′ 8 ) T with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) Assume S 2 ≡ S 7 s.t. S 2 ≡ S 7 ≡ S ′ 5 ≡ S ′ 8 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r [ s/x ] P r P 8 s ax x : (2 · S 2 ) s : S ′ P 5 8 s ax x : (7 · S 7 ) s : S ′ 5 T T ′ P 5 P 8 s s 8 [8] reduces into λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T φ interface @ (2 · S 2 , 7 · S 7 ) ˜ → (5 · S ′ 5 , 8 · S ′ 8 ) T case φ : 2 �→ 8 , 7 �→ 5 with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) Assume S 2 ≡ S 7 s.t. S 2 ≡ S 7 ≡ S ′ 5 ≡ S ′ 8 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Pseudo-Subject Reduction in S h From a typing of ( λx.r ) s . . . to a typing of r [ s/x ] P r [ s/x ] P r P 5 s ax x : (2 · S 2 ) s : S ′ P 8 5 s ax x : (7 · S 7 ) s : S ′ 8 T T ′ P 5 P 8 s s 8 [8] reduces into λx S ′ S ′ 5 [5] (2 · S 2 , 7 · S 7 ) → T φ interface @ (2 · S 2 , 7 · S 7 ) ˜ → (5 · S ′ 5 , 8 · S ′ 8 ) T case φ : 2 �→ 5 , 7 �→ 8 with (2 · S 2 , 7 · S 7 ) ≡ (5 · S ′ 5 , 8 · S ′ 8 ) Assume S 2 ≡ S 7 s.t. S 2 ≡ S 7 ≡ S ′ 5 ≡ S ′ 8 3 Encoding Reduction Paths Non-idempotent typing P. Vial 26 /33
Operable Derivations hybrid deriv. + interfaces for each app h -rule = operable derivation 3 Encoding Reduction Paths Non-idempotent typing P. Vial 27 /33
Operable Derivations hybrid deriv. + interfaces for each app h -rule = operable derivation system S op : deterministic with hard-coded red. paths. S -derivations: identity interfaces ( trivial op. deriv.) 3 Encoding Reduction Paths Non-idempotent typing P. Vial 27 /33
Recommend
More recommend