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.
Metadata
Release files for uc-prolog 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uc_prolog-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / uc_prolog-1.0.1-py3-none-any.whl
| Download URL | uc_prolog-1.0.1-py3-none-any.whl |
|---|---|
| Size | 46.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f063ec6647cc532e40b5683ee6efbc71b40a9b339f350e6d0a8e91de54e612f
|
|
BLAKE2b-256 checksum How to use checksums |
3371d4fc05acc8fd408d88c49bcb8ff6e4ff96673278ca957e17ebac5c60aab4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for uc-prolog 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.