Skip to content

bartbog/holygrail

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Holygrail

This repo contains the code + report for my Master Thesis "Automatic Translation of Logic Grid Puzzles into a Typed Logic".

Directory Structure

.
├── 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)

Installing Dependencies

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

Running the code

Setup

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

Run

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

Adding a problem

One can add a problem by adding a fact in problems.pl.

Executing the IDP solver

Download the IDP solver and put it in your home folder

Move into the bos/Output/ directory.

 /path/to/idp/executable problem_idp_file.idp   | grep -v "reduce" > name_of_output_file.output.json
problem(problem_name, problem(NbTypes, NbEntitiesPerType, Sentences, Lexicon)).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 70.3%
  • TeX 24.2%
  • Python 2.6%
  • PostScript 2.1%
  • Prolog 0.7%
  • JavaScript 0.1%