(define (domain cellar-1-domain)
 (:requirements :strips :typing :durative-actions :hierarchy :method-preconditions)
 (:types match fuse)
 (:predicates 
             (unused ?m - match)
             (light ?m - match)
             (mended ?f - fuse)
             (handfree)
 )
 (:functions 
             (burns ?m - match)
 )
 (:task fix
  :parameters ( ?f - fuse))
 (:method m-fix
  :parameters ( ?f - fuse ?m - match)
  :task (fix ?f)
  :precondition (and (unused ?m))
  :subtasks (and
    (_t306 (light-match ?m))
    (_t307 (mend ?f ?m)))
  :ordering (and
    ))
 (:durative-action light-match
  :parameters ( ?m - match)
  :duration (= ?duration (burns ?m))
  :condition (and 
                 (at start (unused ?m))
             )
  :effect (and
              (at start (not (unused ?m)))
              (at start (light ?m))
              (at end (not (light ?m)))
          )
 )
 (:durative-action mend
  :parameters ( ?f - fuse ?m - match)
  :duration (= ?duration 5)
  :condition (and 
                 (at start (handfree))
                 (at start (light ?m))
                 (over all (light ?m))
             )
  :effect (and
              (at start (not (handfree)))
              (at end (handfree))
              (at end (mended ?f))
          )
 )
)

;;;;
(define (problem cellar-1-problem)
 (:domain cellar-1-domain)
 (:objects
   match0 match1 - match
   fuse0 - fuse
 )
 (:htn
  :ordered-subtasks (and
    (_t308 (fix fuse0))))
 (:init
              (= (burns match0) 7)
              (= (burns match1) 6)
              (unused match0)
              (unused match1)
              (handfree)
 )
 (:goal (and 
           (mended fuse0)
        )
 )
)
