Giter Club home page Giter Club logo

herb.jl's Introduction

Build Status Dev-Docs

Herb.jl

A library for defining and efficiently solving program synthesis tasks in Julia.

Introduction

When writing research software we almost always investigate highly specific properties or algorithms of our domain, leading to us building the tools from scratch over and over again. The very same holds for the field of program synthesis: Tools are hard to run, benchmarks are hard to get and prepare, and its hard to adapt our existing code to a novel idea.

Herb.jl will take care of this for you and helps you defining, solving and extending your program synthesis problems.

Herb.jl provides...

  • a unified and universal framework for program synthesis
  • Herb.jl allows you to describe all sorts of program synthesis problems using context-free grammars
  • a number of state-of-the-art benchmarks and solvers already implemented and usable out-of-the-box

Herb.jl's sub-packages provide fast and easily extendable implementations of

  • various static and dynamic search strategies,
  • learning search strategies, sampling techniques and more,
  • constraint formulation and propagation,
  • easy grammar formulation and usage,
  • wide-range of usable program interpreters and languages + the possibility to use your own, and
  • efficient data formulation.

Getting started

Please check out our tutorial. Also check out recent projects and events on our website.

Conventions

Documentation

The entire documentation is available at https://herb-ai.github.io/Herb.jl/dev/install/.

herb.jl's People

Contributors

jaapdejong15 avatar thinnerichs avatar reubenj avatar issahanou avatar pwochner avatar pepijnk12 avatar sebdumancic avatar

Stargazers

Suavesito avatar Dominique Luna avatar Fons van der Plas avatar Misael Cureño avatar  avatar Hayden Jones avatar  avatar Orestis Ousoultzoglou avatar Marius Fersigan avatar Navi avatar Xiu-zhe (Roger) Luo avatar Marco Matthies avatar Cameron Smith avatar Mert Bora İnevi avatar  avatar  avatar Jeremiah avatar  avatar Serge Volkov avatar Matteo Meluzzi avatar  avatar

Watchers

 avatar  avatar Stef Rasing avatar  avatar

Forkers

lolo5689

herb.jl's Issues

Probabilistic iterator

Add an iterator to search that makes use of probabilistic grammars.
It should enumerate expressions with higher probability before expressions with lower probability.

Automate ipynb to md conversion tutorials

  • Make sure the md and ipynb are the up-to-date and the same
  • Add automation to only have to update ipynb and automatically generate markdown
  • Add automation to workflow

Write contributing guideline

Motivation:

New contributors/students/researchers barely know where and what to write down their implementation.

Goal:

Write proper contribution guidelines:

  • update READMEs and define scope for each repo (give proper intuition about what the respective modules are supposed to do)
  • how to use Gitjub sub-modules locally within Julia Herb package

New repo: Heuristics.jl

This repo contains implementations of search heuristics.
It should support both static and dynamic constraints.

Interfaces:

  • Search.jl iterators should take this as an input

Add `Extensive tests`

HerbSearch.jl/test/realistic_search_test.jl and all test in HerbLearn.jl/test/ take longer time to run. Hence it is not feasible to include in the general test suites. However, they are very valuable to be run from time to time.

Thus, I propose to have a separate test-alike way of running these tests separately.

New repo: Search.jl

This repo should contain implementations of search procedures over grammar expressions (BFS, DFS, A*, ...)

Core functionality:

  • Depth-first search and breadth-first search implementations
  • Write the expansion step in a different file: the input is the current state and the output is the set of possible children

Desired Functionality:

  • Nice abstracted search template: state manipulation
  • Search algorithms: A*, Metropolis-Hastings, Very Large Neighbourhood Search, Monte Carlo Tree Search, Genetic algorithms

Interfacing with other packages:

  • take a grammar definition from Grammar.jl,
  • takes Heuristics.jl
  • takes ConstraintsLib.jl
  • takes Specification.jl
  • takes LearningToSearch.jl

@THinnerichs and @jaapdejong15 will make the template, and @piotr-cichon and @nickk2002 will focus on the other search functionalities

Support removing rules in the grammar

Create a function that removes/disables a rule in the grammar.
It is important to make sure that indices of the other rules do not shift, since this would make existing RuleNode trees that do not use the deleted rule change meaning.

New repo: SpecificationLanguage.jl

This repository should contain the functionality for defining specifications, both the DSL and the task.

Interfacing with other components:

  • Grammar.jl should associate these descriptions with symbols in a DSL
  • Data.jl should use this language to specify the task

Tests

Figure out how to get tests for submodules to run

Move constraints functionality to Constraints.jl

The constraints functionality is currently in ExprRules.jl

Move everything regarding specifying constraints in a new repo Constraints.jl

Interface with others:

  • Search.jl should implement all functionality regarding calling/checking constraints
  • This package only implements the constraints

Update contributors and contact details

  • Add contact details for main contributors and maintainers
  • add contributors to each sub-module and
  • copy the form the sub-modules into the main module (markup file with actual contributions)

Move parts of ProbExprRules.jl to Grammar.jl and Search.jl

ProbExprRules.jl adds functionalities for probabilistic grammars, on top of another non-probabilistic grammar.

Move functionalities for specifying the probabilistic grammar to Grammar.jl
Move functionalities for search over probabilistic grammars to Search.jl

Generalize Specs + eval

Unify the paradigms:

  • specifications
  • input/outputs examples
  • probabilistic programs
    (- RL alike synthesis with a reward function?)
    within eval and interpret. We need this as a foundation stone for future students. Functions should throw NotImplementedError

Grammar core functionality

Add the following:

  • Context free grammar type
  • Functionality for specifying grammars
    • Adding rules
    • Removing rules
    • Reading grammars from files
    • Parsing macros
    • Basic helper functions
    • Storing grammars to files

Most if not all functionality can be taken from the ExprRules repository.

New repo: Examples.jl

  • Create repository for examples of working with the framework
  • Figure out how to best show the examples (e.g. Jupyter notebook / Pluto.jl)
  • Create Examples.jl label in Herb.jl

Neural network support and pre-training

As crucial for many ongoing and coming projects, ML support for Herb.jl is highly important.

This module will focus on:

  • Pre-training
  • interplay with heuristics

Documentation (!!!!!!!!)

  • HerbGrammar.jl
  • HerbSearch.jl
  • HerbCore.jl
  • HerbEvaluation.jl
  • HerbData.jl
  • HerbConstraints.jl
  • Herb.jl

New repo: Evaluation.jl

This package should provide the functionality to evaluate candidate programs.
In the beginning, it can only contain single evaluation criteria: run a program on input and see if produces the right output.
We can later add more sophisticated criteria.

Core functionality:

  • take a program and examples, run the program on the input, and return the output

New repo: Grammar.jl

The Grammar.jl repository should contain all code related to declaring grammars and basic supporting functions (generating random expressions, getting the number of rules and so on...)

Core functionality:

  • specifying grammars: add, remove rules, read grammars from files, parsing macros, basic helper functions, store
    grammars
  • core type: context-free grammar

Others:

  • different types of grammars: context-free, context-sensitive, probabilistic

Interfacing with other parts:

  • no input dependencies from other packages
  • Search.jl uses it to define iterators/search procedures
grammar = @cfgrammar begin
    Real = x                      # symbol
    Real = Real * Real            # julia expression
    Real = f(Real)                # function call
    Real = _(Base.rand(1.0:5.0))  # special syntax, eval argument of _() at derivation time
    Real = A | B | cos(Real)        # multiple rules on a single line
    Real = 1 | 2 | 3
    Real = |(4:6)                 # same as Real = 4 | 5 | 6
    Real = |([7,8,9])             # same as Real = 7 | 8 | 9 
end
   

New repo: Data.jl

This repo should contain all functionality regarding specifying examples (in whatever form)

core functionality:

  • input-output examples
  • read examples from files

Additional functionality:

  • traces
  • specifications

New repo: SpecificationDiscovery.jl

This repo should contain functionality to discover specifications during the search.

Interfaces:

  • SpecificationLanguage.jl to express constraints
  • Search.jl to discover and prune
  • Constraints.jl to express the constraints for Search.jl

New repo: LearningToGuide.jl

This repo should contain functionality for learning to guide synthesis.

Interfacing:

  • should produce a heuristic implement in Heuristics.jl?
  • the heuristic should be passed to Search.jl

New repo: Refactoring.jl

This repo should contain functionalities for program refactoring a la DreamCoder/Knorf.

Interfaces:

  • Grammar.jl contains expressions it operates on

New repo: root synthesis package

Create a new root repo that composes a program synthesiser.

Core functionality:

  • install all dependencies
  • focus on user interaction, how the user should use the library: init, run, output

Additional functionality:

  • benchmarking and basic config for default cases
  • template notebooks

General expand function

Create an extendible expand function

  • Expand has an option for finding all holes
  • Expand uses an external function for picking the hole

Update: Explicit Hole objects can now be added to the RuleNode tree, eliminating the problem described in the conversation below.

New repo: SpecificationReasoning.jl

This repo should contain functionality to reason about the Specification of DSL/tasks.
This package should simply translate the specification to off-the-shelf solvers (Z3, Type theory reasoners, whatever we might need).

Interfaces:

  • Takes a specification written in SpecificationLanguage.jl
  • Should interface with Search.jl by producing constraints expressed in Constraints.jl

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Refactoring to Julia

Make Herb Julia-esk, exploiting what Julia is good at (2-3 people, including Sebastijan), i.e. multiple dispatch, non-pythonic code, reduce memory allocation.

  • Stochastic search methods (by Piotr & Nikolai) (1-2 people, including Sebastijan)
  • other early code (HerbCore, HerbGrammar, (HerbConstraints), ...)

Clean up Bart's code

  • Remove #@TODOs from mainly HerbSearch, but check HerbConstraints, HerbCore, and HerbGrammar, too
  • remove multi-line comments starting with #
  • add documentation to all added functions, especially specific propagate!(...) functions, and getter/setter functions (otherwise they will not show up in the docs

New repo: Utils.jl

This should be a collection of all random utilities that we need across packages

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.