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

implementation of lambda free higher order superposition
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Petar Vukmirović

Implementation of Lambda-Free Higher-Order Superposition

slide-2
SLIDE 2

Automatic theorem proving ‒ state of the art

FOL HOL 2

slide-3
SLIDE 3

Automatic theorem proving ‒ challenge

HOL

High-performance higher-order theorem prover that extends first-order theorem proving gracefully.

3

slide-4
SLIDE 4

My approach

FOL prover Test Optimize Fast HOL prover Add HO feature

4

slide-5
SLIDE 5

Syntax

Types:

τ ::= a | τ → τ

Terms:

t ::= X | f | t t

variable symbol application

5

slide-6
SLIDE 6

Supported HO features

Example:

X (f a) f

Applied variables + Partial application = Lambda-Free Higher-Order Logic

Applied variable Partial application

6

slide-7
SLIDE 7

LFHOL iteration

E Test Optimize hoE LFHOL

7

slide-8
SLIDE 8

Generalization of term representation

Approach 1: Native representation

X (f a) f

Approach 2: Applicative encoding

@(@(X, @(f, a)), f)

8

slide-9
SLIDE 9

Differences between the approaches

Approach 1: Native representation Approach 2: Applicative encoding

Compact Fast Works well with E heuristics Easy to implement

9

slide-10
SLIDE 10

Unification problem

Given the set of equations

{ s1 =? t1, …, sn =? tn }

find the substitution σ such that

{ σ(s1) = σ(t1), …, σ(sn) = σ(tn) }

10

slide-11
SLIDE 11

FOL unification algorithm

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

11

slide-12
SLIDE 12

Transformation of the equation set

Match s =? t Match s , Match s , t Add { s1 =? t1, …, sn =? tn} Report failure Add { t =? s } Apply [X ← f(s1, …, sn)] Report failure No changes f(s1, …, sn) =? f(t1, …, tn) f(s1, …, sn) =? g(t1, …, tm) f(s1, …, sn) =? X X =? f(s1, …, sn); X not in t X =? f(s1, …, sn); X in t X =? X decomposition collision reorientation application

  • ccurs-check

identity

12

slide-13
SLIDE 13

FOL algorithm fails on LFHOL terms

Yet, { X ← f a } is a unifier. 13

X b =? f a b Report failure X ≠ f collision

slide-14
SLIDE 14

Example

X2

(Z2 b c) d =? f a (Y1 c) d

Z b c =? Y c, d =? d Y c =? Z b c, d =?d c =? c, d =? d d =? d X ← f a Y ← Z b prefix match prefix match

  • rientation

decomposition decomposition Unifier { X ← f a, Y ← Z b }

14

slide-15
SLIDE 15

LFHOL equation set transformation

Match s =? t Match s , Match s , t Add { s1 =? t1, …, sn =? tn} Apply [X ← f s1 … sn] Report failure No changes ⍺ s1 … sn =? ⍺ t1 … tn ⍺ s1 … sn =? β t1 … tm X =? f s1 … sn; X not in t X =? f s1 … sn; X in t X =? X decomposition application

  • ccurs-check

identity Add { t =? s } β is var, either⍺ is not or n > m Report failure Neither ⍺ nor β vars Add {⍺ =? t[:p], s1=? tp+1, …, sn=? tm} ⍺ is var, matches prefix of t reorientation collision prefix match

15

slide-16
SLIDE 16

Standard FOL operations

s t

unifiable/matchable?

16

slide-17
SLIDE 17

… are performed on subterms recursively,

s

unifiable/matchable?

f(t1, t2 ,…, tn)

17

slide-18
SLIDE 18

… and there are twice as many subterms in HOL

s

f t1 t2 … tn f t1 t2 … tn f t1 t2 … tn f t1 t2 … tn

18

unifiable/matchable? argument subterms prefix subterms

slide-19
SLIDE 19

Prefix optimization

  • Traverse only argument subterms
  • Use types & arity to determine the only unifiable/matchable prefix

19

f a b c f X Y

Report 1 argument trailing

slide-20
SLIDE 20

Advantages of prefix optimization

2x fewer subterms No unnecessary prefixes created No changes to E term traversal

20

slide-21
SLIDE 21

Indexing data structures

f ( a , g ( b , a ) )

f ( x , y )

h(g(x,f(x,x)))

a

c

x

f ( f ( x , x ) , f ( y , y ) )

Query term

f(x,g(h(y),a))

Set of terms Generalizations s =? σ(t) Instances σ(s) =? t Unifiable terms σ(s) =? σ(t)

21

slide-22
SLIDE 22

E’s indexing data structures

Discrimination trees Fingerprint indexing Feature vector indexing Discrimination trees 22

slide-23
SLIDE 23

Discrimination trees

Factor out operations common for many terms Flatten the term and use it as a key

Query term: Flattening: f(x, f(h(x), y)) f x f h x y

23

slide-24
SLIDE 24

Example

Query term:

24

slide-25
SLIDE 25

Example

Query term:

25

slide-26
SLIDE 26

Example

Query term:

26

slide-27
SLIDE 27

Example

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

27

slide-28
SLIDE 28

Example

Query term: Mismatch Backtrack further

28

slide-29
SLIDE 29

Example

Query term:

29

slide-30
SLIDE 30

Example

Query term:

30

slide-31
SLIDE 31

Example

Query term:

31

slide-32
SLIDE 32

Example

Query term:

32

slide-33
SLIDE 33

LFHOL challenges

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

slide-34
SLIDE 34

LFHOL challenges

1. Applied variables Variable can match a prefix 2. Terms prefixes of one another 3. Prefix optimization

Query term:

g a b 34

slide-35
SLIDE 35

LFHOL challenges

1. Applied variables Variable can match a prefix 2. Terms prefixes of one another 3. Prefix optimization

Query term:

g a b 35

slide-36
SLIDE 36

LFHOL challenges

1. Applied variables Variable can match a prefix 2. Terms prefixes of one another 3. Prefix optimization

Query term:

g a b 36

slide-37
SLIDE 37

LFHOL challenges

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

slide-38
SLIDE 38

LFHOL challenges

1. Applied variables 2. Terms prefixes of one another 3. Prefix optimization Prefix matches are allowed

Query term:

f a b 38

slide-39
SLIDE 39

Experimentation results

Two compilation modes: hoE - support for LFHOL foE - support only for FOL

HOL FOL

39

slide-40
SLIDE 40

Gain on LFHOL problems

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

hoE E

40

slide-41
SLIDE 41

Gain on LFHOL problems

Both finished on 872/995 problems hoE: 8 unique, E: 11 unique Total runtime: 41

hoE E 17.1s 113.9s

Mean runtime:

hoE E 0.010s 0.013s

slide-42
SLIDE 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

slide-43
SLIDE 43

foE vs. E

Total runtime: 43

foE E foE E 845909s 844212s

Median runtime:

foE E 1.4s 1.3s

slide-44
SLIDE 44

hoE vs. E

44

hoE E

Total runtime:

hoE E 846897s 844212s

Median runtime:

hoE E 1.5s 1.3s

slide-45
SLIDE 45

Summary

  • New type module
  • Native term representation
  • Elegant algorithm extensions
  • Prefix optimizations
  • Graceful algorithm extension
  • Graceful data structures extension

45 Engineering viewpoint Theoretical viewpoint

slide-46
SLIDE 46

Future work

Integration with official E

E Test Optimize hoE LFHOL

New features

First-class booleans λs Full HOL prover

46

slide-47
SLIDE 47

Petar Vukmirović

Implementation of Lambda-Free Higher-Order Superposition