This repo contains the code + report for my Master Thesis "Automatic Translation of Logic Grid Puzzles into a Typed Logic".
Make sure to also check out the extension of this work at https://github.com/bartbog/holygrail/ with which we won The 2019 Holy Grail Challenge.
.
├── bos This is the main source directory for the final thesis (using framework Blackburn & Bos)
│ └── output This directory contains the IDP files used to solve the puzzles
├── deliverables The final PDF deliverables for the thesis
├── diary A diary including what I did + questions for the Thesis Advisors (Laurent Janssens and Bart Bogaerts)
├── idp Some manual constructed IDP files as investigation in how a translation would look like
├── latex The latex files for the different reports
│ ├── december - Draft of thesis (deliverable by December)
│ ├── paper - Paper (english) describing the thesis (Final)
│ ├── presentatie-december - Presentation of progress in December
│ ├── presentatie-maart - Presentation of progress in March
│ ├── probleemstelling - Report describing problem thesis will tackle
│ ├── thesis - Final Thesis (Dutch)
│ ├── tussentijds-verslag-maart - Report in March
│ ├── tussentijds-verslag-november - Report in November
│ └── verdediging - The presentation to defend my thesis
├── poster The files for the poster describing the thesis work
│ └── graphviz The graphviz files used for the poster
└── src The source code used up until december (not using Blackburn & Bos)
To be able to run the code from Bos, one would need:
- docker (to run IDP, the constraint solver solving the puzzle)
- NodeJS
- SWI Prolog
Move into the bos/
directory. If you don't want to answers any questions, use the example cachedAnswers.pl
provided
cd bos
cp output/cachedAnswers.pl.example output/cachedAnswers.pl
Be sure to be in the bos/
directory!
To actually run a problem (this will parse everything and try to solve the puzzle as well):
swipl -g "solvep(problem_name)" -g halt main.pl
To do this for all puzzles:
swipl -g "solveAll" -g halt main.pl
To just test the parsing of a puzzle:
swipl -g "testAll([problem_name])" -g halt main.pl
One can add a problem by adding a fact in problems.pl
.
problem(problem_name, problem(NbTypes, NbEntitiesPerType, Sentences, Lexicon)).