Skip to content

Commit

Permalink
Fix conjunction handling in MAKE-ORDERED-METHOD.
Browse files Browse the repository at this point in the history
  • Loading branch information
rpgoldman committed Nov 25, 2023
1 parent 3ea5cca commit b55aca9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions hddl-utils/commons.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
arguments. Unless COMPLETE-P is NIL, will check for mandatory components."
(when complete-p
(unless domain (error "DOMAIN argument is mandatory."))
(unless goal (error "GOAL argument is mandatory.")))
;; (unless goal (error "GOAL argument is mandatory."))
)
(flet ((negated (fact) (eq (first fact) 'not)))
(let ((domain (hddl-symbol domain))
(objects (hddlify-tree objects))
Expand Down Expand Up @@ -157,7 +158,7 @@ arguments. Unless COMPLETE-P is NIL, will check for mandatory components."
`(:method ,method-name :parameters ,(copy-tree params)
:task ,task-sexpr
:precondition ,(copy-tree precond)
:ordered-subtasks (and ,@(copy-tree tasks))))
:ordered-subtasks ,(flatten-conjunction (copy-tree tasks) nil)))

(defun method-subtasks (method)
(cond ((find :ordered-subtasks method)
Expand All @@ -169,7 +170,8 @@ arguments. Unless COMPLETE-P is NIL, will check for mandatory components."
(t (error "Unable to find subtasks in method definition:~%~s" method))))

(defsetf method-subtasks (method) (subtasks)
`(let ((subtasks (hddlify-tree ,subtasks)))
`(let ((subtasks (when subtasks ; nil is just nil...
(flatten-conjunction (hddlify-tree ,subtasks) nil))))
(cond ((getf ,method :ordered-subtasks nil)
(setf (getf ,method :ordered-subtasks) subtasks))
((getf ,method :tasks nil)
Expand Down
2 changes: 1 addition & 1 deletion version.lisp-expr
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"3.2.1"
"3.2.2"

0 comments on commit b55aca9

Please sign in to comment.