Home

Awesome

Overview

Rust implementation of prolog (originally) based on miniprolog: http://andrej.com/plzoo/html/miniprolog.html

I translated miniprolog from the above SML sources to Rust for two primary reasons:

Starting from an existing implementation was nice because it shortened the time to a working version. The current version in this repository is very much a work in progress and overly simplistic. I plan to improve it to better learn Rust and I plan to improve it as I learn Rust :)

In other words, this is really a playground for me to play with both Rust and prolog.

Installation

Tested on Linux (Fedora), OSX, and Windows.

Should be as simple as: cargo run

Example

$ cargo run
Welcome to rust-prolog!
This prolog interpreter is based on the ML code at the PLZoo:
  http://andrej.com/plzoo/html/miniprolog.html

Input syntax: 
    ?- query.            Make a query.
    a(t1, ..., tn).      Assert an atomic proposition.
    A :- B1, ..., Bn.    Assert an inference rule.
    $quit                Exit interpreter.
    $use "filename"      Execute commands from a file.
Prolog> $use "src/likes.pl"
Prolog> ?- likes(X,Y).
Y = mary
X = john 

more? (y/n) [y] 

Roadmap

I haven't figured out exactly which directions I want to take this in, but some ideas I've been kicking around include:

Completed:

Old goals that I may not pursue after all: