Skip to content

A simple prolog interpreter written in Rust

License

Notifications You must be signed in to change notification settings

transistorfet/conlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conlog

Started June 2, 2021

A simple prolog interpreter written in Rust with no external crate depedencies. It currently supports predicates, integers, strings, and lists, and will parse some infix operators including +, -, =, =, and 'is'.

To run the REPL:

cargo run -- inputfile.plg

where "inputfile.plg" has an initial set of facts and rules to populate the database with. It will then accept input at the ?- prompt.

Try running the metro1.plg file and at the prompt enter:

?- murderer(X).

You should see a trace of the deduction and the final result:

Result: murderer(sir_raymond)

Some tests are also included, which can be run using:

cargo test

About

A simple prolog interpreter written in Rust

Topics

Resources

License

Stars

Watchers

Forks

Languages