learning assisted reasoning within interactive theorem
play

Learning-Assisted Reasoning within Interactive Theorem Provers - PowerPoint PPT Presentation

Learning-Assisted Reasoning within Interactive Theorem Provers Thibault Gauthier May 17, 2019 1 / 44 conjecture black box proof 2 / 44 library conjecture black box proof 2 / 44 white, spherical, many petals red, star-shaped, five


  1. Learning-Assisted Reasoning within Interactive Theorem Provers Thibault Gauthier May 17, 2019 1 / 44

  2. conjecture black box proof 2 / 44

  3. library conjecture black box proof 2 / 44

  4. white, spherical, many petals red, star-shaped, five petals Object Properties 3 / 44

  5. Proof Assistant Theorems Constants Mizar 51086 9172 Coq 23320 4841 HOL4 16476 2247 HOL Light 16191 820 Isabelle/HOL 14814 1076 Matita 1712 629 4 / 44

  6. = + x x 0 x ∀ . logical operators constants variables 5 / 44

  7. library conjecture proof 6 / 44

  8. Demo 7 / 44

  9. library conjecture provers proof 8 / 44

  10. library conjecture translation provers proof 8 / 44

  11. library conjecture theorem prediction translation provers proof 8 / 44

  12. Formula Syntactic features ∀ x , y . ( x + y ) × ( x − y ) = x 2 − y 2 Conjecture ∀ x , y , z . x × ( y + z ) = x × y + x × z ∀ x , y . x + y = y + x Library ∀ x , y . x × y = y × x e i π +1 = 0 ( x 2 ) ′ = 2 × x 9 / 44

  13. Formula Syntactic features ∀ x , y . ( x + y ) × ( x − y ) = x 2 − y 2 2 Conjecture + , × , ∀ x , y , z . x × ( y + z ) = x × y + x × z × , + ∀ x , y . x + y = y + x + Library ∀ x , y . x × y = y × x × e i π +1 = 0 e , i , × , π , + , 1 , 0 ( x 2 ) ′ = 2 × x 2 ′ , 2 , × , 9 / 44

  14. 49 12 71 85 conjecture theorem → rule lemma 10 / 44

  15. 49 12 71 72 12 71 85 conjecture theorem → rule lemma 10 / 44

  16. 49 12 71 72 12 71 85 49 12 71 conjecture theorem → rule lemma 10 / 44

  17. 49 12 71 72 12 71 85 49 12 71 Theorem Dependencies conjecture theorem 85 49 12 71 → rule 102 51 45 86 12 lemma . . . . . . 10 / 44

  18. Re-proving Tested library Benchmark Success standard library 40% judgement day 77% flyspeck 39% standard library 50% standard library 41% 11 / 44

  19. Demo 12 / 44

  20. library conjecture proof 13 / 44

  21. library conjecture tactic prediction proof search proof 14 / 44

  22. Tactics Useful for Solvers linear system, differential equations Simplifiers irreducible fraction, differentiation Induction natural numbers, lists, trees 15 / 44

  23. Tactic Prediction Proof search Formal library Conjecture Search tree Proof recording Tactic policy Knowledge base Tactic value Training Proof minimization Predictors Proof 16 / 44

  24. Tactic Prediction Proof search Formal library Conjecture Search tree Proof recording Tactic policy Knowledge base Tactic value Training Proof minimization Predictors Proof 16 / 44

  25. axiom conjecture → rule lemma 17 / 44

  26. axiom conjecture → rule lemma 17 / 44

  27. axiom conjecture → rule lemma 17 / 44

  28. axiom conjecture → tactic goal 18 / 44

  29. axiom conjecture → tactic goal 18 / 44

  30. axiom conjecture → tactic goal 18 / 44

  31. REWRITE TAC INDUCT TAC METIS TAC 19 / 44

  32. THENL tactical composes the effect of tactics. 20 / 44

  33. THENL tactical composes the effect of tactics. INDUCT TAC 20 / 44

  34. THENL tactical composes the effect of tactics. METIS TAC REWRITE TAC INDUCT TAC 20 / 44

  35. THENL tactical composes the effect of tactics. METIS TAC REWRITE TAC INDUCT TAC 20 / 44

  36. THENL tactical composes the effect of tactics. METIS TAC REWRITE TAC INDUCT TAC THENL [REWRITE TAC,METIS TAC] INDUCT TAC 20 / 44

  37. Demo 21 / 44

  38. Tactic Prediction Proof search Formal library Conjecture Search tree Proof recording Tactic policy Knowledge base Tactic value Training Proof minimization Predictors Proof 22 / 44

  39. Proof recording Original proof: THENL [ REWRITE TAC, METIS TAC ] INDUCT TAC Modified proof: (R numLib.INDUCT TAC) THENL [ R boolLib.REWRITE TAC, R metisLib.METIS TAC ] Database of tactics: R (f n) (f (SUC n)) ⇒ transitive R: INDUCT TAC n ∗ m ≤ n ∗ p ⇒ (n = 0) ∨ m ≤ p : REWRITE TAC INJ f U(:num) s ⇒ INFINITE s : METIS TAC ... 23 / 44

  40. Tactic Prediction Proof search Formal library Conjecture Search tree Proof recording Tactic policy Knowledge base Tactic evaluation Training Proof minimization Predictors Proof 24 / 44

  41. Prediction algorithm Algorithm: Nearest neighbor weighted by TF-IDF heuristics Effect: Order goals from the database according to their distance to a target goal. Remark: This is algorithm performs premise selection. How do we adapt it to predict tactics? 25 / 44

  42. Policy Database of tactics is a map from goals to tactics. R (f n) (f (SUC n)) ⇒ transitive R: INDUCT TAC n ∗ m ≤ n ∗ p ⇒ (n = 0) ∨ m ≤ p : REWRITE TAC INJ f U(:num) s ⇒ INFINITE s : METIS TAC ... An order on goals induces an order on tactics. New goal appearing during proof search: LENGTH (MAP f l) = LENGTH l Policy for the new goal: Rank Tactic Policy 1 REWRITE TAC 0.5 2 METIS TAC 0.25 ... 4 INDUCT TAC 0.0625 ... 26 / 44

  43. Value Database of lists of goals: ◮ Positive examples: appears in human proofs. ◮ Negative examples: produced during TacticToe search but do not appear in the final proof. 27 / 44

  44. Plan Tactic Prediction Proof search Formal library Conjecture Search tree Proof recording Tactic policy Knowledge base Tactic value Training Proof minimization Predictors Proof 28 / 44

  45. Training Improve recorded data to create better predictions during search. 29 / 44

  46. Training: orthogonalization Issue: Many tactics are doing the same job on a goal g . Solution: Competition for g where the most popular tactic wins. 30 / 44

  47. Training: orthogonalization Recorded goal-tactic pair: LENGTH (MAP f l) = LENGTH l: INDUCT TAC Competition: Progress Coverage INDUCT TAC Yes 136 REWRITE TAC No 2567 METIS TAC Yes 694 Added to the database: LENGTH (MAP f l) = LENGTH l: METIS TAC Result: 6 % improvement. 31 / 44

  48. Training: abstraction Issue: Some theorems are never used inside tactics. Solution: Abstract all lists of theorems in a tactic and instantiate them depending on the target goal. 32 / 44

  49. Training: abstraction Abstraction algorithm: : REWRITE TAC [ T1,T2 ] Original Abstraction : REWRITE TAC X Instantiation: REWRITE TAC [ T67, T1, T43, ... ] Question: Dow we keep the original or the abstraction ? Answer: Let them compete during orthogonalization. Result: 15% improvement 33 / 44

  50. Training: preselection Issue: Predictions are too slow during proof search. Solution: Preselect 1000 suitable tactics by importing proofs (many tactics) from related goals. 34 / 44

  51. Tactic Prediction Proof search Formal library Conjecture Search tree Proof recording Tactic policy Knowledge base Tactic evaluation Training Proof minimization Predictors Proof 35 / 44

  52. Proof search: search tree ... ... a j a 1 t j t m t 1 ... ... a 0 g 0 g i g n 36 / 44

  53. Proof search: advanced tree search 0.5 0.25 0.125 37 / 44

  54. Proof search: advanced tree search 0.25 0.5 0.125 0.7 0.25 0.125 0.5 0.7 37 / 44

  55. Proof search: advanced tree search 0.3 0.25 0.125 0.5 0.7,0.3 0.25 0.125 0.5 0.7,0.3 37 / 44

  56. Proof search: advanced tree search 0.3 0.25 0.125 0.5 0.7,0.3 0.8 0.25 0.125 0.5 0.7,0.3,0.8 37 / 44

  57. Re-proving Tested library Proof automation Success 50% 66% 38 / 44

  58. Re-proving: HOL4 proofs found in less than x seconds 4 , 000 3 , 000 2 , 000 TacticToe 1 , 000 E prover 0 0 10 20 30 40 50 60 39 / 44

  59. Re-proving: percentage of solved HOL4 proof of size x 100 TacticToe 80 E prover 60 40 20 0 0 2 4 6 8 10 12 14 16 18 20 40 / 44

  60. Tactic Prediction Proof search Formal library Conjecture Search tree Proof recording Tactic policy Knowledge base Tactic value Training Proof minimization Predictors Proof 41 / 44

  61. Before: boolLib.REWRITE TAC [ DB.fetch "list" "EVERY_CONJ" ,... ] THEN BasicProvers.Induct on [ HolKernel.QUOTE "l"] THENL [ BasicProvers.SRW TAC [] [] , simpLib.ASM SIMP TAC (BasicProvers.srw ss ()) [ boolLib.DISJ IMP THM, DB.fetch "list" "MAP" , DB.fetch "list" "CONS_11" , boolLib.FORALL AND THM ]] After: Induct on ‘l‘ THENL [ SRW TAC [] [] , ASM SIMP TAC (srw ss ()) [ DISJ IMP THM, FORALL AND THM ]] 42 / 44

  62. Summary: TacticToe learns from human proofs to solve new goals. Advantages over ATPs (E prover) for ITP (HOL4) users: ◮ Includes domain specific automation found in the ITP. ◮ Generated proofs are human-level proofs. ◮ No translation or reconstruction needed. 43 / 44

  63. Demo 44 / 44

Recommend


More recommend