% Add beliefs and justifications from red light percepts.
forall bel  (percept (red (X)), not (red (X))) do insert  (red (X))
+ insert  (just (red (X), , p)).
% Remove belief and justification when no longer red light.
forall bel  (red (X), percept (not (red (X)))) do delete  (red (X))
+ delete  (just (red (X), , _)).
Algorithm 8