dollabs / pamela

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

Parser creates incorrect IR for :bounds in ask, tell, and assert statements #122

Closed dcerys closed 7 years ago

dcerys commented 7 years ago

For the following statement:

(ask (or (= door "open") (= door "closed"))
   :bounds [5 30])

The generated IR is:

{:type :ask,
         :body
         [{:temporal-constraints [{:type :bounds, :value [5 30]}]}],
         :condition
         {:type :or,
          :args
          [{:type :equal,
            :args
            [{:type :state-variable, :name door}
             {:type :literal, :value "open"}]}
           {:type :equal,
            :args
            [{:type :state-variable, :name door}
             {:type :literal, :value "closed"}]}]}}

Instead of :body [{:temporal-constraints [{:type :bounds, :value [5 30]}]}],, the IR should be :temporal-constraints [{:type :bounds, :value [5 30]}] (i.e., at the top level of the map).

Note that this problem exists in https://github.com/dollabs/pamela/blob/master/test/pamela/statements.pamela, with a currently incorrect rubric in https://github.com/dollabs/pamela/blob/master/test/pamela/IR/statements.ir.edn