Skip to content

Commit

Permalink
towards #1
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Aug 18, 2018
1 parent e1620d4 commit b0fe99a
Show file tree
Hide file tree
Showing 7 changed files with 338 additions and 0 deletions.
Binary file added docs/images/arm-cupcake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions test/driverlog/domain.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
; Taken from http://picat-lang.org/aips02/driverlog.pddl

(define (domain driverlog)
(:requirements :typing)
(:types location locatable - object
driver truck obj - locatable

)
(:predicates
(at ?obj - locatable ?loc - location)
(in ?obj1 - obj ?obj - truck)
(driving ?d - driver ?v - truck)
(link ?x ?y - location) (path ?x ?y - location)
(empty ?v - truck)
)


(:action LOAD-TRUCK
:parameters
(?obj - obj
?truck - truck
?loc - location)
:precondition
(and (at ?truck ?loc) (at ?obj ?loc))
:effect
(and (not (at ?obj ?loc)) (in ?obj ?truck)))

(:action UNLOAD-TRUCK
:parameters
(?obj - obj
?truck - truck
?loc - location)
:precondition
(and (at ?truck ?loc) (in ?obj ?truck))
:effect
(and (not (in ?obj ?truck)) (at ?obj ?loc)))

(:action BOARD-TRUCK
:parameters
(?driver - driver
?truck - truck
?loc - location)
:precondition
(and (at ?truck ?loc) (at ?driver ?loc) (empty ?truck))
:effect
(and (not (at ?driver ?loc)) (driving ?driver ?truck) (not (empty ?truck))))

(:action DISEMBARK-TRUCK
:parameters
(?driver - driver
?truck - truck
?loc - location)
:precondition
(and (at ?truck ?loc) (driving ?driver ?truck))
:effect
(and (not (driving ?driver ?truck)) (at ?driver ?loc) (empty ?truck)))

(:action DRIVE-TRUCK
:parameters
(?truck - truck
?loc-from - location
?loc-to - location
?driver - driver)
:precondition
(and (at ?truck ?loc-from)
(driving ?driver ?truck) (link ?loc-from ?loc-to))
:effect
(and (not (at ?truck ?loc-from)) (at ?truck ?loc-to)))

(:action WALK
:parameters
(?driver - driver
?loc-from - location
?loc-to - location)
:precondition
(and (at ?driver ?loc-from) (path ?loc-from ?loc-to))
:effect
(and (not (at ?driver ?loc-from)) (at ?driver ?loc-to)))


)
48 changes: 48 additions & 0 deletions test/driverlog/pfile01
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
(define (problem DLOG-2-2-2)
(:domain driverlog)
(:objects
driver1 - driver
driver2 - driver
truck1 - truck
truck2 - truck
package1 - obj
package2 - obj
s0 - location
s1 - location
s2 - location
p1-0 - location
p1-2 - location
)
(:init
(at driver1 s2)
(at driver2 s2)
(at truck1 s0)
(empty truck1)
(at truck2 s0)
(empty truck2)
(at package1 s0)
(at package2 s0)
(path s1 p1-0)
(path p1-0 s1)
(path s0 p1-0)
(path p1-0 s0)
(path s1 p1-2)
(path p1-2 s1)
(path s2 p1-2)
(path p1-2 s2)
(link s0 s1)
(link s1 s0)
(link s0 s2)
(link s2 s0)
(link s2 s1)
(link s1 s2)
)
(:goal (and
(at driver1 s1)
(at truck1 s1)
(at package1 s0)
(at package2 s0)
))


)
59 changes: 59 additions & 0 deletions test/driverlog/pfile02
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
(define (problem DLOG-2-2-3)
(:domain driverlog)
(:objects
driver1 - driver
driver2 - driver
truck1 - truck
truck2 - truck
package1 - obj
package2 - obj
package3 - obj
s0 - location
s1 - location
s2 - location
p0-1 - location
p0-2 - location
p1-0 - location
p2-1 - location
)
(:init
(at driver1 s0)
(at driver2 s0)
(at truck1 s0)
(empty truck1)
(at truck2 s1)
(empty truck2)
(at package1 s2)
(at package2 s1)
(at package3 s1)
(path s0 p0-1)
(path p0-1 s0)
(path s1 p0-1)
(path p0-1 s1)
(path s0 p0-2)
(path p0-2 s0)
(path s2 p0-2)
(path p0-2 s2)
(path s2 p2-1)
(path p2-1 s2)
(path s1 p2-1)
(path p2-1 s1)
(link s0 s2)
(link s2 s0)
(link s1 s0)
(link s0 s1)
(link s1 s2)
(link s2 s1)
)
(:goal (and
(at driver1 s1)
(at driver2 s1)
(at truck1 s2)
(at truck2 s0)
(at package1 s0)
(at package2 s2)
(at package3 s0)
))


)
59 changes: 59 additions & 0 deletions test/driverlog/pfile03
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
(define (problem DLOG-2-2-4)
(:domain driverlog)
(:objects
driver1 - driver
driver2 - driver
truck1 - truck
truck2 - truck
package1 - obj
package2 - obj
package3 - obj
package4 - obj
s0 - location
s1 - location
s2 - location
p0-1 - location
p2-0 - location
p2-1 - location
)
(:init
(at driver1 s1)
(at driver2 s0)
(at truck1 s1)
(empty truck1)
(at truck2 s2)
(empty truck2)
(at package1 s0)
(at package2 s0)
(at package3 s1)
(at package4 s1)
(path s0 p0-1)
(path p0-1 s0)
(path s1 p0-1)
(path p0-1 s1)
(path s2 p2-0)
(path p2-0 s2)
(path s0 p2-0)
(path p2-0 s0)
(path s2 p2-1)
(path p2-1 s2)
(path s1 p2-1)
(path p2-1 s1)
(link s1 s0)
(link s0 s1)
(link s1 s2)
(link s2 s1)
(link s2 s0)
(link s0 s2)
)
(:goal (and
(at driver2 s2)
(at truck1 s1)
(at truck2 s2)
(at package1 s1)
(at package2 s1)
(at package3 s2)
))


)
72 changes: 72 additions & 0 deletions test/letseat/domain.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
(define (domain letseat)

(:requirements :typing)

(:types
location locatable - object
bot cupcake - locatable
robot - bot
)

(:predicates
(on ?obj - locatable ?loc - location)
(holding ?arm - locatable ?cupcake - locatable)
(arm-empty)
(path ?location1 - location ?location2 - location)
)


(:action pick-up
:parameters
(?arm - bot
?cupcake - locatable
?loc - location)
:precondition
(and
(on ?arm ?loc)
(on ?cupcake ?loc)
(arm-empty)
)
:effect
(and
(not (on ?cupcake ?loc))
(holding ?arm ?cupcake)
(not (arm-empty))
)
)

(:action drop
:parameters
(?arm - bot
?cupcake - locatable
?loc - location)
:precondition
(and
(on ?arm ?loc)
(holding ?arm ?cupcake)
)
:effect
(and
(on ?cupcake ?loc)
(arm-empty)
(not (holding ?arm ?cupcake))
)
)

(:action move
:parameters
(?arm - bot
?from - location
?to - location)
:precondition
(and
(on ?arm ?from)
(path ?from ?to)
)
:effect
(and
(not (on ?arm ?from))
(on ?arm ?to)
)
)
)
19 changes: 19 additions & 0 deletions test/letseat/pfile.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(define (problem letseat-simple)
(:domain letseat)
(:objects
arm - robot
cupcake - cupcake
table - location
plate - location
)

(:init
(on arm table)
(on cupcake table)
(arm-empty)
(path table plate)
)
(:goal
(on cupcake plate)
)
)

0 comments on commit b0fe99a

Please sign in to comment.