Skip to main content

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)"])

Conventions

  • Types form a tree under object; t.is_child_of(u) is true when t is u or 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. In move(?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.1.0

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

Source distribution (sdist)

Source distribution for planning-structs 0.1.0
File Size Uploaded Provenance Actions
planning_structs-0.1.0.tar.gz 16.0 kB With provenance Details for planning_structs-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for planning-structs 0.1.0
File Interpreter ABI Platform Actions
planning_structs-0.1.0-py3-none-any.whl Python 3 none any Details for planning_structs-0.1.0-py3-none-any.whl

Total release size: 31.7 kB

Release files / planning_structs-0.1.0.tar.gz

Download URL planning_structs-0.1.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4411dc976fbe7e0e6f353349c8dd5f6a778c7c572be0b4ddb17c7eca1ebf7846
BLAKE2b-256 checksum
How to use checksums
7d6b4e1442f9fad8bf2815ae71d8557bb1355f70f99bf5a857415b5e3ae1961e
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 log

Release files / planning_structs-0.1.0-py3-none-any.whl

Download URL planning_structs-0.1.0-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
469fea6f4d6e7efaa034ec5d1eb8f1c670e72320c625020551a73e3c3c4de37a
BLAKE2b-256 checksum
How to use checksums
e805700c21cfc1747e4e93fa113077dd8359b26e45eabe4c9ed00b2629977499
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 log

Security for planning-structs 0.1.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.

Select from 2 files

Attestation for planning_structs-0.1.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 log

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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