Skip to content

Add code to topologically sort domain types. - #31

Merged
rpgoldman merged 9 commits into
masterfrom
sort-domain-types
Sep 4, 2026
Merged

rpgoldman merged 9 commits into
masterfrom
sort-domain-types

Conversation

@rpgoldman

Copy link
Copy Markdown
Owner

This sort is performed automatically when using the setf method on
domain-types or make-domain. Also when using canonicalize-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

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-types and apply it during make-domain construction and via (setf (domain-types ...)).
  • Add typed-list/alist conversion helper (alist-to-typelist) plus remove-parameter, and clarify canonicalize-domain behavior in its docstring.
  • Add FiveAM coverage for topological-sort-types and (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.

Comment thread utils/commons.lisp
Comment thread utils/commons.lisp
Comment thread utils/commons.lisp Outdated
Comment thread utils/commons.lisp Outdated
rpgoldman and others added 4 commits September 4, 2026 10:06
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`.
Unable to get a working docker image for Allegro.
@rpgoldman
rpgoldman merged commit ccc0b36 into master Sep 4, 2026
2 checks passed
@rpgoldman
rpgoldman deleted the sort-domain-types branch September 4, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants