Skip to main content

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


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

If you're not sure about the file name format, learn more about wheel file names.

uc_prolog-1.0.1-py3-none-any.whl (46.2 kB view details)

Uploaded Python 3

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

Hashes for uc_prolog-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8f063ec6647cc532e40b5683ee6efbc71b40a9b339f350e6d0a8e91de54e612f
MD5 e77bf6361997f5054b8f41a3b0875315
BLAKE2b-256 3371d4fc05acc8fd408d88c49bcb8ff6e4ff96673278ca957e17ebac5c60aab4

See more details on using hashes here.

Supported by

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