1

这个问题建立在前面关于 forall 子句的问题的基础上。我想用一个'when'语句来限制forall,如下所示:

(:durative-action finish
  :parameters (?r - robot ?p - part)
  :duration ( = ?duration 1)
  :condition (and
      (at start (robot_free ?r))
      (at start (forall (?f - fastener_loc)
                    when (part_fastener ?p ?f)
                     (loc_not_fastened ?f)
                )
      )
     )
  :effect (and
      (at start(not (robot_free ?r)))
      (at end (part_free ?p))
      (at end (robot_free ?r))
     )
)

这在没有“when”语句的情况下有效。当我包含“when”语句时,我收到几个错误:

Error: Syntax error in durative-action declaration.
Error: Unreadable structure
Error: Syntax error in domain

提前感谢您的帮助。

4

2 回答 2

1

我能够使用暗示语句来实现这一点。

(:durative-action finish
  :parameters (?r - robot ?p - part)
  :duration ( = ?duration 1)
  :condition (and
      (at start (robot_free ?r))
      (at start (forall (?f - fastener_loc)
                    (imply (part_fastener ?p ?f)(loc_not_fastened ?f))
                )
      )
     )
  :effect (and
      (at start(not (robot_free ?r)))
      (at end (part_free ?p))
      (at end (robot_free ?r))
     )
)

不确定这是否也适用于when语法。

于 2020-07-20T20:51:37.300 回答
0

when子句需要用(括号)包裹

于 2020-07-20T20:41:49.700 回答