 (defn make-expanded-task
   "Make an expanded task"
   [original-task & [argument-mapping]]
-  (println "MET" original-task "args:" (pr-str argument-mapping)) ;; DEBUG
+  (dbg-println :debug "MET" original-task "args:" (pr-str argument-mapping)) ;; DEBUG
   (let [task-type (:type original-task)
         skeleton-task (dissoc original-task :uid :label)
         task (if (= task-type :htn-primitive-task)

(defn arg-mappings-for-task-and-method [task method]
  (let [static-task-args (get-in method [:nonprimitive-task :arguments])
        dynamic-task-args (:arguments task)]
    (println "AMFTAM" (:uid method) "name" (:name method))
    (println "STATIC-TASK-ARGS" (pr-str static-task-args)) ;; DEBUG
    (println "DYNAMIC-TASK-ARGS" (pr-str dynamic-task-args)) ;; DEBUG
    (if (or (not (vector? static-task-args))
            (not (vector? dynamic-task-args))
            (not= (count static-task-args) (count dynamic-task-args)))


;; create htn-methods as a side effect)
(defn make-htn-methods "Construct the HTN Method(s) for mname"
  [ir pargs top-level? mpclass mname display-name margs mbody & [irks]]
  (dbg-println :debug "MHM " "TOP-LEVEL?" top-level? "MPCLASS" mpclass "MNAME" mname
           "DISPLAY-NAME" display-name
           "IRKS" irks "MBODY" mbody)
  (let [irks (conj (or irks [mpclass :methods mname]) :body)
