This repository contains the experiments for the paper:
S. Dumancic, T. Guns, and A. Cropper: Knowledge Refactoring for Inductive Program Synthesis. AAAI '21
For any questions, contact Sebastijan
To reproduce the experiments, you need to perform several steps:
-
Generate and learn play tasks
Go to the
playgol_experiments
folder and follow the instructions. This is a slight modification of the Playgol, with clause deduplication disabled.NOTE: this step is not needed to reproduce the experiments. This step essentially produces data; you should use the same data as in the paper.
-
Refactor programs
Go to
experiments/knorf
folder.Run
python refactor_programs.py strings pncorrect "thr:8"
to refactor string transformation programs (thr:8 means "use 8 threads"). To refactorlego
programs, replacestrings
with `lego. -
Learn programs
Go to the
experiments/knorf/runners
folder. For string transfromation experiments, go further tostrings
folder; for lego tasks, go tolego
folder.Run
python runner.py learn-build-p ""
to solve the build/target tasks. -
Test the programs
Run
python runner.py test ""
in the same folder. -
Obtain results
To get results in JSON format, run
python runner.py results ""
.To get program sizes, replace
results
withsize
. To get the runtimes, replaceresults
withruntime-trial
.
To replicate the results with naive removal of redundancies (i.e., introduce a new predicate for each redundancy in the program), follow these steps:
-
Remove redundancies
Go to the
experiments/knorf
folder.Run
python compress_redundancies.py strings pncorrect ""
(uselego
for Lego experiments). -
Repeat steps 3-5 from the procedure above
Use
runner_nonredundant.py
instead ofrunner.py