PDDL: Failed to parse the problem -- invalid syntax (, line 36)

144 Views Asked by At

Please help. I cannot find what is wrong with line 36, and I am unable to generate an AI plan. Oneof is also not being recognised.I am getting this error:Failed to parse the problem -- invalid syntax (, line 36)

/app/plan: line 3: 4475 Segmentation fault timeout 10 "$(dirname "$0")"/siw-then-bfsf --domain $1 --problem $2 --output $3 domain.pddl file:

 (define (domain cancer_diagnostics)
    (:requirements :strips :typing)
    (:constants
        left_lung_lower_lope left_lung_upper_lope right_lung_upper_lope right_lung_middle_lope right_lung_lower_lope - is_lung_region
        stage1 stage2 stage3 stage4 - valid_stage
    )
    (:predicates
        (has_long_standing_cough ?x)
        (lost_weight ?x)
        (is_old ?x)
        (exposure_to_dust ?x)
        (is_smoker ?x)
        (had_cancer ?x)
        (relative ?x, ?y)
        (person ?x)
        (patient ?x)
        (is_lung_region ?r)
        (valid_stage ?s)
        (cancer_suspicion ?x)
        (negative_diagnosis ?x)
        (positive_diagnosis ?x)
        (cancer-location_in_the_lung ?x ?r)
        (cancer_stage ?x ?s)
        (types_of_lung_cancer ?x)
        (inconclusive ?x)
    )
    (:action clinical_test
        :parameters (?x)
        :precondition (and (patient ?x) (has_long_standing_cough ?x) (lost_weight ?x)
            (is_old ?x) (is_smoker ?x) (exposure_to_dust ?x)
             (exists (?y)
                (and (person ?y)
                    (relative ?x ?y)
                    (had_cancer ?y))))
        :effect (cancer_suspicion ?x)
   ) 
    (:action x-ray_test 
        :parameters (?x)
        :precondition (and (patient ?x)
            (cancer_suspicion ?x)
        )
        :effect (oneof(
                (positive_diagnosis ?x) 
                (negative_diagnosis ?x)
                (inconclusive ?x)

                ))

        )
        
        
    
    (:action imaging_modality
        :parameters (?x)
        :precondition (and 
            (inconclusive ?x)
            (cancer_suspicion ?x)
        )
        :effect (oneof
                    (positive_diagnosis ?x)
                    (negative_diagnosis ?x)
                
            
        )
    )
    (:action staging_test ;conclusivy diagnosis action-imaging modality  
        :parameters (?x ,?s, ?r)
        :precondition (and
            (patient ?x) ;lung part
            (positive_diagnosis ?x)
              (exists
                (?r)
                (is_lung_region ?r))
              (exists
                (?s)
                (valid_stage ?s))
          )
           ;(and(valid_stage ?s))))
            :effect (and
                (cancer-location_in_the_lung ?x ?r)
                (cancer_stage ?x ?s)
            ))
    (:action biopsy_test
            :parameters (?x , ?s, ?r)
            :precondition (and (patient ?x)
                  (exists
                (?r)
                (is_lung_region ?r))
            (exists
                (?s)
                (valid_stage ?s))
          
                (cancer-location_in_the_lung ?x ?r)
                (cancer_stage ?x ?s)

            )
            :effect 
                (types_of_lung_cancer ?x)
            
        )
    )
        

problem.pddl

(define (problem lung_cancer_diagnostics)
    (:domain cancer_diagnostics)
    (:objects
        p 
    )
    (:init
        (patient p)
        (has_long_standing_cough p)
      

    )
    (:goal
        
        (cancer_suspicion p)
       
        
        
    )

)
1

There are 1 best solutions below

0
haz On

oneof is syntax used for non-deterministic planning. The online solver (siw-then-bfsf by the looks of it) is a classical planner and cannot handle such expressiveness. You can use planutils and perhaps try solving with prp.