A Python package providing an environment for AI agents to test their Prolog code.
Project description
prolog-env
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file prolog_env-0.0.2.tar.gz.
File metadata
- Download URL: prolog_env-0.0.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8cf44cd45d2d8311c7a7cfdb8a65e210474f84957cef607c0d06310b6b16276
|
|
| MD5 |
57d131032313766dc803898fe6a2c4f8
|
|
| BLAKE2b-256 |
471487899216cf6c3c9316500b2955795bf0bc8b794e6c3000a8cc75e2bea12d
|
Provenance
The following attestation bundles were made for prolog_env-0.0.2.tar.gz:
Publisher:
python-publish.yml on NewJerseyStyle/prolog-env
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prolog_env-0.0.2.tar.gz -
Subject digest:
a8cf44cd45d2d8311c7a7cfdb8a65e210474f84957cef607c0d06310b6b16276 - Sigstore transparency entry: 171767923
- Sigstore integration time:
-
Permalink:
NewJerseyStyle/prolog-env@3d35003a4584ba95a1606af1fd34f87d30a2791f -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/NewJerseyStyle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3d35003a4584ba95a1606af1fd34f87d30a2791f -
Trigger Event:
release
-
Statement type:
File details
Details for the file prolog_env-0.0.2-py3-none-any.whl.
File metadata
- Download URL: prolog_env-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e65e72fb089c1ca40a85ef8b17003c15b466c960b6e887e4644bc16d225e756
|
|
| MD5 |
5da80c81e685ca6674caf321c886ae3c
|
|
| BLAKE2b-256 |
7b15944c013491739bd8ee44b63b4e755b7ad3deba1f2e93efd01d7dbf7176da
|
Provenance
The following attestation bundles were made for prolog_env-0.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on NewJerseyStyle/prolog-env
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prolog_env-0.0.2-py3-none-any.whl -
Subject digest:
1e65e72fb089c1ca40a85ef8b17003c15b466c960b6e887e4644bc16d225e756 - Sigstore transparency entry: 171767924
- Sigstore integration time:
-
Permalink:
NewJerseyStyle/prolog-env@3d35003a4584ba95a1606af1fd34f87d30a2791f -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/NewJerseyStyle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3d35003a4584ba95a1606af1fd34f87d30a2791f -
Trigger Event:
release
-
Statement type: