Skip to main content

prolog-env

PyPI version License

A Python package providing an environment for AI agents to test their Prolog code.

Installation

The package depends on SWI-Prolog, to install SWI-Prolog from PPA:

sudo apt-add-repository ppa:swi-prolog/stable
sudo apt-get update
sudo apt-get install swi-prolog libpython3-dev

Install the package using pip:

pip install prolog-env

Get started

This guide provides a quick introduction to using the prolog_env package. It demonstrates how to create and interact with the SimpleEvaluator environment.

from prolog_env import SimpleEvaluator

env = SimpleEvaluator()

code = """
train('Amsterdam', 'Haarlem').
train('Amsterdam', 'Schiphol').
"""

observation, reward, terminated, truncated, info = env.step(code)

print("Observation:")
print(observation)
print("Reward:", reward)

tests = """
:- begin_tests(test).

test(a) :-
        A is 2^3,
        assertion(float(A)),
        assertion(A == 9).

:- end_tests(test).
"""

observation, reward, terminated, truncated, info = env.step(code, tests)

print("Observation:")
print(observation)
print("Reward:", reward)

Metadata

Release files for prolog-env 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prolog-env 0.1.4
File Size Uploaded
prolog_env-0.1.4.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prolog-env 0.1.4
File Interpreter ABI Platform
prolog_env-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / prolog_env-0.1.4.tar.gz

Download URL prolog_env-0.1.4.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
01d2b51e99b366098ca8731f3efd33a9af412453910466f7ba163450357c0f56
BLAKE2b-256 checksum
How to use checksums
b78db73185ccd77dd051e222c0c06396d6987500f307e64abadfe6db3999a3f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2025.

Transparency log

Release files / prolog_env-0.1.4-py3-none-any.whl

Download URL prolog_env-0.1.4-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3814914325b0aa3b1f74eb0ffbb5cec97c7613ef78e0df1e87a0b25a3305fdfe
BLAKE2b-256 checksum
How to use checksums
1819581686b47353df662b059c8ec2aa43ac6d53e8e456adca5d9c642e7b9032
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page