Production-grade Prolog interpreter with WAM solver, ISO compliance, and expert system support
Project description
uc-prolog — Python
Production-grade Prolog interpreter. Zero external dependencies. Embeddable. Available on PyPI.
Part of uc-prolog.
Install
pip install uc-prolog
Run
python3 -m uc_prolog --repl
python3 -m uc_prolog --port 4002
Use as library
from uc_prolog import Engine
engine = Engine()
engine.eval("parent(tom, bob).")
engine.eval("parent(bob, ann).")
result = engine.eval("?- parent(tom, X).")
# result: "X = bob."
Features
- ISO Prolog compliant
- WAM-based solver
- Modules
- Stream I/O
- Rational arithmetic
- DCG (Definite Clause Grammars)
- Embeddable Python library + standalone CLI + HTTP server
Tests
python3 -m pytest tests/ -v
Note
The Python implementation is a port of the Go reference implementation. Both pass the same 444-test ISO compliance suite.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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
uc_prolog-1.0.1-py3-none-any.whl
(46.2 kB
view details)
File details
Details for the file uc_prolog-1.0.1-py3-none-any.whl.
File metadata
- Download URL: uc_prolog-1.0.1-py3-none-any.whl
- Upload date:
- Size: 46.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f063ec6647cc532e40b5683ee6efbc71b40a9b339f350e6d0a8e91de54e612f
|
|
| MD5 |
e77bf6361997f5054b8f41a3b0875315
|
|
| BLAKE2b-256 |
3371d4fc05acc8fd408d88c49bcb8ff6e4ff96673278ca957e17ebac5c60aab4
|