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
Release history Release notifications | RSS feed
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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
brolog-0.1.0-py3-none-any.whl
(10.6 kB
view details)
File details
Details for the file brolog-0.1.0.tar.gz.
File metadata
- Download URL: brolog-0.1.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
806505865282ac2fc53e1dbde23bd9a9f7b9d945f8d4a86afc88bd06e6907628
|
|
| MD5 |
bff3008f670379eef64d20248a46f2ea
|
|
| BLAKE2b-256 |
05e689e7b51f60210a466630a1ec1b3c12b29c5d6ed975574656009852449e0c
|
File details
Details for the file brolog-0.1.0-py3-none-any.whl.
File metadata
- Download URL: brolog-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc71c66d1ef044ce417fe4c812b57e6fd4b0396bf483963a1ae7164dd3a69c62
|
|
| MD5 |
84f40bc94dfdd6ab5334a842bf4fc6c1
|
|
| BLAKE2b-256 |
7e160f250d762180b34ed185efb01141b4d7f825d195a90f36bf86db82bfa17d
|