Repository navigation
Conversation
With Claude code's assistance, added two API functions, `domain-static-predicates` and `domain-fluent-predicates`. claude-code: opus-4-6
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a utility API to classify a domain’s predicates into static (never modified by any action effect) vs fluent (modified by at least one action effect), and exports the new functions from the pddl-utils package.
Changes:
- Exported two new public API functions:
domain-static-predicatesanddomain-fluent-predicates. - Implemented predicate-effect scanning utilities to derive the set of predicates affected by action effects.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| utils/package.lisp | Exports the new static/fluent predicate analysis APIs. |
| utils/commons.lisp | Implements effect traversal and the domain-*-predicates classification functions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+674
to
+689
| (case (first effect) | ||
| (and | ||
| (iter (for sub in (rest effect)) | ||
| (unioning (effect-affected-predicate-names sub) :test #'eq))) | ||
| (not | ||
| (effect-affected-predicate-names (second effect))) | ||
| ((when imply) | ||
| (effect-affected-predicate-names (third effect))) | ||
| ((forall exists) | ||
| (effect-affected-predicate-names (third effect))) | ||
| ((increase decrease assign scale-up scale-down) | ||
| nil) | ||
| (otherwise | ||
| (if (symbolp (first effect)) | ||
| (list (first effect)) | ||
| nil)))) |
Comment on lines
+697
to
+711
| (defun domain-static-predicates (domain) | ||
| "Return the predicate definitions from DOMAIN for predicates that are | ||
| static -- i.e., not made true or false by any action effect." | ||
| (let ((affected (domain-affected-predicate-names domain))) | ||
| (remove-if #'(lambda (pred-def) | ||
| (member (first pred-def) affected :test #'eq)) | ||
| (domain-predicates domain)))) | ||
|
|
||
| (defun domain-fluent-predicates (domain) | ||
| "Return the predicate definitions from DOMAIN for predicates that | ||
| may be modified -- i.e., made true or false by some action effect." | ||
| (let ((affected (domain-affected-predicate-names domain))) | ||
| (remove-if-not #'(lambda (pred-def) | ||
| (member (first pred-def) affected :test #'eq)) | ||
| (domain-predicates domain)))) |
Comment on lines
+691
to
+695
| (defun domain-affected-predicate-names (domain) | ||
| "Return the set of predicate-name symbols affected by any action in DOMAIN." | ||
| (iter (for action in (domain-actions domain)) | ||
| (unioning (effect-affected-predicate-names (action-effect action)) | ||
| :test #'eq))) |
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.
With Claude code's assistance, added two API functions,
domain-static-predicatesanddomain-fluent-predicates.claude-code: opus-4-6