Source code for publication "Synthesizing Interpretable Strategies for Solving Puzzle Games" from FDG 2017.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config Initial import. Jul 27, 2017
data Initial import. Jul 27, 2017
html Initial import. Jul 27, 2017
old-docs Initial import. Jul 27, 2017
out Initial import. Jul 27, 2017
paper-data Initial import. Jul 27, 2017
src Initial import. Jul 27, 2017
.gitignore add .gitignore Jul 27, 2017
LICENSE Initial commit Jul 27, 2017
README.md Initial import. Jul 27, 2017
do-analysis.sh Initial import. Jul 27, 2017
do-learning.sh Initial import. Jul 27, 2017

README.md

Nonograms Rule Synthesis

The source code used in the publication Synthesizing Interpretable Strategies for Solving Puzzle Games.

Installation

Requires Racket 6.9 or higher, and a recent version of the Rosette library. The code will run on any major desktop OS, but experience is likely to be best on a POSIX system.

First, optionally, build the project files for faster startup by running the following form the root directory:

$ raco make src/*.rkt

Usage

To run the learning algorithm, execute the following commands, from the root directory. The scripts require a configuration file, which can be found in config/. Both config/toy.json and config/sample.json use dramatically smaller training sets and program search spaces than the configuration used for the paper (so take dramatically less time to run). The toy.json version uses all states with lines up to length 2, while sample.json uses random states with lines up to length 6. The configuration files can be modified to, e.g., change the number of worker threads. By default they assume an 8-core processor. For the sample.json config, run:

$ ./do-learning.sh config/sample.json

This will potentially take hours to finish. To analyze the results:

$ ./do-analysis.sh config/sample.json

This will create a file html/results.html showing the top 10 (or less than 10 if a full cover was reached) synthesized rules as selected by the optimization algorithm. This will also create a file html/builtins.html that shows the manually transcribed control rules. The rules synthesized with the sample configuration are unlikely to be better than the control rules due to the small training size.

Other Information

The data (including the testing set, synthesized rules, and analyzed results) used in the paper's evaluation are in paper-data/. The synthesized rule data file also includes, along with the rules themselves, the training item used to synthesize each rule.

The visualization code uses Font Awesome by Dave Gandy - http://fontawesome.io.