Background: When the input to the auto focus controller is a mk.val like (mk.val h position 10) it creates an AST controller for it. AST means "atomic state" and is used to track if a state variable changes. In the next frame, if the input to the auto focus controller is another mk.val like (mk.val h position 15), then it will invoke CTPX to try to find a model that explains the change. However, if the input to the auto focus controller is a prediction that matches the target of an AST controller, then this means that there is already a model that is making predictions for it and we don't need to invoke CTPX again. In this case the AST controller is canceled.
Now we are doing experimentation with anti-facts, including models which predict anti-facts. The existing code seems to assume that the input to the auto focus controller will always be a fact (not an anti-fact), and this introduces some problems. Firstly, the simplest problem is that it doesn't make sense for CTPX to try to model the change of an anti-fact. Suppose one frame has:
(|fact (mk.val h position 10) 100ms)
and the next frame has
(|fact (mk.val h position 15) 200ms)
If h position isn't 10 and later it isn't 15, it doesn't make sense to try to make a model to predict this. Therefore, in this pull request we update the auto focus controller so that it doesn't create AST controller for an anti-fact.
The second problem is in the control of when to cancel an AST controller because there is already a model which predicts the target value. Similar to the logic in pull request #274, if the model predicts an anti-fact then there is no valid inference that the model is or isn't a predictor of the value being tracked by the AST controller. Therefore, we update the AST controller to not cancel if a model made a prediction of an anti-fact.
Background: When the input to the auto focus controller is a mk.val like
(mk.val h position 10)
it creates an AST controller for it. AST means "atomic state" and is used to track if a state variable changes. In the next frame, if the input to the auto focus controller is another mk.val like(mk.val h position 15)
, then it will invoke CTPX to try to find a model that explains the change. However, if the input to the auto focus controller is a prediction that matches the target of an AST controller, then this means that there is already a model that is making predictions for it and we don't need to invoke CTPX again. In this case the AST controller is canceled.Now we are doing experimentation with anti-facts, including models which predict anti-facts. The existing code seems to assume that the input to the auto focus controller will always be a fact (not an anti-fact), and this introduces some problems. Firstly, the simplest problem is that it doesn't make sense for CTPX to try to model the change of an anti-fact. Suppose one frame has:
and the next frame has
If h position isn't 10 and later it isn't 15, it doesn't make sense to try to make a model to predict this. Therefore, in this pull request we update the auto focus controller so that it doesn't create AST controller for an anti-fact.
The second problem is in the control of when to cancel an AST controller because there is already a model which predicts the target value. Similar to the logic in pull request #274, if the model predicts an anti-fact then there is no valid inference that the model is or isn't a predictor of the value being tracked by the AST controller. Therefore, we update the AST controller to not cancel if a model made a prediction of an anti-fact.