【问题标题】:How to solve "Undeclared predicate: <" error in pddl domain file?如何解决 pddl 域文件中的“未声明的谓词:<”错误?
【发布时间】:2019-11-08 05:37:09
【问题描述】:

我正在尝试使用 Fast Downward Planner 解决一个简单的 pddl 问题。每当我使用&gt;&lt;&gt;=decrease等数字表达式时,都会出现以下错误:

Undeclared predicate: < 

问题文件:

(define (problem prob-gift)
  (:domain gift)
  (:objects
   chocolate hairband hairclip gift

  )
  (:init

     (=(amount_c chocolate)5)
     (=(amount_hb hairband)5)
     (=(amount_hr hairclip)5)

     (=(made gift)0)


  )
  (:goal
    (and
    (=(made gift)5)
    )
  )
)

域文件:

(define (domain gift) 

(:types chocolate hairband hairclip gift )

(:predicates      
  )
(:functions
   (made ?x ) 
         (amount_hb ?y ) 
         (amount_hr ?z ) 
         (amount_c ?a ) 

)



(:action make
     :parameters (?x ?y  ?z ?a)
     :precondition (and 
     (<(made ?x)5)
         (>=(amount_hb ?y)1)
         (>=(amount_hr ?z)1)
         (>=(amount_c ?a)1)


     )
     :effect (and
          (increase(made ?x)1)
                  (decrease(amount_hb ?y)1)
                  (decrease(amount_hr ?z)1)
                  (decrease(amount_c ?a)1)

           ))

)

输出:

Parsing...
Undeclared predicate: <

translate exit code: 30

Driver aborting after translate

【问题讨论】:

    标签: pddl


    【解决方案1】:

    不幸的是,我在 https://gitlab.com/graphs4IB/ai-planning 容器化的 popf 版本不是那么精通 ADL 并且与典型的卡住了

    Constructing lookup tables:
    Post filtering unreachable actions: 
    A problem has been encountered, and the planner has to terminate.
    -----------------------------------------------------------------
    Unfortunately, at present, the planner does not fully support ADL
    unless in the rules for derived predicates.  Only two aspects of
    ADL can be used in action definitions:
    - forall conditions, containing a simple conjunct of propositional and
      numeric facts;
    - Conditional (when... ) effects, and then only with numeric conditions
      and numeric consequences on values which do not appear in the
      preconditions of actions.
    
    To use this planner with your problem, you will have to reformulate it to
    avoid ADL.  Alternatively, if you have a particularly compelling case
    for them, please contact the authors to discuss it with them, who may be able to
    extend the planner to meet your needs.
    

    我从https://github.com/LCAS/popf.git 获得此版本的 popf,而不是在 Sourceforge 上发布的版本存在显着的代码差异。

    您可以在Jan's session 上通过设置此自定义规划器网址快速测试:https://young-spire-39208.herokuapp.com

    或者,您也可以在本地运行 Docker 映像,假设您的 domain.pddlproblem.pddl 在当前目录中:

    docker run --rm -v $PWD:/tmp registry.gitlab.com/graphs4ib/ai-planning:latest popf /tmp/domain.pddl /tmp/problem.pddl
    

    它的作用是在 Debian Stretch Docker 容器中编译 popf。如果你手边有 Debian 9 (Stretch) 或 10 (Buster) 环境,你可以手动编译 popf:

    sudo apt-get -qy install git g++ cmake coinor-libcbc-dev coinor-libcgl-dev coinor-libclp-dev coinor-libcoinutils-dev bison flex \
    && git clone https://github.com/LCAS/popf.git \
    && cd popf \
    && mkdir build \
    && cd build \
    && cmake ../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=TRUE \
    && make -j \
    && make install
    

    【讨论】:

    • 我无法运行 POPF 规划器。我按照“github.com/LCAS/popf”中的说明进行操作,但没有名为“./buildscript”或“make”的文件
    • 你需要 cmake 来构建它。已知这适用于 Debian Stretch:``` apt-get -qy install git g++ cmake coinor-libcbc-dev coinor-libcgl-dev coinor-libclp-dev coinor-libcoinutils-dev bison flex \ && git clone github.com/LCAS/popf.git \ && cd popf \ && mkdir build \ && cd build \ && cmake ../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=TRUE \ && make -j \ && make install ```(刚刚在 debian:stretch Docker 容器中测试过:-))
    【解决方案2】:

    Jonaki,我认为在您的 PDDL 模型中使用类型存在问题。此外,一般来说,当您选择的规划器不接受您的模型(或无法解决您的问题)时,您应该削减它并从最简单的版本重新构建它,同时针对规划器不断测试它。这样,您将确切地看到是什么冒犯了它。有时打印的信息不具有代表性。

    您正在使用 numeric fluents,因此您应该将(:requirements :fluents) 包含在您的domain 中。不支持:fluents 的规划器会阻塞&lt;=decrease 操作。

    顺便说一句:您不需要在此模型中使用类型。您将您的函数声明为接地到各种礼物对象。因此,您可以删除类型并查看模型是否有效。此处提供了已删除类型的该模型的版本: http://editor.planning.domains/#read_session=jugsVFKksh 您可以通过单击解决 > 计划 按钮对其进行测试。规划器因分段错误而失败。它不提供任何特定错误。 但是,我尝试使用 POPF 规划器解决它并且它有效。如您在此屏幕截图中所见。

    我没有方便的Fast-downward,但我认为它是http://solver.planning.domains/solve 服务背后的引擎,尽管您的错误消息与我看到的不对应。您使用的是最新版本的 Fast-downward 吗?

    此外,如果您可以描述您要建模的内容,也许我们可以帮助您找到适合模式的方法来在 PDDL 中对其进行建模。

    【讨论】:

    • 感谢您的帮助..是的,Fast Downward Planner 不支持 :fluents,这就是为什么它给了我这个错误...你能建议我一个同时支持 :adl 和 :流利?
    • 我需要一个支持 :adl :fluents 并考虑行动成本最小化的规划器。
    • 感谢我的朋友 Guillaume,这是一个展示如何自动构建 POPF 的 Dockerfile:gitlab.com/graphs4IB/ai-planning/blob/master/cloud-solver/…
    猜你喜欢
    • 2017-09-11
    • 2021-12-26
    • 1970-01-01
    • 1970-01-01
    • 2015-03-26
    • 2020-07-30
    • 2022-01-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多