Skip to content

Add code to identify static/fluent predicates. - #29

Open
rpgoldman wants to merge 1 commit into
masterfrom
static-fluents
Open

rpgoldman wants to merge 1 commit into
masterfrom
static-fluents

Conversation

@rpgoldman

Copy link
Copy Markdown
Owner

With Claude code's assistance, added two API functions, domain-static-predicates and domain-fluent-predicates.

claude-code: opus-4-6

With Claude code's assistance, added two API functions,
`domain-static-predicates` and `domain-fluent-predicates`.

claude-code: opus-4-6
@rpgoldman
rpgoldman requested review from mpatsift and a lite review from Copilot August 11, 2026 14:35

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.

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-predicates and domain-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 thread utils/commons.lisp
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 thread utils/commons.lisp
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 thread utils/commons.lisp
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)))
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