planning-structs
Typed STRIPS planning structures in plain Python, with no dependencies: domains, their groundings on object sets, symbolic action models and traces. It is the structure layer of ROSAME and of other projects on learning planning models.
pip install planning-structs
Overview
from planning_structs import Domain, Instance, ActionModel, Trace
# A domain: types (single inheritance), predicates and action schemas with typed parameters.
domain = Domain(types=[("room", None), ("device", None), ("switch", "device")],
predicates=[("robot-at", ["room"]), ("in", ["device", "room"]), ("on", ["switch"])],
action_schemas=[("move", ["room", "room"]), ("turn-on", ["switch", "room"])],
name="switches")
# Its grounding on an object set: propositions (built at once) and actions (built on first use).
instance = Instance(domain, [("r1", "room"), ("r2", "room"), ("s1", "switch")])
print([str(p) for p in instance.propositions]) # robot-at_r1, robot-at_r2, in_s1_r1, ...
print(instance.num_actions)
# The lifted literals ("bindings") an action schema can have over each predicate:
move, robot_at = domain.get_action_schema("move"), domain.get_predicate("robot-at")
print(domain.predicate_arguments[(move, robot_at)]) # [(1,), (2,)]: robot-at(?x1), robot-at(?x2)
# A symbolic action model: per action schema, preconditions, add and delete effects.
model = ActionModel(domain)
model.preconditions["move"] = [(robot_at, (1,))]
model.add_effects["move"] = [(robot_at, (2,))]
model.del_effects["move"] = [(robot_at, (1,))]
print(model)
# A trace: objects, T + 1 states (true atoms, {atom: probability}, or vectors) and T actions.
trace = Trace(objects=[("r1", "room"), ("r2", "room")],
states=[["(robot-at r1)"], ["(robot-at r2)"]],
actions=["(move r1 r2)"])
# Data in its own order: name the entries of vector states and the actions integers refer to.
trace = Trace(objects=[("r1", "room"), ("r2", "room")],
states=[[1.0, 0.0], [0.0, 1.0]],
actions=[0],
proposition_order=["(robot-at r1)", "(robot-at r2)"],
action_order=["(move r1 r2)", "(move r2 r1)"])
Conventions
- Types form a tree under
object;t.is_child_of(u)is true whentisuor a descendant. - Bindings.
domain.predicate_arguments[(schema, predicate)]lists every way to fill the predicate's positions with distinct, type-compatible parameters of the schema, as tuples of 1-based parameter positions. Inmove(?from, ?to),(connected ?to ?from)is the binding(2, 1). - Grounding order. Propositions: predicates in domain order, then tuples of distinct, type-compatible objects in lexicographic order of their positions in the object list. Actions: the same for action schemas. Only the sequence of object types matters, not the names.
- Action models compare with
==regardless of literal order;a.diff(b)lists the literals present in only one of them.
Versions
Semantic versioning; see CHANGELOG.md. Additions arrive in minor releases and stay compatible with code written for earlier ones.
License
See LICENSE.
Metadata
Release files for planning-structs 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| planning_structs-0.2.0.tar.gz | 16.5 kB | With provenance | Details for planning_structs-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| planning_structs-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for planning_structs-0.2.0-py3-none-any.whl |
Total release size: 32.5 kB
Release files / planning_structs-0.2.0.tar.gz
| Download URL | planning_structs-0.2.0.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dc4318296d015cb7d878b019e8283168319c28b6ea830cd6d98bed54724be057
|
|
BLAKE2b-256 checksum How to use checksums |
ca0ea80c4769fddd556478551aef34a35842940b304bce99247dda09331cb91d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logRelease files / planning_structs-0.2.0-py3-none-any.whl
| Download URL | planning_structs-0.2.0-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6579f05dd8805bb959fdb12ade9aa7635b28240210d314a72da9dae27e3885d9
|
|
BLAKE2b-256 checksum How to use checksums |
02c5580793b35899942ad3fbf089e6a9e2173fdb3a9040440293700150308c98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logSecurity for planning-structs 0.2.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for planning_structs-0.2.0.tar.gz
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 Nov 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.