clause features for theorem prover guidance
play

Clause Features for Theorem Prover Guidance uv 1 Josef Urban 1 Jan - PowerPoint PPT Presentation

Clause Features for Theorem Prover Guidance uv 1 Josef Urban 1 Jan Jakub AITP19, Obergurgl, Austria, April 2019 1 Czech Technical University in Prague, Czech Republic Jan Jakub uv, Josef Urban Clause Features for Theorem Prover Guidance


  1. Clause Features for Theorem Prover Guidance uv 1 Josef Urban 1 Jan Jakub˚ AITP’19, Obergurgl, Austria, April 2019 1 Czech Technical University in Prague, Czech Republic Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 1 / 31

  2. Outline Introduction: ATPs & Given Clauses Enigma: The story so far. . . Enigma: What’s new? Experiments: Hammering Mizar Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 2 / 31

  3. Outline Introduction: ATPs & Given Clauses Enigma: The story so far. . . Enigma: What’s new? Experiments: Hammering Mizar Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 3 / 31

  4. Saturation-style ATPs • Represent axioms and conjecture in First-Order Logic (FOL). • T $ C iff T Y t� C u is unsatisfiable. • Translate T Y t� C u to clauses (ex. “ x “ 0 _ � P p f p x , x qq ”). • Try to derive a contradiction. Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 4 / 31

  5. Basic Loop Proc = {} Unproc = all available clauses while (no proof found) { select a given clause C from Unproc move C from Unproc to Proc apply inference rules to C and Proc put inferred clauses to Unproc } Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 5 / 31

  6. Clause Selection Heuristics in E Prover • E Prover has several pre-defined clause weight functions. (and others can be easily implemented) • Each weight function assigns a real number to a clause. • Clause with the smallest weight is selected. Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 6 / 31

  7. E Prover Strategy • E strategy = E parameters influencing proof search (term ordering, literal selection, clause splitting, . . . ) • Weight function gives the priority to a clause. • Selection by several priority queues in a round-robin way (10 * ClauseWeight1(10,0.1,...) , 1 * ClauseWeight2(...) , 20 * ClauseWeight3(...) ) Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 7 / 31

  8. Outline Introduction: ATPs & Given Clauses Enigma: The story so far. . . Enigma: What’s new? Experiments: Hammering Mizar Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 8 / 31

  9. Machine Learning of Given Clause • Idea: Use machine learning methods to guide E prover. • Analyze successful proof search to obtain training samples. • positives: processed clauses used in the proof • negatives: other processed clauses Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 9 / 31

  10. Enigma Basics • Idea: Use fast linear classifier to guide given clause selection! • ENIGMA stands for. . . Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 10 / 31

  11. Enigma Basics • Idea: Use fast linear classifier to guide given clause selection! • ENIGMA stands for. . . Efficient learNing-based Inference Guiding MAchine Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 10 / 31

  12. LIBLINEAR: Linear Classifier • LIBLINEAR: open source library 1 • input: positive and negative examples (float vectors) • output: model ( „ a vector of weights) • evaluation of a generic vector: dot product with the model 1 http://www.csie.ntu.edu.tw/~cjlin/liblinear/ Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 11 / 31

  13. Clauses as Feature Vectors Consider the literal as a tree and simplify (sign, vars, skolems). ‘ “ “ f g Ñ f g x y sko 1 sko 2 f f d d x f Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 12 / 31

  14. Clauses as Feature Vectors Features are descending paths of length 3 (triples of symbols). ‘ “ “ f g Ñ f g x y sko 1 sko 2 f f d d x f Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 12 / 31

  15. Clauses as Feature Vectors Collect and enumerate all the features. Count the clause features. # feature count ‘ 1 ( ‘ ,=,a) 0 . . . . . . . . . “ ( ‘ ,=,f) 11 1 f g 12 ( ‘ ,=,g) 1 13 (=,f, f ) 2 f f d d 14 (=,g, d ) 2 15 (g, d , f ) 1 f . . . . . . . . . Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 13 / 31

  16. Clauses as Feature Vectors Take the counts as a feature vector. # feature count ‘ 1 ( ‘ ,=,a) 0 . . . . . . . . . “ ( ‘ ,=,f) 11 1 f g 12 ( ‘ ,=,g) 1 13 (=,f, f ) 2 f f d d 14 (=,g, d ) 2 15 (g, d , f ) 1 f . . . . . . . . . Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 13 / 31

  17. Horizontal Features Function applications and arguments top-level symbols. # feature count ‘ 1 ( ‘ ,=,a) 0 . . . “ . . . . . . 100 “ p f , g q 1 f g 101 f pf , fq 1 f f d d g pd , dq 102 1 103 dpfq 1 f . . . . . . . . . Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 14 / 31

  18. Static Clause Features For a clause, its length and the number of pos./neg. literals. # feature count/val ‘ 103 dpfq 1 “ . . . . . . . . . f g 200 len 9 201 pos 1 f f d d 202 neg 0 . . . . . . f . . . Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 15 / 31

  19. Static Symbol Features For each symbol, its count and maximum depth. # feature count/val ‘ 202 neg 0 . . . . . . . . . “ 300 # ‘ p f q 1 f g 301 # a p f q 0 . . . . . . . . . f f d d 310 % ‘ pfq 4 f 311 % a pfq 0 . . . . . . . . . Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 16 / 31

  20. Static Symbol Features For each symbol, its count and maximum depth. # feature count/val ‘ 202 neg 0 . . . . . . . . . “ 300 # ‘ p f q 1 f g 301 # a p f q 0 . . . . . . . . . f f d d 310 % ‘ pfq 4 f 311 % a pfq 0 . . . . . . . . . Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 16 / 31

  21. Enigma Model Construction 1. Collect training examples from E runs (useful/useless clauses). 2. Enumerate all the features ( π :: feature Ñ int). 3. Translate clauses to feature vectors. 4. Train a LIBLINEAR classifier ( w :: float | dom p π q| ). 5. Enigma model is M “ p π, w q . Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 17 / 31

  22. Conjecture Features • Enigma classifier M is independent on the goal conjecture! • Improvement: Extend Φ C with goal conjecture features. • Instead of vector Φ C take vector p Φ C , Φ G q . Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 18 / 31

  23. Given Clause Selection by Enigma We have Enigma model M “ p π, w q and a generated clause C . 1. Translate C to feature vector Φ C using π . 2. Compute prediction: $ 1 iff w ¨ Φ C ą 0 & weight p C q “ 10 otherwise % Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 19 / 31

  24. Enigma Given Clause Selection • We have implemented Enigma weight function in E. • Given E strategy S and model M . • Construct new E strategy: • S d M : Use M as the only weight function: (1 * Enigma( M ) ) • S ‘ M : Insert M to the weight functions from S : (23 * Enigma( M ) , 3 * StandardWeight(...) , 20 * StephanWeight(...) ) Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 20 / 31

  25. Outline Introduction: ATPs & Given Clauses Enigma: The story so far. . . Enigma: What’s new? Experiments: Hammering Mizar Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 21 / 31

  26. XGBoost Tree Boosting System • Idea: Use decision trees instead of linear classifier. • Gradient boosting library XGBoost. 2 • Provides C/C++ API and Python (and others) interface. • Uses exactly the same training data as LIBLINEAR. • We use the same Enigma features. • No need for training data balancing. 2 http://xgboost.ai Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 22 / 31

  27. XGBoost Models • An XGBoost model consists of a set of decision trees. • Leaf scores are summed and translated into a probability. Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 23 / 31

  28. Feature Hashing • With lot of training samples we have lot of features. • LIBLINEAR/XGBoost can’t handle too long vectors ( ą 10 5 ). • Why? Input too big. . . Training takes too long. . . • Solution: Reduce vector dimension with feature hashing. • Encode features by strings and . . . • . . . use a general purpose string hashing function. • Values are summed in the case of a collision. Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 24 / 31

  29. Outline Introduction: ATPs & Given Clauses Enigma: The story so far. . . Enigma: What’s new? Experiments: Hammering Mizar Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 25 / 31

  30. Experiments: Hammering Mizar • MPTP: FOL translation of selected articles from Mizar Mathematical Library (MML). • Contains 57880 problems. • Small versions with (human) premise selection applied. • Single good-performing E strategy S fixed. • All strategies evaluated with time limit of 10 seconds. Jan Jakub˚ uv, Josef Urban Clause Features for Theorem Prover Guidance 26 / 31

Recommend


More recommend