IIIM-IS / AERA

Other
12 stars 4 forks source link

variables are not updated for making the imdl of a prediction #251

Closed jefft0 closed 1 year ago

jefft0 commented 1 year ago

In forward chaining, a model controller makes a prediction from the RHS and also makes an imdl to show how the model was instantiated. The example below is for the reuse model M6 in hand-grab-sphere (simplified):

M6:(mdl [H: C: P0: T0: T1:] []
   (fact (imdl M0 [H: P0: T0: T1:] [DeltaP: P1: T2: T3:] : :) T0_cmd: T1_cmd: : :)
   (fact (mk.val C: position P1: :) T2: T3: : :)
[]
   T2:(+ T0 100ms)
   T3:(+ T1 100ms))

fact_281 matches the LHS and binds variables T0 and T1 to the timings 200ms and 800ms. Note that variables T0 and T1 are also in the model's template arguments. Then the controller matches with requirement fact128 where the template arguments have the more "narrow" time interval 600ms to 700ms. This updates variables T0 and T1 to these more narrow values. Then the forward guards are used to compute the RHS time interval variables T2 and T3 which you can see in prediction fact_290 as 700ms and 800ms. So far, so good. Then the controller makes imdl fact_291 to show how the model was instantiated to make the prediction. But the template arguments are still 200ms and 800ms. These are not the values that were used to make the prediction. They should be 600ms and 700ms.

When the model controller makes the imdl fact_291 the binding map has the correct values for T0 and T1, but these haven't been used to update the imdl.

image

jefft0 commented 1 year ago

Close as fixed by #250.