Skip to content

Commit

Permalink
Add shop3/hddl system.
Browse files Browse the repository at this point in the history
Translate SHOP plans into HDDL plans in IPC format.  Translate HDDL
problems into SHOP problems.
  • Loading branch information
rpgoldman committed Sep 13, 2023
1 parent 68278b9 commit 81e5358
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion jenkins/ext/pddl-tools
Submodule pddl-tools updated 44 files
+62 −0 .github/workflows/ci.yml
+108 −0 README.org
+0 −44 README.txt
+28 −0 buildapp-script
+64 −0 do-test.lisp
+1 −1 external-planners.asd
+5 −0 hddl-to-json-entrypoint.lisp
+31 −0 hddl-to-json.asd
+37 −0 hddl-utils.asd
+426 −0 hddl-utils/commons.lisp
+42 −0 hddl-utils/decls.lisp
+379 −0 hddl-utils/json.lisp
+97 −0 hddl-utils/package.lisp
+20 −0 hddl-utils/tests/example-plan.hddl
+366 −0 hddl-utils/tests/hddl-data.lisp
+46 −0 hddl-utils/tests/ipc2020-hiking-ordered-p01.hddl
+144 −0 hddl-utils/tests/ipc2020-syntactically-total-order-transport-domain.hddl
+33 −0 hddl-utils/tests/ipc2020-syntactically-total-order-transport-p01.hddl
+153 −0 hddl-utils/tests/ipc2020-total-order-transport-domain.hddl
+35 −0 hddl-utils/tests/ipc2020-total-order-transport-p01.hddl
+235 −0 hddl-utils/tests/json-tests.lisp
+6 −0 hddl-utils/tests/package.lisp
+222 −0 hddl-utils/tests/tests.lisp
+33 −0 hddl-utils/tests/transport-domain-ipc2020-no-methods-or-actions.hddl
+17 −0 hddl-utils/tests/transport-domain-ipc2020-no-methods-tasks-or-actions.hddl
+153 −0 hddl-utils/tests/transport-domain-partial-order-ipc2020.hddl
+22 −0 hddl.asd
+299 −0 hddl/hddl-pprint.lisp
+78 −0 hddl/package.lisp
+281 −0 json-schemas/domain.yaml
+137 −0 json-schemas/problem.yaml
+16 −0 panda-planner.asd
+1 −1 pddl-planners.asd
+4 −3 pddl-utils.asd
+3 −2 pddl.asd
+1 −1 pddl/package.lisp
+42 −14 pddl/pddl-pprint.lisp
+75 −0 planners/panda.lisp
+99 −44 utils/commons.lisp
+5 −1 utils/package.lisp
+51 −48 utils/tests/domain-test.lisp
+4 −1 utils/tests/package.lisp
+35 −11 utils/tests/pddl-data.lisp
+1 −0 version.lisp-expr
10 changes: 6 additions & 4 deletions shop3/hddl/hddl-plan.lisp
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
(in-package :hddl-translator)

(defun hddl-plan (plan tree)
"Take a SHOP PLAN and TREE (really a forest) as input and produce an
HDDL plan encoded as an s-expression."
(multiple-value-bind (indexed-plan task-indices)
(index-shop-plan (shop:remove-costs plan))
(let ((next-index (1+ (caar (last indexed-plan))))
(root-tasks (forest-roots tree))
roots decompositions)
(setf roots
(iter (for root in root-tasks)
(setf (gethash root task-indices) next-index)
(collecting next-index)
(incf next-index)))
(iter (for root in root-tasks)
(setf (gethash root task-indices) next-index)
(collecting next-index)
(incf next-index)))

`(:hddl-plan
:actions ,indexed-plan
Expand Down
2 changes: 2 additions & 0 deletions shop3/hddl/package.lisp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(in-package :common-lisp-user)

(defpackage hddl-translator
(:nicknames #:shop-hddl #:hddl-shop)
(:export #:hddl-plan)
(:use :common-lisp :alexandria :iterate))
14 changes: 10 additions & 4 deletions shop3/shop3.asd
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
(:module "looping-tasks"
:serial t
:components ((:file "loop-extensions")))


;; this is for the original SHOP3 plan trees.
(:module tree
Expand Down Expand Up @@ -193,7 +193,13 @@ minimal affected subtree."
(:file "graph-plan-tree"))
)


(defsystem "shop3/hddl"
:depends-on ("shop3" "hddl-utils")
:pathname "hddl/"
:serial t
:components ((:file "package")
(:file "hddl-plan" :depends-on ("package"))
(:file "hddl-problem" :depends-on ("package"))))


;;;---------------------------------------------------------------------------
Expand Down Expand Up @@ -271,7 +277,7 @@ shop3."
:components ((:module "shop-test-helper"
:pathname "tests/"
:components ((:file "common")))

(:file "silent-shop-test")
(:file "theorem-prover-tests"
:pathname "tests/theorem-prover-tests")
Expand Down Expand Up @@ -306,7 +312,7 @@ shop3."
(:file "plan-tree-tests"))
)
;;; FIXME: put these tests in a separate package, instead of in SHOP3-USER [2012/09/05:rpg]
(:module "shop-umt"
(:module "shop-umt"
:pathname "examples/UMT2/"
:components ((:file "UMT2")
(:file "pfile1")
Expand Down

0 comments on commit 81e5358

Please sign in to comment.