PDDL - 无效谓词和 forall 的正确用法
PDDL - invalid predicates and correct usage of forall
我是 pddl 规划的新手,现在我正在尝试创建域和问题文件作为练习。
简短的领域描述:我有几辆汽车,可以在 A 和 B 的地方取放。任务很简单:把所有的汽车从 A 的地方拿走,然后把它们移到 B 的地方。
我创建了以下域文件:
(define (domain test) ; Domain name must match problem's
; Define what the planner must support to execute this domain
; Only domain requirements are currently supported
( :requirements
:strips
:negative-preconditions
:equality
:typing
:adl
)
(:types
car
place
)
(:predicates
(at ?o - car ?p - place )
(taken ?o - car )
)
(:action take
:parameters (?o1 - car ?o2 - place )
:precondition (and
(at ?o1 ?o2)
(not (taken ?o1))
)
:effect (and
(not (at ?o1 ?o2 ))
(taken ?o1)
)
)
(:action put
:parameters (?o1 - car ?o2 - place )
:precondition (and
(not (at ?o1 ?o2))
(taken ?o1)
)
:effect (and
(at ?o1 ?o2)
(not (taken ?o1) )
)
)
(:action takeAll
:parameters ()
:precondition (forall (?c - car ?p - place)
(and
(at ?c ?p)
(not (taken ?c))
)
)
:effect (forall (?c - car)
(taken ?c)
)
)
)
问题文件如下所示:
(define (problem test)
(:domain test)
(:objects
c1 - car
c2 - car
c3 - car
A - place
B - place
)
(:init
(at c1 A)
(at c2 A)
(at c3 A)
(not (taken c1))
(not (taken c2))
(not (taken c3))
)
(:goal (and
(at c1 B)
(at c2 B)
(at c3 B)
)
)
)
我正在使用可用的在线规划器和求解器here
我想知道为什么它输出我有几个无效谓词
test
takeall precondition contains ["forall", ["?c", "-", "car", "?p", "-", "place"], ["and", ["at", "?c", "?p"], ["not", ["taken", "?c"]]]], not a valid predicate
takeall effect contains ["forall", ["?c", "-", "car"], ["taken", "?c"]], not a valid predicate
:equality requirement is unnecessary
test
Initial state contains ["not", ["taken", "c1"]], not a valid predicate
Initial state contains ["not", ["taken", "c2"]], not a valid predicate
Initial state contains ["not", ["taken", "c3"]], not a valid predicate
有人可以向我解释一下我做错了什么吗?
对于 takeAll
操作,我想用 forall
进行一些试验。并且应该这样解释:前提条件是说car类型的所有对象都不是处于一个状态,而是在某个地方。
效果应该是所有的车都处于taken的状态。
最短的解决方案应该是(按我的常识)takeAll, put(c1, B), (put c2, B), (put c3, B)
感谢您的帮助!
您正在进行经典规划,这意味着初始状态只需要指定什么是真的(其他一切都假定为假)。从你的 init 中删除那些负面的流利,它可能会成功。
我是 pddl 规划的新手,现在我正在尝试创建域和问题文件作为练习。 简短的领域描述:我有几辆汽车,可以在 A 和 B 的地方取放。任务很简单:把所有的汽车从 A 的地方拿走,然后把它们移到 B 的地方。 我创建了以下域文件:
(define (domain test) ; Domain name must match problem's
; Define what the planner must support to execute this domain
; Only domain requirements are currently supported
( :requirements
:strips
:negative-preconditions
:equality
:typing
:adl
)
(:types
car
place
)
(:predicates
(at ?o - car ?p - place )
(taken ?o - car )
)
(:action take
:parameters (?o1 - car ?o2 - place )
:precondition (and
(at ?o1 ?o2)
(not (taken ?o1))
)
:effect (and
(not (at ?o1 ?o2 ))
(taken ?o1)
)
)
(:action put
:parameters (?o1 - car ?o2 - place )
:precondition (and
(not (at ?o1 ?o2))
(taken ?o1)
)
:effect (and
(at ?o1 ?o2)
(not (taken ?o1) )
)
)
(:action takeAll
:parameters ()
:precondition (forall (?c - car ?p - place)
(and
(at ?c ?p)
(not (taken ?c))
)
)
:effect (forall (?c - car)
(taken ?c)
)
)
)
问题文件如下所示:
(define (problem test)
(:domain test)
(:objects
c1 - car
c2 - car
c3 - car
A - place
B - place
)
(:init
(at c1 A)
(at c2 A)
(at c3 A)
(not (taken c1))
(not (taken c2))
(not (taken c3))
)
(:goal (and
(at c1 B)
(at c2 B)
(at c3 B)
)
)
)
我正在使用可用的在线规划器和求解器here 我想知道为什么它输出我有几个无效谓词
test
takeall precondition contains ["forall", ["?c", "-", "car", "?p", "-", "place"], ["and", ["at", "?c", "?p"], ["not", ["taken", "?c"]]]], not a valid predicate
takeall effect contains ["forall", ["?c", "-", "car"], ["taken", "?c"]], not a valid predicate
:equality requirement is unnecessary
test
Initial state contains ["not", ["taken", "c1"]], not a valid predicate
Initial state contains ["not", ["taken", "c2"]], not a valid predicate
Initial state contains ["not", ["taken", "c3"]], not a valid predicate
有人可以向我解释一下我做错了什么吗?
对于 takeAll
操作,我想用 forall
进行一些试验。并且应该这样解释:前提条件是说car类型的所有对象都不是处于一个状态,而是在某个地方。
效果应该是所有的车都处于taken的状态。
最短的解决方案应该是(按我的常识)takeAll, put(c1, B), (put c2, B), (put c3, B)
感谢您的帮助!
您正在进行经典规划,这意味着初始状态只需要指定什么是真的(其他一切都假定为假)。从你的 init 中删除那些负面的流利,它可能会成功。