Program synthesis -- the automatic generation of code given a specification -- is one of the most fundamental tasks in artificial intelligence (AI) and many programmers' dream. Numerous synthesizers have been developed to tackle program synthesis, manifesting different ideas to approach the exponentially growing program space. While numerous smart program synthesis tools exist, reusing and remixing previously developed methods is tedious and time-consuming. We propose Herb.jl, a unifying program synthesis library written in the Julia programming language, to address these issues. Since current methods rely on similar building blocks, we aim to modularize the underlying synthesis algorithm into communicating and fully extendable sub-compartments, allowing for straightforward reapplication of these modules. To demonstrate the benefits of using Herb.jl, we show three common use cases: 1. how to implement a simple problem and grammar, and how to solve it, 2. how to implement a previously developed synthesizer with just a few lines of code, and 3. how to run a synthesizer against a benchmark.
Program synthesis—automatically generating code from given specifications—is one of the most fundamental tasks in artificial intelligence and a long-standing dream for many programmers. While numerous intelligent program synthesis tools have been developed to handle exponentially growing program spaces, reusing and recombining existing methods remains tedious and time-consuming. This paper presents Herb.jl, a unified program synthesis library written in the Julia programming language to address these challenges. Since existing methods rely on similar building blocks, the authors aim to modularize underlying synthesis algorithms into communicable and fully extensible subcomponents, thereby enabling direct reapplication of these modules.
using HerbBenchmarks
pairs = get_all_problem_grammar_pairs(PBE_SLIA_Track_2019)
solved_problems = 0
for (problem, grammar) in pairs
solution = probe(grammar, :Start, problem; max_depth=5)
if !isnothing(solution)
solved_problems += 1
end
end
The paper cites important works in the program synthesis field, including:
SyGuS competition benchmarks (Padhi et al., 2019)
Probe algorithm (Barke et al., 2020)
FrAngel synthesizer (Shi et al., 2019)
Neo synthesizer (Feng et al., 2018)
Program synthesis survey (Gulwani et al., 2017)
Overall Assessment: This is a high-quality systems paper that proposes a much-needed unified framework for the program synthesis field. While there is room for improvement in experimental evaluation, its technical contributions and practical value are outstanding and have the potential to become important infrastructure in the field.