dollabs / pamela

Probabalistic Advanced Modeling and Execution Learning Architecture
Apache License 2.0
233 stars 13 forks source link

Extend HTN generation to handle nested parallel/sequence/choose statements #112

Open dcerys opened 7 years ago

dcerys commented 7 years ago

For generating HTNs from Pamela, there is a current restriction that parallel/sequence/choose statements cannot be nested within another. For example, the following isn't allowed:

(defpmethod main []
  (sequence
   (parallel
    (one)
    (two))
   (three)))

The workaround is trivial; just refactor the nested statement into a separate method. For example:

(defpmethod main []
  (sequence
   (one-and-two)
   (three)))

(defpmethod one-and-two []
  (parallel
    (one)
    (two)))

It would be a low-priority enhancement to support methods containing nested forms, as in the original main above.