Skip to main content

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

Project description

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)

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

prolog_env-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

prolog_env-0.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file prolog_env-0.0.1.tar.gz.

File metadata

  • Download URL: prolog_env-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for prolog_env-0.0.1.tar.gz
Algorithm Hash digest
SHA256 35c3d03474669c62660f8a1f4364aaf6ed7642064d6a6cc3c0911e4a65898f00
MD5 6321e34dd68485e7fb22986544e16e04
BLAKE2b-256 47302e0927c3660ff0ffe8a71874c2dcb0b4588c559f4d4eccee6e2eaa03f991

See more details on using hashes here.

Provenance

The following attestation bundles were made for prolog_env-0.0.1.tar.gz:

Publisher: python-publish.yml on NewJerseyStyle/prolog-env

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prolog_env-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: prolog_env-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for prolog_env-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 187c66fb001334fe8b909c593c357dfbe7e2d2b624fa865eec92a7b23c118ead
MD5 5c79f725fcb382519b7b12840c2dc169
BLAKE2b-256 2376129876b40d51fd9a0b07b0e8a40113e694740385068259d6f685918cbe28

See more details on using hashes here.

Provenance

The following attestation bundles were made for prolog_env-0.0.1-py3-none-any.whl:

Publisher: python-publish.yml on NewJerseyStyle/prolog-env

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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