This is a program that generates the solution to the self-referential aptitude test. The program is written in Prolog, a logical programming language.
Currently, the program runs far too inefficiently to actually generate the solution, but it can proof that the actual solution is valid if given the solution.
First install SWI-Prolog. Open the REPL by running $ swipl
.
?- [srat]. % Load the program
?- solve([a, a, a, a, a, a]). % Prove a given solution
false.
?- solve([ANS]). % Generate the solution.