toward a curry howard correspondence for linear
play

Toward a Curry-Howard Correspondence for Linear, Reversible - PowerPoint PPT Presentation

Toward a Curry-Howard Correspondence for Linear, Reversible Computation Reversible Computation 2020 Kostia Chardonnet 1 , 2 Alexis Saurin 2 Benot Valiron 1 1 Universit Paris Saclay 2 Universit de Paris Classical vs Quantum Control Known :


  1. Toward a Curry-Howard Correspondence for Linear, Reversible Computation Reversible Computation 2020 Kostia Chardonnet 1 , 2 Alexis Saurin 2 Benoît Valiron 1 1 Université Paris Saclay 2 Université de Paris

  2. Classical vs Quantum Control Known : • Rich Type System • Classical Control QRAM ⟲ Computer 2 / 48

  3. Classical vs Quantum Control Elementary gates Known : • Rich Type System • Classical Control QRAM ⟳ Computer 3 / 48

  4. Classical vs Quantum Control Elementary gates Known : • Rich Type System • Classical Control QRAM Computer Outcome of measurement 4 / 48

  5. Classical vs Quantum Control Elementary gates Known : • Rich Type System • Classical Control QRAM Computer Outcome of measurement 5 / 48

  6. Classical vs Quantum Control Elementary gates Known : • Rich Type System • Classical Control QRAM Missing : • No Rich Type System • No Quantum Control Computer Outcome of measurement 6 / 48

  7. The Curry-Howard Correspondence Types • Types describe data, structure programs. • “Well-typed Programs Cannot Go Wrong” - Robin Milner 7 / 48

  8. The Curry-Howard Correspondence Types • Types describe data, structure programs. • “Well-typed Programs Cannot Go Wrong” - Robin Milner Example : toString : nat → string toString (5) = "five". 8 / 48

  9. The Curry-Howard Correspondence Types • Types describe data, structure programs. • “Well-typed Programs Cannot Go Wrong” - Robin Milner Example : toString : nat → string toString (5) = "five". toString (5) toString ( "toto" ) Well typed ! Ill typed ! 9 / 48

  10. The Curry-Howard Correspondence toString : nat → string 5 : nat toString (5) : string toString (5) toString ( "toto" ) Well typed ! Ill typed ! 10 / 48

  11. The Curry-Howard Correspondence toString : nat → string 5 : nat A → B A toString (5) : string B toString (5) toString ( "toto" ) Well typed ! Ill typed ! 11 / 48

  12. The Curry-Howard Correspondence nat → string nat A → B A string B toString (5) toString ( "toto" ) Well typed ! Ill typed ! 12 / 48

  13. The Curry-Howard Correspondence nat → string nat A → B A string B Curry-Howard Correspondence ! toString (5) toString ( "toto" ) Well typed ! Ill typed ! 13 / 48

  14. The Curry-Howard Correspondence Formal Program Verification Curry-Howard Correspondence ! λ -calculus Logic & Proofs Types Formulas Typed terms Proofs Evaluation Cut Elimination 14 / 48

  15. Our Work Based on [Sabry, Valiron, Vizzotto] and [Baelde, Doumane, Saurin] Sabry et al. Baelde et al. This Work Linear ✓ ✓ ✓ Reversible ✓ ✗ ✓ (Co)-Inductive ✗ ✓ ✓ Curry-Howard ✗ ✗ ✓ Quantum Case WIP ✓ ✗ 15 / 48

  16. let inv in let in Syntax (Base types) A , B ::= 1 | X | A ⊕ B | A ⊗ B | µ X . A | ν X . A (Isos, first-order) α ::= A ↔ B (Isos, higher-order) T ::= α 1 → · · · → α n → α 16 / 48

  17. inv let in let in Syntax (Base types) A , B ::= 1 | X | A ⊕ B | A ⊗ B | µ X . A | ν X . A (Isos, first-order) α ::= A ↔ B (Isos, higher-order) T ::= α 1 → · · · → α n → α • nat = µ X . 1 ⊕ X • lists ( A ) = [ A ] = µ X . 1 ⊕ ( A ⊗ X ) • streams ( A ) = ν X . A ⊗ X 17 / 48

  18. Syntax (Base types) A , B ::= 1 | X | A ⊕ B | A ⊗ B | µ X . A | ν X . A (Isos, first-order) α ::= A ↔ B (Isos, higher-order) T ::= α 1 → · · · → α n → α ω ::= { e 1 ↔ e ′ 1 | . . . | e n ↔ e ′ (Isos) n } | λ f .ω | µ f .ω | f | ω 1 ω 2 | inv ω   [ ] ↔ [ ]     λ g .µ f . h :: t ↔ let x = g h in : A ↔ B → [ A ] ↔ [ B ]     let y = f t in x :: y 18 / 48

  19. Syntax (Base types) A , B ::= 1 | X | A ⊕ B | A ⊗ B | µ X . A | ν X . A (Isos, first-order) α ::= A ↔ B (Isos, higher-order) T ::= α 1 → · · · → α n → α ω ::= { e 1 ↔ e ′ 1 | . . . | e n ↔ e ′ (Isos) n } | λ f .ω | µ f .ω | f | ω 1 ω 2 | inv ω   [ ] ↔ [ ]     λ g .µ f . h :: t ↔ let x = g h in : A ↔ B → [ A ] ↔ [ B ]     let y = f t in x :: y 19 / 48

  20. Syntax (Base types) A , B ::= 1 | X | A ⊕ B | A ⊗ B | µ X . A | ν X . A (Isos, first-order) α ::= A ↔ B (Isos, higher-order) T ::= α 1 → · · · → α n → α ω ::= { e 1 ↔ e ′ 1 | . . . | e n ↔ e ′ (Isos) n } | λ f .ω | µ f .ω | f | ω 1 ω 2 | inv ω   [ ] ↔ [ ]     λ g .µ f . h :: t ↔ let x = g h in : A ↔ B → [ A ] ↔ [ B ]     let y = f t in x :: y 20 / 48

  21. Properties Syntax • Language comes with a rewriting system and a type system. • Ensuring exhaustivity and non-overlapping of clauses. • Ensuring productivity. Semantic • Isos denote computations from A → B and B → A . 21 / 48

  22. A f in A B B A map g let in inv in let in A B B let let g map f Syntax - Example 2   [ ] ↔ [ ]     map = λ g .µ f . h :: t ↔ let x = g h in : A ↔ B → [ A ] ↔ [ B ]     let y = f t in x :: y

  23. A map B B A in let in inv let f g Syntax - Example 2   [ ] ↔ [ ]     map = λ g .µ f . h :: t ↔ let x = g h in : A ↔ B → [ A ] ↔ [ B ]     let y = f t in x :: y   [ ] ↔ [ ]     map ⊥ = λ g .µ f . : A ↔ B → [ B ] ↔ [ A ] let x = g h in ↔ h :: t     let y = f t in x :: y

  24. Syntax - Example 2   [ ] ↔ [ ]     map = λ g .µ f . h :: t ↔ let x = g h in : A ↔ B → [ A ] ↔ [ B ]     let y = f t in x :: y   [ ] ↔ [ ]     map ⊥ = λ g .µ f . : A ↔ B → [ B ] ↔ [ A ] let x = g h in ↔ h :: t     let y = f t in x :: y   [ ] ↔ [ ]     map ⊥ = λ g .µ f . : A ↔ B → [ B ] ↔ [ A ] x :: y ↔ let h = ( inv ( g )) x in     let t = f y in h :: t 24 / 48

  25. Results Confluence ∗ t 1 t 2 ∗ ∗ t 3 t 4 ∗ Type Preservation If ⊢ t : A and t → t ′ then ⊢ t ′ : A . Progress If ⊢ t : A either t → t ′ or t is a value. Isos For each ω we have ω ◦ ( inv ω ) = id = ( inv ω ) ◦ ω . 25 / 48

  26. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) A ⊢ B [ X ← µ X . B ] µ R A ⊢ µ X . B 26 / 48

  27. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) � 0 � = ⊢ µ X . 1 ⊕ X � �� � nat 27 / 48

  28. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) � 0 � = ⊢ 1 ⊕ µ X . 1 ⊕ X µ R ⊢ µ X . 1 ⊕ X � �� � nat 28 / 48

  29. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) ⊢ 1 ⊕ 1 ⊢ 1 ⊕ µ X . 1 ⊕ X µ R � 0 � = ⊢ µ X . 1 ⊕ X � �� � nat 29 / 48

  30. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) 1 R ⊢ 1 ⊕ 1 ⊢ 1 ⊕ µ X . 1 ⊕ X µ R � 0 � = ⊢ µ X . 1 ⊕ X � �� � nat 30 / 48

  31. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) 1 R ⊢ 1 ⊕ 1 ⊢ 1 ⊕ µ X . 1 ⊕ X µ R � 0 � = � n + 1 � = ⊢ µ X . 1 ⊕ X ⊢ nat � �� � nat 31 / 48

  32. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) 1 R ⊢ 1 ⊕ 1 ⊢ 1 ⊕ µ X . 1 ⊕ X µ R � 0 � = � n + 1 � = ⊢ 1 ⊕ nat µ R ⊢ µ X . 1 ⊕ X ⊢ nat � �� � nat 32 / 48

  33. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) 1 R ⊢ 1 ⊕ 1 ⊢ nat ⊕ 2 ⊢ 1 ⊕ µ X . 1 ⊕ X µ R � 0 � = � n + 1 � = ⊢ 1 ⊕ nat µ R ⊢ µ X . 1 ⊕ X ⊢ nat � �� � nat 33 / 48

  34. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) 1 R � n � ⊢ 1 ⊕ 1 ⊢ 1 ⊕ µ X . 1 ⊕ X µ R ⊢ nat � 0 � = � n + 1 � = ⊕ 2 ⊢ 1 ⊕ nat µ R ⊢ µ X . 1 ⊕ X � �� � ⊢ nat nat 34 / 48

  35. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) 1 R � n � ⊢ 1 ⊕ 1 ⊢ 1 ⊕ µ X . 1 ⊕ X µ R ⊢ nat � 0 � = � n + 1 � = ⊕ 2 ⊢ 1 ⊕ nat µ R ⊢ µ X . 1 ⊕ X � �� � ⊢ nat nat 1 R ⊢ 1 ⊕ 1 ⊢ 1 ⊕ nat µ R � 1 � = ⊢ nat ⊕ 2 ⊢ 1 ⊕ nat µ R ⊢ nat 35 / 48

  36. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) � 0 � ⊢ nat ⊢ ν X . nat ⊗ X ⊗ � Stream 0 � = ⊢ nat ⊗ ( ν X . nat ⊗ X ) ν R ⊢ ν X . nat ⊗ X 36 / 48

  37. Words on µ MALL Linear Logic with Induction ( µ X . A ) and Co-Induction ( ν X . A ) � 0 � ⊢ nat ⊢ ν X . nat ⊗ X ⊗ � Stream 0 � = ⊢ nat ⊗ ( ν X . nat ⊗ X ) ν R ⊢ ν X . nat ⊗ X 37 / 48

  38. Words on µ MALL Linear Logic with Induction and Co-Induction . . . ⊢ µ X . X µ R µ R ⊢ µ X . X µ R ⊢ µ X . X ⊢ µ X . X Infinite derivations represented as graphs 38 / 48

  39. Words on µ MALL A derivation is valid if in every infinite branch : • Infinity of rules µ L • Infinity of rules ν R 39 / 48

  40. From Type Derivation To Proofs Typed Terms Proofs ω : A ↔ B π : A ⊢ B ω ⊥ : B ↔ A π ⊥ : B ⊢ A 40 / 48

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend