Skip to content

Commit

Permalink
clean-up and document blocksworld domains - AI-Planning#4
Browse files Browse the repository at this point in the history
  • Loading branch information
ssardina committed Sep 22, 2024
1 parent 1a39dc2 commit 9740d01
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 66 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ A description of the above domains can be found in 2008 Bryce & Buffet's [Intern

## PRP (2012)

The [2012 PRP paper](https://cdn.aaai.org/ojs/13520/13520-40-17038-1-2-20201228.pdf) used all the four final IPC-6 FOND track domains and probabilistic interesting ones, plus the following ones.
The [2012 PRP paper](https://cdn.aaai.org/ojs/13520/13520-40-17038-1-2-20201228.pdf) used all the four final 2008 IPC-6 FOND track domains and probabilistic interesting ones, plus the following ones.

First, the `blocksworld` and `forest` domains were extended as follows:

- `blocksworld-new`: scaled the number of blocks from 1 to 50 (the highest number of blocks in the original benchmark set is 20)
- `blocksworld-new`: scaled the number of blocks from 1 to 50 (the highest number of blocks in the original benchmark set is 20).
- `forest-new`: generator slightly to guarantee that every problem has a strong cyclic plan.

Second, the PRP paper modified three domains from [**2006 IPC5 Probabilistic Track**](https://ipc06.icaps-conference.org/probabilistic/) by stripping the probabilities and replacing them with non-deterministic `oneof` constructs:

- `blocksworld-2`
- `blocksworld-2`: same domain as the IPC-6 `blocksworld` but with 15 instances coming from the probabilistic track.
- `elevators`
- `zenotravel`

Expand Down
43 changes: 29 additions & 14 deletions benchmarks/blocksworld-2/domain.pddl
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
; FOND version of probabilistic version from IPC 2008
; [**2006 IPC5 Probabilistic Track**](https://ipc06.icaps-conference.org/probabilistic/)
; e.g., some actions may fail and have no effect; some may drop the block to the table
(define (domain blocks-domain)
(:requirements :non-deterministic :equality :typing)
(:types block)
(:predicates (holding ?b - block) (emptyhand) (on-table ?b - block) (on ?b1 ?b2 - block) (clear ?b - block))
(:types
block
)
(:predicates
(holding ?b - block)
(emptyhand)
(on-table ?b - block)
(on ?b1 ?b2 - block)
(clear ?b - block)
)
(:action pick-up
:parameters (?b1 ?b2 - block)
:precondition (and (not (= ?b1 ?b2)) (emptyhand) (clear ?b1) (on ?b1 ?b2))
:effect
(oneof
(and (holding ?b1) (clear ?b2) (not (emptyhand)) (not (clear ?b1)) (not (on ?b1 ?b2)))
(and (clear ?b2) (on-table ?b1) (not (on ?b1 ?b2))))
:effect (oneof
(and (holding ?b1) (clear ?b2) (not (emptyhand)) (not (clear ?b1)) (not (on ?b1 ?b2)))
(and (clear ?b2) (on-table ?b1) (not (on ?b1 ?b2))))
)
(:action pick-up-from-table
:parameters (?b - block)
:precondition (and (emptyhand) (clear ?b) (on-table ?b))
:effect (oneof (and) (and (holding ?b) (not (emptyhand)) (not (on-table ?b))))
:effect (oneof
(and)
(and (holding ?b) (not (emptyhand)) (not (on-table ?b))))
)
(:action put-on-block
:parameters (?b1 ?b2 - block)
:precondition (and (holding ?b1) (clear ?b2))
:effect (oneof (and (on ?b1 ?b2) (emptyhand) (clear ?b1) (not (holding ?b1)) (not (clear ?b2)))
(and (on-table ?b1) (emptyhand) (clear ?b1) (not (holding ?b1))))
:effect (oneof
(and (on ?b1 ?b2) (emptyhand) (clear ?b1) (not (holding ?b1)) (not (clear ?b2)))
(and (on-table ?b1) (emptyhand) (clear ?b1) (not (holding ?b1))))
)
(:action put-down
:parameters (?b - block)
Expand All @@ -29,18 +42,20 @@
(:action pick-tower
:parameters (?b1 ?b2 ?b3 - block)
:precondition (and (emptyhand) (on ?b1 ?b2) (on ?b2 ?b3))
:effect
(oneof (and) (and (holding ?b2) (clear ?b3) (not (emptyhand)) (not (on ?b2 ?b3))))
:effect (oneof
(and)
(and (holding ?b2) (clear ?b3) (not (emptyhand)) (not (on ?b2 ?b3))))
)
(:action put-tower-on-block
:parameters (?b1 ?b2 ?b3 - block)
:precondition (and (holding ?b2) (on ?b1 ?b2) (clear ?b3))
:effect (oneof (and (on ?b2 ?b3) (emptyhand) (not (holding ?b2)) (not (clear ?b3)))
(and (on-table ?b2) (emptyhand) (not (holding ?b2))))
:effect (oneof
(and (on ?b2 ?b3) (emptyhand) (not (holding ?b2)) (not (clear ?b3)))
(and (on-table ?b2) (emptyhand) (not (holding ?b2))))
)
(:action put-tower-down
:parameters (?b1 ?b2 - block)
:precondition (and (holding ?b2) (on ?b1 ?b2))
:effect (and (on-table ?b2) (emptyhand) (not (holding ?b2)))
)
)
)
42 changes: 28 additions & 14 deletions benchmarks/blocksworld-new/domain.pddl
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
;; Same as 2008 IPC-6 FOND version of blocksworld but larger: scaled 1-50
;; https://ipc08.icaps-conference.org/probabilistic/wiki/index.php/Results.html#Fully_Observable_Non-Deterministic_.28FOND.29_track
(define (domain blocks-domain)
(:requirements :non-deterministic :equality :typing)
(:types block)
(:predicates (holding ?b - block) (emptyhand) (on-table ?b - block) (on ?b1 ?b2 - block) (clear ?b - block))
(:types
block
)
(:predicates
(holding ?b - block)
(emptyhand)
(on-table ?b - block)
(on ?b1 ?b2 - block)
(clear ?b - block)
)
(:action pick-up
:parameters (?b1 ?b2 - block)
:precondition (and (not (= ?b1 ?b2)) (emptyhand) (clear ?b1) (on ?b1 ?b2))
:effect
(oneof
(and (holding ?b1) (clear ?b2) (not (emptyhand)) (not (clear ?b1)) (not (on ?b1 ?b2)))
(and (clear ?b2) (on-table ?b1) (not (on ?b1 ?b2))))
:effect (oneof
(and (holding ?b1) (clear ?b2) (not (emptyhand)) (not (clear ?b1)) (not (on ?b1 ?b2)))
(and (clear ?b2) (on-table ?b1) (not (on ?b1 ?b2))))
)
(:action pick-up-from-table
:parameters (?b - block)
:precondition (and (emptyhand) (clear ?b) (on-table ?b))
:effect (oneof (and) (and (holding ?b) (not (emptyhand)) (not (on-table ?b))))
:effect (oneof
(and)
(and (holding ?b) (not (emptyhand)) (not (on-table ?b))))
)
(:action put-on-block
:parameters (?b1 ?b2 - block)
:precondition (and (holding ?b1) (clear ?b2))
:effect (oneof (and (on ?b1 ?b2) (emptyhand) (clear ?b1) (not (holding ?b1)) (not (clear ?b2)))
(and (on-table ?b1) (emptyhand) (clear ?b1) (not (holding ?b1))))
:effect (oneof
(and (on ?b1 ?b2) (emptyhand) (clear ?b1) (not (holding ?b1)) (not (clear ?b2)))
(and (on-table ?b1) (emptyhand) (clear ?b1) (not (holding ?b1))))
)
(:action put-down
:parameters (?b - block)
Expand All @@ -29,18 +41,20 @@
(:action pick-tower
:parameters (?b1 ?b2 ?b3 - block)
:precondition (and (emptyhand) (on ?b1 ?b2) (on ?b2 ?b3))
:effect
(oneof (and) (and (holding ?b2) (clear ?b3) (not (emptyhand)) (not (on ?b2 ?b3))))
:effect (oneof
(and)
(and (holding ?b2) (clear ?b3) (not (emptyhand)) (not (on ?b2 ?b3))))
)
(:action put-tower-on-block
:parameters (?b1 ?b2 ?b3 - block)
:precondition (and (holding ?b2) (on ?b1 ?b2) (clear ?b3))
:effect (oneof (and (on ?b2 ?b3) (emptyhand) (not (holding ?b2)) (not (clear ?b3)))
(and (on-table ?b2) (emptyhand) (not (holding ?b2))))
:effect (oneof
(and (on ?b2 ?b3) (emptyhand) (not (holding ?b2)) (not (clear ?b3)))
(and (on-table ?b2) (emptyhand) (not (holding ?b2))))
)
(:action put-tower-down
:parameters (?b1 ?b2 - block)
:precondition (and (holding ?b2) (on ?b1 ?b2))
:effect (and (on-table ?b2) (emptyhand) (not (holding ?b2)))
)
)
)
58 changes: 37 additions & 21 deletions benchmarks/blocksworld/domain-fixed.pddl
Original file line number Diff line number Diff line change
@@ -1,57 +1,73 @@
(define (domain blocks-domain)

(:requirements :non-deterministic :negative-preconditions :equality :typing)

(:types block)

(:predicates (holding-one) (holding-two) (holding ?b - block) (emptyhand) (on-table ?b - block) (on ?b1 ?b2 - block) (clear ?b - block))


(:types
block
)

(:predicates
(holding-one)
(holding-two)
(holding ?b - block)
(emptyhand)
(on-table ?b - block)
(on ?b1 ?b2 - block)
(clear ?b - block)
)

(:action pick-up
:parameters (?b1 ?b2 - block)
:precondition (and (not (= ?b1 ?b2)) (emptyhand) (clear ?b1) (on ?b1 ?b2))
:effect (and (clear ?b2) (not (on ?b1 ?b2))
(oneof (and (holding-one) (holding ?b1) (not (emptyhand)) (not (clear ?b1)))
(on-table ?b1)))
(oneof
(and (holding-one) (holding ?b1) (not (emptyhand)) (not (clear ?b1)))
(on-table ?b1)))
)

(:action pick-up-from-table
:parameters (?b - block)
:precondition (and (emptyhand) (clear ?b) (on-table ?b))
:effect (oneof (and) (and (holding-one) (holding ?b) (not (emptyhand)) (not (on-table ?b)) (not (clear ?b))))
:effect (oneof
(and)
(and (holding-one) (holding ?b) (not (emptyhand)) (not (on-table ?b)) (not (clear ?b))))
)

(:action put-on-block
:parameters (?b1 ?b2 - block)
:precondition (and (not (= ?b1 ?b2)) (holding-one) (holding ?b1) (clear ?b2))
:effect (and (emptyhand) (clear ?b1) (not (holding-one)) (not (holding ?b1))
(oneof (and (on ?b1 ?b2) (not (clear ?b2)))
(on-table ?b1)))
(oneof
(and (on ?b1 ?b2) (not (clear ?b2)))
(on-table ?b1)))
)

(:action put-down
:parameters (?b - block)
:precondition (and (holding-one) (holding ?b))
:effect (and (on-table ?b) (emptyhand) (clear ?b) (not (holding-one)) (not (holding ?b)))
)

(:action pick-tower
:parameters (?b1 ?b2 ?b3 - block)
:precondition (and (emptyhand) (on ?b1 ?b2) (on ?b2 ?b3) (clear ?b1))
:effect
(oneof (and) (and (holding-two) (holding ?b2) (clear ?b3) (not (emptyhand)) (not (on ?b2 ?b3)) (not (clear ?b1))))
:effect (oneof
(and)
(and (holding-two) (holding ?b2) (clear ?b3) (not (emptyhand)) (not (on ?b2 ?b3)) (not (clear ?b1))))
)

(:action put-tower-on-block
:parameters (?b1 ?b2 ?b3 - block)
:precondition (and (holding-two) (holding ?b2) (on ?b1 ?b2) (clear ?b3))
:effect (and (emptyhand) (not (holding-two)) (not (holding ?b2)) (clear ?b1)
(oneof (and (on ?b2 ?b3) (not (clear ?b3)))
(and (on-table ?b1) (on-table ?b2) (clear ?b2) (not (on ?b1 ?b2)))))
(oneof
(and (on ?b2 ?b3) (not (clear ?b3)))
(and (on-table ?b1) (on-table ?b2) (clear ?b2) (not (on ?b1 ?b2)))))
)

(:action put-tower-down
:parameters (?b1 ?b2 - block)
:precondition (and (holding-two) (holding ?b2) (on ?b1 ?b2))
:effect (and (on-table ?b2) (emptyhand) (not (holding-two)) (not (holding ?b2)) (clear ?b1))
)
)
)
43 changes: 29 additions & 14 deletions benchmarks/blocksworld/domain.pddl
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
;; FOND version of Blocksworld from FOND track in 2008 IPC-6
;; Basically, it is the same domain as the one in the probabilistic track but with (oneof) instead of probabilities
;; https://ipc08.icaps-conference.org/probabilistic/wiki/index.php/Results.html#Fully_Observable_Non-Deterministic_.28FOND.29_track
(define (domain blocks-domain)
(:requirements :non-deterministic :equality :typing)
(:types block)
(:predicates (holding ?b - block) (emptyhand) (on-table ?b - block) (on ?b1 ?b2 - block) (clear ?b - block))
(:types
block
)
(:predicates
(holding ?b - block)
(emptyhand)
(on-table ?b - block)
(on ?b1 ?b2 - block)
(clear ?b - block)
)
(:action pick-up
:parameters (?b1 ?b2 - block)
:precondition (and (not (= ?b1 ?b2)) (emptyhand) (clear ?b1) (on ?b1 ?b2))
:effect
(oneof
(and (holding ?b1) (clear ?b2) (not (emptyhand)) (not (clear ?b1)) (not (on ?b1 ?b2)))
(and (clear ?b2) (on-table ?b1) (not (on ?b1 ?b2))))
:effect (oneof
(and (holding ?b1) (clear ?b2) (not (emptyhand)) (not (clear ?b1)) (not (on ?b1 ?b2)))
(and (clear ?b2) (on-table ?b1) (not (on ?b1 ?b2))))
)
(:action pick-up-from-table
:parameters (?b - block)
:precondition (and (emptyhand) (clear ?b) (on-table ?b))
:effect (oneof (and) (and (holding ?b) (not (emptyhand)) (not (on-table ?b))))
:effect (oneof
(and)
(and (holding ?b) (not (emptyhand)) (not (on-table ?b))))
)
(:action put-on-block
:parameters (?b1 ?b2 - block)
:precondition (and (holding ?b1) (clear ?b2))
:effect (oneof (and (on ?b1 ?b2) (emptyhand) (clear ?b1) (not (holding ?b1)) (not (clear ?b2)))
(and (on-table ?b1) (emptyhand) (clear ?b1) (not (holding ?b1))))
:effect (oneof
(and (on ?b1 ?b2) (emptyhand) (clear ?b1) (not (holding ?b1)) (not (clear ?b2)))
(and (on-table ?b1) (emptyhand) (clear ?b1) (not (holding ?b1))))
)
(:action put-down
:parameters (?b - block)
Expand All @@ -29,18 +42,20 @@
(:action pick-tower
:parameters (?b1 ?b2 ?b3 - block)
:precondition (and (emptyhand) (on ?b1 ?b2) (on ?b2 ?b3))
:effect
(oneof (and) (and (holding ?b2) (clear ?b3) (not (emptyhand)) (not (on ?b2 ?b3))))
:effect (oneof
(and)
(and (holding ?b2) (clear ?b3) (not (emptyhand)) (not (on ?b2 ?b3))))
)
(:action put-tower-on-block
:parameters (?b1 ?b2 ?b3 - block)
:precondition (and (holding ?b2) (on ?b1 ?b2) (clear ?b3))
:effect (oneof (and (on ?b2 ?b3) (emptyhand) (not (holding ?b2)) (not (clear ?b3)))
(and (on-table ?b2) (emptyhand) (not (holding ?b2))))
:effect (oneof
(and (on ?b2 ?b3) (emptyhand) (not (holding ?b2)) (not (clear ?b3)))
(and (on-table ?b2) (emptyhand) (not (holding ?b2))))
)
(:action put-tower-down
:parameters (?b1 ?b2 - block)
:precondition (and (holding ?b2) (on ?b1 ?b2))
:effect (and (on-table ?b2) (emptyhand) (not (holding ?b2)))
)
)
)

0 comments on commit 9740d01

Please sign in to comment.