Skip to content

A2DR1/RSynth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

RSynth

RSynth is a small program-synthesis framework for data-wrangling programs in R. It learns an R program that transforms an input dataframe into a desired output dataframe by searching over a context-free grammar, evaluating candidates in R (via Rserve), and optionally pruning or prioritizing the search with simple specs and heuristics.

The code is organized as a staged assignment:

Key Components

Requirements

  • Java 8
  • Maven
  • R with packages: tidyr, dplyr
  • Rserve
  • Z3 Java bindings (included under rsync/z3)

Setup

From the rsync directory:

  1. Start Rserve
make rserve
  1. Install the Z3 Java binding into your local Maven repo
make z3

Build and Run

All tasks are defined in rsync/Makefile. Examples:

  • pa0 interpreter test
make Test1
  • pa1 synthesis search
make Test2
  • pa2 synthesis with pruning (uses Z3)
make Test4
  • pa3 heuristic search
make Test8

How It Works (High Level)

  1. Define a grammar (CFG) of allowed dataframe transformations.
  2. Enumerate candidate programs as ASTs.
  3. Execute candidates in R via Rserve and compare outputs to the target.
  4. Optionally prune partial programs with Z3 specs or prioritize them with a heuristic.

Notes

  • Rserve is launched by rsync/server.r. If Rserve is not running, the Java interpreter will fail to connect.
  • For Z3-based tasks, the Z3 native library must be discoverable. The Makefile sets LD_LIBRARY_PATH for you in the relevant targets.

Project Files

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages