This project compiles a theorem prover written and proven with Isabelle and compiles it into Prolog.
It does so in Haskell through several catamorphism that changes the Isabelle AST into a Prolog AST.
It includes a Isabelle pretty printer only for testing the parser by exploiting that prettyPrint . parse = id
.
It has three (brilliant) libraries as main dependencies:
- Parsec for parsing Isabelle.
- Recursive Schemes for generalized recursion methods like catamorphism and paramorphism.
- PrettyPrint by Daan Leijen based on Philip Wadler's prettier printer.
To run Haskell tests:
stack test --file-watch
To generate and test the compiled prolog prover run:
make testprolog
- Capitalize every argument
- Replace
constants
likeZeroNat
. - make
more x1 x2 = y
into
| input is output ->more(A1, A2, Y).
| input is func call ->more(A1, A2, Y) :- func(..., Y).
- If composition of functions then string together nested calls with
,
(AND). - Replace unused variables with
_
.