Logic-based inductive synthesis of efficient programs Andrew - - PowerPoint PPT Presentation

logic based inductive synthesis of efficient programs
SMART_READER_LITE
LIVE PREVIEW

Logic-based inductive synthesis of efficient programs Andrew - - PowerPoint PPT Presentation

Logic-based inductive synthesis of efficient programs Andrew Cropper Imperial College London String transformations Outpu Input t Computer Aided Verification CAV Principles Of Programming Languages POPL International Conference on


slide-1
SLIDE 1

Andrew Cropper Imperial College London

Logic-based inductive synthesis of efficient programs

slide-2
SLIDE 2

Input Outpu t Computer Aided Verification CAV Principles Of Programming Languages POPL International Conference on Functional Programming ??? International Joint Conference Artificial Intelligence ??? Neural Information Processing Systems ???

String transformations

slide-3
SLIDE 3

% python def f(input):

  • utput=[]

for x in string: if x.isupper():

  • utput.append(x)

return output % prolog f([],[]). f([X|Input],[X|Output]):- is_uppercase(X), f(Input,Output). f([X|Input],Output):- not_uppercase(X), f(Input,Output).

slide-4
SLIDE 4

Input Output [9,13,1,8,4] [1,4,8,9,13] [1,18,20,6,15,5] [1,5,6,15,18,20] [12,16,18,6,15,3,5] ??? [16,1,4,12,3,18,2,14] ??? [12,17,5,13,6,4,14,2,15] ???

Sorting

slide-5
SLIDE 5

Initial state Final state

1 2 3 1 2 3 1 2 3 1 2 3

Learning efficient robot strategies [IJCAI15]

slide-6
SLIDE 6

move(X,Y):-p3(X,Z),p3(Z,Y). p3(X,Y):-p2(X,Z),drop(Z,Y). p2(X,Y):-grab(X,Z),p1(Z,Y). p1(X,Y):-north(X,Z),east(Z,Y). move(X,Y):-p3(X,Z),drop(Z,Y). p3(X,Y):-grab(X,Z),p2(Z,Y). p2(X,Y):-p1(X,Z),p1(Z,Y). p1(X,Y):-north(X,Z),east(Z,Y).

slide-7
SLIDE 7

grab drop

1 2 3 1 2 3

Inefficient solution

1 2 3 1 2 3

Efficient solution Action drop grab north east Cost 1 1 1 1 resource complexity: 8 resource complexity: 6

slide-8
SLIDE 8

Meta-interpretive learning (MIL)

A form of inductive logic programming based on Prolog meta-interpreter which supports:

  • predicate invention
  • learning recursive programs
  • learning efficient programs
  • learning higher-order programs

https://github.com/metagol

slide-9
SLIDE 9

Input Output [9,13,1,8,4] [1,4,8,9,13] [1,18,20,6,15,5] [1,5,6,15,18,20] [12,16,18,6,15,3,5] ??? [16,1,4,12,3,18,2,14] ??? [12,17,5,13,6,4,14,2,15] ???

Sorting experiment

slide-10
SLIDE 10

20 40 60 80 100 1,000 2,000 3,000 4,000 5,000 List length Mean resource complexity

MetagolO MetagolD Tight bound n log n Tight bound n(n-1)/2

slide-11
SLIDE 11

Conclusions

  • pruning the search space [IJCAI15]
  • higher-order programs [IJCAI16]

Future work

  • Demonstrate generality
  • Use to discover novel algorithms
slide-12
SLIDE 12

Thank you