implementation of lambda free higher order superposition
play

Implementation of Lambda-Free Higher-Order Superposition Petar - PowerPoint PPT Presentation

Implementation of Lambda-Free Higher-Order Superposition Petar Vukmirovi Automatic theorem proving state of the art FOL HOL 2 Automatic theorem proving challenge HOL High-performance higher-order theorem prover that extends


  1. Implementation of Lambda-Free Higher-Order Superposition Petar Vukmirović

  2. Automatic theorem proving ‒ state of the art FOL HOL 2

  3. Automatic theorem proving ‒ challenge HOL High-performance higher-order theorem prover that extends first-order theorem proving gracefully . 3

  4. My approach FOL prover Add HO feature Fast HOL prover Optimize Test 4

  5. Syntax Types: Terms: τ ::= a t ::= X variable | τ → τ | f symbol | t t application 5

  6. Supported HO features Example: Applied variables + X ( f a ) f Partial application = Lambda-Free Applied variable Partial application Higher-Order Logic 6

  7. LFHOL iteration E LFHOL hoE Optimize Test 7

  8. Generalization of term representation Approach 1: Approach 2: Native representation Applicative encoding X ( f a ) f @(@( X , @( f , a )), f ) 8

  9. Differences between the approaches Approach 1: Approach 2: Native representation Applicative encoding Compact Easy to implement Fast Works well with E heuristics 9

  10. Unification problem Given the set of equations { s 1 = ? t 1 , …, s n = ? t n } find the substitution σ such that { σ ( s 1 ) = σ ( t 1 ), …, σ ( s n ) = σ ( t n ) } 10

  11. FOL unification algorithm Initial set of equations S No failure is reported Remove an equation s = ? t S = Ø S ≠ Ø S is unifiable Transform S Failure is reported S is not unifiable 11

  12. Transformation of the equation set Match s = ? t f ( s 1 , …, s n ) = ? f ( t 1 , …, t n ) Add { s 1 = ? t 1 , …, s n = ? t n } decomposition f ( s 1 , …, s n ) = ? g ( t 1 , …, t m ) Report failure collision f ( s 1 , …, s n ) = ? X Add { t = ? s } reorientation X = ? f ( s 1 , …, s n ); X not in t Apply [ X ← f ( s 1 , …, s n )] application X = ? f ( s 1 , …, s n ); X in t Report failure occurs-check X = ? X No changes identity 12 Match s , Match s , t

  13. FOL algorithm fails on LFHOL terms X b = ? f a b X ≠ f Report failure collision Yet, { X ← f a } is a unifier. 13

  14. Example X ← f a X 2 (Z 2 b c) d = ? f a (Y 1 c) d Z b c = ? Y c, d = ? d prefix match orientation Y ← Z b Y c = ? Z b c, d = ? d c = ? c, d = ? d prefix match decomposition Unifier d = ? d { X ← f a, Y ← Z b } decomposition 14

  15. LFHOL equation set transformation Match s = ? t ⍺ s 1 … s n = ? ⍺ t 1 … t n Add { s 1 = ? t 1 , …, s n = ? t n } decomposition β is var, either ⍺ is Add { t = ? s } reorientation not or n > m ⍺ s 1 … s n = ? β t 1 … t m Neither ⍺ nor β Report failure collision vars ⍺ is var, matches Add { ⍺ = ? t [: p ] , s 1 = ? t p +1 , …, s n = ? t m } prefix match prefix of t X = ? f s 1 … s n ; X not in t Apply [ X ← f s 1 … s n ] application X = ? f s 1 … s n ; X in t Report failure occurs-check X = ? X 15 No changes identity Match s , Match s , t

  16. Standard FOL operations s t unifiable/matchable? 16

  17. … are performed on subterms recursively, s f ( t 1 , t 2 , … , t n ) unifiable/matchable? 17

  18. … and there are twice as many subterms in HOL prefix subterms s f t 1 t 2 … t n f t 1 t 2 … t n f t 1 t 2 … t n f t 1 t 2 … t n argument subterms unifiable/matchable? 18

  19. Prefix optimization Traverse only argument subterms ● Use types & arity to determine the only unifiable/matchable prefix ● Report 1 argument trailing f X Y f a b c 19

  20. Advantages of prefix optimization 2x fewer No unnecessary No changes to E subterms prefixes created term traversal 20

  21. Indexing data structures f ( a , g ( b , Generalizations a ) ) c h(g(x,f(x,x))) s = ? σ ( t ) ) y , x ( f f ( x,g ( h ( y ) ,a )) Instances a σ ( s ) = ? t x f ( f ( x , x ) , f ( y , y ) Unifiable terms ) σ ( s ) = ? σ ( t ) Query term Set of terms 21

  22. E’s indexing data structures Discrimination trees Discrimination trees Fingerprint indexing Feature vector indexing 22

  23. Discrimination trees Factor out operations common for many terms Flatten the term and use it as a key Query term: f ( x , f ( h ( x ), y )) Flattening: f x f h x y 23

  24. Example Query term: 24

  25. Example Query term: 25

  26. Example Query term: 26

  27. Example Query term: Backtrack to where we can make choice No neighbour can generalize the term 27

  28. Example Query term: Backtrack further Mismatch 28

  29. Example Query term: 29

  30. Example Query term: 30

  31. Example Query term: 31

  32. Example Query term: 32

  33. LFHOL challenges 1. Applied variables 2. Terms prefixes of one another 3. Prefix optimization 33

  34. LFHOL challenges g a b Query term: 1. Applied variables Variable can match a prefix 2. Terms prefixes of one another 3. Prefix optimization 34

  35. LFHOL challenges g a b Query term: 1. Applied variables Variable can match a prefix 2. Terms prefixes of one another 3. Prefix optimization 35

  36. LFHOL challenges g a b Query term: 1. Applied variables Variable can match a prefix 2. Terms prefixes of one another 3. Prefix optimization 36

  37. LFHOL challenges 1. Applied variables 2. Terms prefixes of one another Terms can be stored in inner nodes 3. Prefix optimization 37

  38. LFHOL challenges f a b Query term: 1. Applied variables 2. Terms prefixes of one another 3. Prefix optimization Prefix matches are allowed 38

  39. Experimentation results HOL Two compilation modes: hoE - support for LFHOL FOL foE - support only for FOL 39

  40. Gain on LFHOL problems E hoE vs. original E 995 (encoded) LFHOL TPTP problems hoE 40

  41. Gain on LFHOL problems Both finished on 872 / 995 problems hoE: 8 unique, E: 11 unique Mean runtime: 0.010 s hoE 0.013 s E Total runtime: hoE 17.1 s E 113.9 s 41

  42. Overhead on FOL problems hoE vs. E foE vs. E Minimize the overhead for existing E users Tested on 7789 FOL TPTP problems 42

  43. foE vs. E Median runtime: foE 1.4 s 1.3 s E E Total runtime: foE 845909 s 844212 s E foE 43

  44. hoE vs. E Median runtime: hoE 1.5 s 1.3 s E E Total runtime: hoE 846897 s 844212 s E hoE 44

  45. Summary Engineering viewpoint Theoretical viewpoint New type module Graceful algorithm extension ● ● Native term representation Graceful data structures extension ● ● Elegant algorithm extensions ● Prefix optimizations ● 45

  46. Future work Integration with official E New features First-class E LFHOL Full HOL prover hoE booleans λ s Optimize Test 46

  47. Implementation of Lambda-Free Higher-Order Superposition Petar Vukmirović

Recommend


More recommend