Coder Social home page Coder Social logo

herbautomaticabstraction's Introduction

HerbAutomaticAbstraction

Shortening Synthesized Programs using Common Subprograms in Solutions to Simpler Problems

This project depends on Herb.jl and will possibly be integrated into that project in the future. This repository is to be used for testing while I do my research project.

The following information, and the workings of the project, have been based on the work on DreamCoder by Ellis, et. al. Huge credits to them.

Program synthesis is the process of automatically producing a program which can satisfy a high level specification. It is a hard problem which can take a long time using brute force algorithms.

One of the ways to optimize this is to limit the search space, so the synthesizer can reach a solution faster if one exists. One common way of doing this is to reduce the allowed degree of complexity in the produced program, which can be done by reducing the allowed nesting height of the statements.

This creates the problem of not being able to solve overly complex specifications, because they would require a more complex program than the above limitation imposes. To allow a solution to such problems while keeping the limitation, one can provide the algorithm with more abstractions. This research explores ways of doing this automatically, via extending the program from common parts of the solutions to simpler problems, before tackling a complex problem.

Algorithm Block Diagram

The following shows what the algoritm tries to do, and the expected result. It uses a grammar that could be the subset of a Lisp-like language's grammar (Racket?):

Starting Grammar
ListOrNumber -> 1 | 2 | 3 … 13
ListOrNumber -> x
ListOrNumber -> (times ListOrNumber ListOrNumber)
ListOrNumber -> (head ListOrNumber)
ListOrNumber -> (tail ListOrNumber)
ListOrNumber -> (cons ListOrNumber ListOrNumber) | nil

Give different sets of examples, termed tasks
breadth-first-search, max search depth = 4

Examples 1
[2, 4, 10] -> 12
[3, 5, 8] -> 15
[2, 3, 4] -> 9

Program 1
(times 3 (head (tail x))) [depth 4]

Examples 2
[2, 4, 10] -> 8
[3, 5, 8] -> 10
[2, 3, 4] -> 6

Program 2
(times 2 (head (tail x))) [depth 4]

Common Pattern - Grammar Extension
ListOrNumber -> second-item = (head (tail x))

Testing Examples
[2, 4, 10] -> [2, 4]
[4, 2, 8] -> [4, 2]
[8, 5, 13] -> [8, 5]

Expected Program with the extended grammar:
(cons (head x) (cons second-item nil)) [depth 3]
Expected program with the original grammar:
(cons (head x) (cons (head (tail x)) nil)) [depth 5]

This project is for my bachelors thesis at Delft University of Technology, Computer Science and Engineering.

herbautomaticabstraction's People

Contributors

boraini avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.