Search code examples
planningpddl

How to debug a PDDL domain/problem if the planner is timing out?


I am trying to write a simple PDDL domain and problem, but the planner on planning.domains returns this error:

{
  "killed": false,
  "code": 124,
  "signal": null,
  "cmd": "timeout 5 python /app/process_solution.py /tmp/solver_planning_domains_tmp_4myYaB2oSdNQC/domain.pddl /tmp/solver_planning_domains_tmp_4myYaB2oSdNQC/problem.pddl /tmp/solver_planning_domains_tmp_4myYaB2oSdNQC/plan /tmp/solver_planning_domains_tmp_4myYaB2oSdNQC/log"
}

How does one go about debugging this? The error messages were more helpful when my syntax was incorrect. I have tried visualizing the object hierarchy and the problem definition, but could not find the issue. Torchlight does not work with ADL, and other analysis tools seem to require a plan. Are there tools I am missing that I should be using?

For the record, these are my domain and problem definitions (based on the AIPS-1998 assembly and IPC 2011 grippers domains/problems):

(define (domain assembly-simple)
   (:requirements :adl)
   (:types assembly - object
           robot - robot)   
   (:predicates (available ?x - object)
        (complete ?a - assembly)
        (incorporated ?part ?whole - assembly)
        (part-of ?part ?whole - assembly)
        (assemble-order ?part1 ?part2 ?whole - assembly)
        (robot-carries-an-object ?r - robot)
        (robot-carries-this-object ?r - robot ?o - object))

    (:action pick
      :parameters (?robot - robot ?part - object)
      :precondition (and (available ?part)
                         (not (robot-carries-an-object ?robot)))
      :effect (and (robot-carries-an-object ?robot)
                   (robot-carries-this-object ?robot ?part)
                   (not (available ?part))))
    
    (:action assemble
      :parameters (?robot - robot ?part ?whole - assembly)
      :precondition (and  (robot-carries-this-object ?robot ?part)
                          (part-of ?part ?whole)
                          (forall (?prev - assembly)
                                  (imply (assemble-order ?prev ?part ?whole)
                                         (incorporated ?prev ?whole))))
      :effect (and 
                  (not (robot-carries-this-object ?robot ?part))
                  (not (robot-carries-an-object ?robot))
                  (incorporated ?part ?whole)
                  (not (available ?part))
                  (when (not (exists (?p - assembly)
                                     (and (part-of ?p ?whole)
                                          (not (= ?p ?part))
                                          (not (incorporated ?p ?whole)))))
                        (and (complete ?whole)
                             (available ?whole)))))
)

Problem:

(define (problem simple-prob)
   (:domain assembly-simple)
   (:objects base-plate motor-plate sub-assembly - assembly
             bot - robot)
   (:init (not (robot-carries-an-object bot))
          (available base-plate)
          (available motor-plate)
          (available sub-assembly)
          (part-of base-plate sub-assembly)
          (part-of motor-plate sub-assembly)
          (assemble-order base-plate motor-plate sub-assembly))
          
   (:goal (complete sub-assembly)))

Thanks in advance for any pointers.


Solution

  • The error that's occurring here is actually due to the post-processing of the solution, rather than the planner itself. Better error handling is required for that step (I just created the issue here), but unfortunately I won't have time to work on this for a little while.

    If I had to guess, my suspicion is on the complexity of the action effects not being handled by the post-processing. The entire online solving infrastructure is being overhauled in the coming weeks/months, and so hopefully this issue will be resolved as part of that.

    If you would like to test things in a different manner, then I would suggest considering the Docker dedicated to planning tools: https://hub.docker.com/r/aiplanning/planutils

    There, you should be able to run downward or lama and directly get access to the planners.