Skip to main content

Library of miscellaneous utilies to work with PDDL (both in Python and on the command line).

Project description

pddl-utils

Library of miscellaneous utilies to work with PDDL (both in Python and on the command line).

Installation

pip install pddl-utils

Usage

Python

import pddlutils as pu

# Extended wrapper of the pddl library.
domain, problem = pu.load('domain.pddl', 'problem.pddl')

# Alternatively, if you have a pddl dom,prob pair, you can wrap it using...
# domain, problem = pu.load(dom, prob)

# Set of (lifted) fluents and actions
domain.predicates
domain.actions

# Access a particular action or fluent or constant/object
a = domain.action['move']
f = domain.predicate['connected']

p1 = domain.constant['person1']
l1 = problem.object['loc1']
l2 = problem.object['loc2']

# Ground a predicate
f = pu.ground(f, l1, l2)

# Ground an action
ag = pu.ground(a, p1, l1, l2)

Planned Usage

Python

import pddlutils as pu

# Extended wrapper of the pddl library.
domain, problem = pu.load('domain.pddl', 'problem.pddl')

# Alternatively, if you have a pddl dom,prob pair, you can wrap it using...
# domain, problem = pu.load(dom, prob)

# Set of (lifted) fluents and actions
domain.predicates
domain.actions

# Access a particular action or fluent or constant/object
a = domain.action['move']
f = domain.predicate['connected']

p1 = domain.constant['person1']
l1 = problem.object['loc1']
l2 = problem.object['loc2']

# Ground a predicate
f = pu.ground(f, l1, l2)

# Ground an action
ag = pu.ground(a, p1, l1, l2)

# Ground an entire domain (actions and fluents replaced with type-specific ground versions)
gdom, gprob = pu.ground(domain, problem)

# Easy progression
s0 = problem.init
act = list(problem.actions)[0]
s1 = tl.progress(s0, act)

# Easy action/fluent lookup
act = problem.action('move loc1 loc2')
fluent = problem.fluent('connected loc1 loc2')
assert fluent == problem.fluent('(connected loc1 loc2)')

# parses plans from file, string, or list
plan = problem.parse_plan('plan.ipc')
plan = problem.parse_plan('(move loc1 loc2)\n(move loc2 loc3)')
plan = problem.parse_plan(['move loc1 loc2', 'move loc2 loc3'])

CLI

Progress the initial state through a plan, and create a new problem file with the final state reached.

$ planutils progress --domain domain.pddl --problem problem.pddl --plan plan.ipc --output new-problem.pddl

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

pddl_utils-0.0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pddl_utils-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6dd57f5fa0acd6a0a70a08e760a47057099b31f837261e4a5542166f479c1478
MD5 2df777acc10b69c97b442932339bc7bf
BLAKE2b-256 84d70d2308f30fe0939c2a7d4c61e2610a4c5abadb97300a4e616f4cbdbfbb22

See more details on using hashes here.

Provenance

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

Publisher: python-publish.yml on AI-Planning/pddl-utils

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

File details

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

File metadata

  • Download URL: pddl_utils-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.0.1 CPython/3.12.8

File hashes

Hashes for pddl_utils-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 97ef963c4e4d40e360382a9b0f13f27e8ef528336bc25108dba2561bca959eec
MD5 04878bb4b7d32e3b65bdd57c0c9fb75c
BLAKE2b-256 75e8ec1dd2b8f48a4a503d90e8768cb506287b3609da07c9f803e71607874a4b

See more details on using hashes here.

Provenance

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

Publisher: python-publish.yml on AI-Planning/pddl-utils

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