Home

Awesome

Neural Guided Constraint Logic Programming for Program Synthesis

This repository contains code that goes with the paper: Neural Guided Constraint Logic Programming for Program Synthesis https://papers.nips.cc/paper/7445-neural-guided-constraint-logic-programming-for-program-synthesis

This repository contains an implementation of miniKanren where the constraint trees are represented transparently. We add scaffolding code to show how to drive miniKanren using an external agent in Python. We provide Recurrent Neural Network (RNN) and Graph Neural Network (GNN) agents as examples. The implementations of the RNN and GNN are consistent with the models described in the paper [0].

Dependencies

Transparent miniKanren

The following files contain an implementation of miniKanren where the constraint trees are represented transparently, and a python interface for interacting with a miniKanren process.

FileDescription
mk.scmtransparent implemenation of minikanren
evalo.scmdefinition of evalo, a relational interpreter
query.scmbuild queries annotated with ground truth
query-outputs.scmcompute ground truth outputs for queries
interact.scminteraction process for python to talk to
interact.pypython interface for scheme interaction
lisp.pyhelper for parsing lisp in python

Neural Network Model

The following files contain neural network agents that can drive miniKanren's search.

FileDescription
helper.pyhelper for working with constraints
rnn_grammar.pyparsing constraints for RNN model
rnn.pyforward pass for RNN model
gnn_grammar.pyparsing constraints for GNN model
gnn.pyforward pass for GNN model

Data Files

The following files contain the test problems used in the paper.

FileDescription
data/test_problems.txtheld out tree manipulation problems
data/repeat_test.txtgeneralization: repeat(N)
data/drop_last_test.txtgeneralization: dropLast(N)
data/bring_to_front_test.txtgeneralization: bringToFront(N)

References

[0] NeurIPS 2018 Neural Guided Constraint Logic Programming for Program Synthesis

[1] ICLR 2018 Workshop: with slightly less detail (4 pages)

[2] Lisa Zhang's Master's Thesis: with slightly more detail (23 pages)

[3] More information about miniKanren