You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在PDDL持续动作中使用条件效果遭遇语法错误求助

解决PDDL持续动作中when语句的语法错误

错误原因

在PDDL 2.1的持续动作定义中,条件效果(when)的语法要求时间模态(如at end)包裹整个条件效果结构,你当前的写法将at end放在了when的生效分支内部,违反了语法规范,导致解析报错。

修正后的代码

(:durative-action move-robot
    :parameters (?r - robot ?l1 - location ?l2 - location ?ca - carrier)
    :duration (= ?duration 25)
    :condition (at start
            (and
                (not (= ?l2 central_warehouse))
                (located-robot ?r ?l1)
                (connected ?l1 ?l2)
                (has-carrier ?r ?ca)
            )
    )
    :effect (and
        (at end
            (and
                (located-robot ?r ?l2)
                (not (located-robot ?r ?l1))
                (forall (?b - box)
                    (when (carrier-has ?ca ?b)
                        (and
                            (located-box ?b ?l2)
                            (not (located-box ?b ?l1))
                        )
                    )
                )
            )
        )
    )
)

说明

  • 将包含forall和when的条件效果逻辑移至at end的and结构内部,确保时间模态覆盖整个效果逻辑。
  • 此时解析器会在动作结束时,对每个满足carrier-has ?ca ?b的箱子执行位置变更效果,符合场景需求。
  • 若需要在动作开始时检查箱子是否被携带,可将when的条件改为(at start (carrier-has ?ca ?b)),按需调整即可。

内容的提问来源于stack exchange,提问作者Pietro02

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 05:26:01