Repository navigation
Add code to topologically sort domain types. - #31
Merged
Merged
Conversation
This sort is performed automatically when using the `setf` method on `domain-types`. Required because the Fast Downward translator doesn't like forward references (types mentioned as supertypes before they are introduced as subtypes of previously defined types). claude-code: opus-4.6
claude-code: opus-4.6
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
There are confirmed correctness/build issues in the new type-sorting and (setf domain-types) implementation (including a non-compiling iterate form and missing pddlification/graph-safety fixes).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR introduces automatic topological ordering for PDDL domain type declarations to avoid forward references that the Fast Downward translator rejects, and wires that behavior into domain construction and mutation paths.
Changes:
- Add
topological-sort-typesand apply it duringmake-domainconstruction and via(setf (domain-types ...)). - Add typed-list/alist conversion helper (
alist-to-typelist) plusremove-parameter, and clarifycanonicalize-domainbehavior in its docstring. - Add FiveAM coverage for
topological-sort-typesand(setf domain-types), register new tests, and bump the library version.
File summaries
| File | Description |
|---|---|
| version.lisp-expr | Bumps package version to 3.8.0. |
| utils/commons.lisp | Implements topological sort, integrates it into domain creation/setf, and adds typed-list utilities. |
| utils/package.lisp | Exports new public utilities (topological-sort-types, alist-to-typelist, remove-parameter). |
| utils/tests/topological-sort-tests.lisp | Adds new FiveAM tests covering sorting and domain mutation behavior. |
| utils/tests/package.lisp | Imports alexandria:set-equal for test assertions. |
| pddl-utils.asd | Registers the new test file in the test system. |
| doc/topo-sort-types-2026-09-01.md | Adds a detailed development transcript/design notes for the change. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Ensure that the types are "pddlified" and make sure that there is a `:types` block (or raise an error). Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot's suggestion was not accurate, but the idea of checking for cycles (and avoiding infinite loop errors) is a good one. This is my implementation.
Also fix style-warning in `topological-sort-types`.
rpgoldman
force-pushed
the
sort-domain-types
branch
from
September 4, 2026 16:26
342ea16 to
8318c61
Compare
Unable to get a working docker image for Allegro.
rpgoldman
force-pushed
the
sort-domain-types
branch
from
September 4, 2026 17:18
bb84979 to
f4d2800
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This sort is performed automatically when using the
setfmethod ondomain-typesormake-domain. Also when usingcanonicalize-domain.Required because the Fast Downward translator doesn't like forward
references (types mentioned as supertypes before they are introduced
as subtypes of previously defined types).
claude-code: opus-4.6