towards a library of formalised undecidable problems in
play

Towards a library of formalised undecidable problems in Coq: The - PowerPoint PPT Presentation

Towards a library of formalised undecidable problems in Coq: The undecidability of intuitionistic linear logic Yannick Forster and Dominique Larchey-Wendling LOLA 2018 July 12 saarland university computer science Y. Forster and D.


  1. Towards a library of formalised undecidable problems in Coq: The undecidability of intuitionistic linear logic Yannick Forster and Dominique Larchey-Wendling LOLA 2018 July 12 saarland university computer science Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 1

  2. Decidability A problem P : X → P is decidable if . . . Classically Fix a model of computation M : there is a decider in M ∃ u : T . ∀ x : X . ( ux ⊲ T ∧ Px ) ∨ ( ux ⊲ F ∧ ¬ Px ) For the cbv λ -calculus Type Theory ∃ f : X → B . ∀ x : X . Px ↔ fx = true dependent version ∀ x : X . { Px } + {¬ Px } (Coq, Agda, Lean, . . . ) Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 2

  3. Undecidability A problem P : X → P is undecidable if . . . Classically If there is no decider u in M For the cbv λ -calculus ¬ ∃ u : T . ∀ x : X . ( ux ⊲ T ∧ Px ) ∨ ( ux ⊲ F ∧ ¬ Px ) ✭ ¬ ( ∀ x : X . { Px } + {¬ Px } ) ✭✭✭✭✭✭✭✭✭✭✭ ¬ ( ∀ x : X . { Px } + {¬ Px } Type Theory In reality: most proofs are by reduction Definition P undecidable := Halting problem reduces to P Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 3

  4. Reduction A problem is a type X and a unary predicate P : X → P A reduction of ( X , P ) to ( Y , Q ) is a function f : X → Y s.t. ∀ x . Px ↔ Q ( fx ) Write P � Q Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 4

  5. An undecidability proof for intuitionistic linear logic 2 SM mTM FOL BBI 1 2 3 4 cbv λ TM PCP BPCP BSM MM eILL ILL FXP FAM Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 5

  6. Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 6

  7. PCP Symbols a , b , c : N Strings x , y , z : lists of symbols C 2 xfor nf FLo d 018 inO LoC 2018 d F ord inOxf Card c : pairs of strings Stacks A : lists of cards FLo C 2 018 inO xfor d F LoC 2018 inOxf ord FLoC 2018 inOxford [] 1 := ǫ [] 2 := ǫ FLoC 2018 inOxford ( x / y :: A ) 1 := x ( A 1 ) ( x / y :: A ) 2 := y ( A 2 ) PCP ( P ) := ∃ A ⊆ P . A � = [] ∧ A 1 = A 2 Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 7

  8. PCP � BPCP Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 7

  9. generalised BPCP BPCP: generalised PCP: Symbols a , b , c : B Symbols a , b , c : X Strings x , y , z : lists of symbols Strings x , y , z : lists of symbols Card c : pairs of strings Card c : pairs of strings Stacks A , R : lists of string Stacks A , R : lists of stacks [] 1 := ǫ [] 2 := ǫ ( x / y :: A ) 1 := x ( A 1 ) ( x / y :: A ) 2 := y ( A 2 ) BPCP ( P : Stack B ) := ∃ A ⊆ P . A � = [] ∧ A 1 = A 2 PCP X ( P : Stack X ) := ∃ A ⊆ P . A � = [] ∧ A 1 = A 2 Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 8

  10. PCP � BPCP f : N ∗ → B ∗ f ( a 1 . . . a n : N ∗ ) := 1 a 1 0 . . . 1 a n 0 Lift f to cards and stack by pointwise application To prove: PCP P ↔ BPCP ( f P ) Define inverse function g , easy Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 9

  11. Contribution PCP BPCP BSM MM eILL ILL Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 8

  12. BPCP � BSM Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 8

  13. Binary stack machines n stacks of 0s and 1s ( list bool ) for a fixed n instructions (with 0 � x < n and b ∈ bool and i ∈ N ) bsm instr ::= POP x i j | PUSH x b | HALT state: ( PC ∈ N , � S ∈ ( list bool ) n ) Small step semantics ( HALT is blocking): POP x i : if x is empty, then PC ← j else pop b from stack x ; if b is 0 then PC ← i else PC ← PC + 1; push b on stack x ; PC ← PC + 1; PUSH x b : BSM program B i , j : i : bsm instr i ; i + 1 : . . . ; j : bsm instr j → ∗ ( j + 1, � BSM ( B i , j , � S ) := ∃ � S ′ . B : ( i , � S ) − S ′ ) Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 9

  14. BPCP � BSM Keep stacks for top and bottom row Hard code every card as PUSH instructions Iterate all possible stacks Check for stack equality Definition compare_stacks x y i p q := (* i *) [POP x (4+i) (7+i) ; (* 1+i *) POP y q q ; (* 2+i *) PUSH x Zero ; POP x i i ; (* 4+i *) POP y i q ; (* 5+i *) PUSH y Zero ; POP y q i ; (* 7+i *) POP y q p ; (* 8+i *) PUSH x’ Zero ; POP x’ q q ]. Lemma For all stack configurations v, → ∗ ( r , w ) compare stacks x y i p q : ( i , v ) − where r = p if the value of x is the value of y and r = q otherwise. The value of all stacks apart from x and y in w is equal to the value of all stacks in v. Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 10

  15. Contribution PCP BPCP BSM MM eILL ILL Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 9

  16. BSM � MM Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 9

  17. Minsky Machines n registers { x 1 , . . . , x n } of value in N for a fixed n instructions (with x ∈ { x 1 , . . . , x n } and i ∈ N ) mm instr ::= INC x | DEC x i v ∈ N n ) Small step semantics, state: ( PC ∈ N , � INC x : x ← x + 1; PC ← PC + 1; if x is 0 then PC ← i else x ← x − 1; PC ← PC + 1; DEC x i : MM program M i , j : i : mm instr i ; i + 1 : . . . ; j : mm instr j → ∗ ( j + 1, � MM ( M i , j , � v ) := M : ( i , � v ) − 0 ) Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 10

  18. BSM � MM Certified Compiler Stacks are registers, interpret bitstring as binary number Implement DIV2 , MOD2 , MUL2 . . . for push and pop operations Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 11

  19. Contribution PCP BPCP BSM MM eILL ILL Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 10

  20. MM � eILL Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 10

  21. Intuitionistic Linear Logic We “restrict” to the ( !, ⊸ , & ) fragment, system G-ILL Γ ⊢ A A , ∆ ⊢ B [ id ] [ cut ] A ⊢ A Γ , ∆ ⊢ B Γ , A ⊢ B Γ , ! A , ! A ⊢ B ! Γ ⊢ B Γ ⊢ B [ ! L ] [ ! R ] [ w ] [ c ] Γ , ! A ⊢ B ! Γ ⊢ ! B Γ , ! A ⊢ B Γ , ! A ⊢ B Γ , A ⊢ C Γ , B ⊢ C Γ ⊢ A Γ ⊢ B [ & 1 [ & 2 [ & R ] L ] L ] Γ , A & B ⊢ C Γ , A & B ⊢ C Γ ⊢ A & B Γ ⊢ A ∆ , B ⊢ C Γ , A ⊢ B [ ⊸ L ] [ ⊸ R ] Γ , ∆ , A ⊸ B ⊢ C Γ ⊢ A ⊸ B Full linear logic faithfully embedded into that fragment ILL ( Γ , A ) := provable ( Γ ⊢ A ) Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 11

  22. eILL Elementary sequents: ! Σ , g 1 , . . . , g k ⊢ d ( g i , a , b , c , d variables) Σ contains commands : ◮ ( a ⊸ b ) ⊸ c , correponding to INC ◮ a ⊸ ( b ⊸ c ) , correponding to DEC ◮ ( a & b ) ⊸ c , correponding to FORK goal directed rules for eILL (sound and complete w.r.t. G-ILL): TPS (even N k ) is (sound and) complete for eILL. Hence a fragment of both ILL and BBI Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 12

  23. Encoding Minsky machines in eILL Given M as a list of MM instructions ◮ for every register x i in M , two logical variables x i and x i ◮ for every position/state ( PC = i ) in M , a variable q i the state ( i , � v ) is represented by ! Σ ; ∆ � v ⊢ q i ◮ where if � v = ( p 1 , . . . , p n ) then ∆ � v = p 1 . x 1 , . . . , p n . x n ◮ Variables: { x 1 , . . . , x n } ⊎ { x 1 , . . . , x n } ⊎ { q 0 , q 1 , . . . } ◮ the commands in Σ are determined by instructions in M . . . x ← x + 1 i : INC x ∈ M ! Σ , x , ∆ ⊢ q i + 1 ( ( x ⊸ q i + 1 ) ⊸ q i ∈ Σ ) PC ← i + 1 ! Σ , ∆ ⊢ q i Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 13

  24. MM to eILL, (continued) Decrement if x = 0 then PC ← j i : DEC x j ∈ M else x ← x − 1; PC ← i + 1 corresponds to two proofs x > 0 and x = 0: . . . (Ax) ! Σ , x ⊢ x ! Σ , ∆ ⊢ q i + 1 ( x ⊸ ( q i + 1 ⊸ q i ) ∈ Σ ) ! Σ , x , ∆ ⊢ q i . . . . . . ( x �∈ ∆ ) ! Σ , ∆ ⊢ x ! Σ , ∆ ⊢ q j ( ( x & q j ) ⊸ q i ∈ Σ ) ! Σ , ∆ ⊢ q i Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 14

  25. Zero test x �∈ ∆ in eILL ! Σ ; ∆ ⊢ x provable iff x �∈ ∆ Proof for y , ∆ with y � = x : . . . (Ax) ! Σ , y ⊢ y ! Σ , ∆ ⊢ x ( y ⊸ ( x ⊸ x ) ∈ Σ ) ! Σ , y , ∆ ⊢ x Proof for empty context ∆ = ∅ : (Ax) ! Σ , x ⊢ x ( ( x ⊸ x ) ⊸ x ∈ Σ ) ! Σ , ∅ ⊢ x Y. Forster and D. Larchey-Wendling A library of undecidable problems in Coq LOLA 2018 – July 12 15

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