Skip to content

Prolog implementation based on Warren's abstract machine

License

Notifications You must be signed in to change notification settings

matsud224/wamcompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This is a prolog compiler written in Common Lisp which compiles prolog code to bytecode of Warren's abstract machine (WAM).

I recommend using Steel Bank Common Lisp (SBCL). To start REPL, eval the following expression:

(load "wamcompiler.lisp")
(repl)

Input ';' to show the next solution, 'y' to stop finding solutions, or 'a' to show all solutions.

To show the compiled bytecode, eval the following expression:

(show-wamcode "predicate-name" predicate-arity)

An article of this program (in Japanese): 「すごいPrologつくって学ぼう?!」 pp.23-37 https://www.kitcc.org/share/lime/lime56.pdf

References