Skip to main content

Prolog interpreter written in Python

Project description

Brolog - Prolog interpreter written in Python

Installation

pip install brolog

CLI usage

brolog input.pl
?- list([]).
true.

?- list([1,2]).
true.

?- append(X, Y, [1,2,3]).
X = [1,2],
Y = 3.

?- append([1], X, [4,5]).
false.

Using this file as input:

list([]).
list([_|T]) :- list(T).

append([], X, [X]).
append([H|T], X, [H|R]) :- append(T, X, R).

Supported builtins

  • Lists: [H|T], [1,2], ..
  • Cut: !
  • Arbitrary symbolic functions: f(), g(a, b), ..

TODO

  • (WIP) Use networkx to generate the SDL tree of a query
  • Add more commonly used builtins

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brolog-0.1.0.tar.gz (11.0 kB view hashes)

Uploaded Source

Built Distribution

brolog-0.1.0-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page