- let trans2, states2 =
- Ata.eval_trans auto trans1
- fcs1 nss ps states1
- is_left is_right has_left has_right kind
- in
- let () =
- TRACE(Html.trace (T.preorder tree node) _i "Left BU States: %a<br/>Left BU Trans: %a<br/>" StateSet.print states2 (Ata.TransList.print ~sep:"<br/>") trans2)
- in
- if states2 != states1 then set cache tree node states2;
- let () = loop ns in
- let _trans3, states3 =
- Ata.eval_trans auto trans2
- fcs1 (get cache tree ns) ps states2
- is_left is_right has_left has_right kind
- in
- let () =
- TRACE(Html.trace (T.preorder tree node) _i "Right BU States: %a<br/>Right BU Trans: %a<br/>" StateSet.print states3 (Ata.TransList.print ~sep:"<br/>") _trans3)
+ let config2 = Ata.eval_trans auto fcs1 nss ps config1 in
+
+ TRACE(html tree node _i config2 "Updating transitions (after first-child)");
+
+ if config1 != config2 then set cache tree node config2 _i;
+ let old_unstable_right = Bitvector.unsafe_get unstable (T.preorder tree ns) in
+ let unstable_right = old_unstable_right && loop ns in
+ let nss1 = get cache tree ns in
+ let config3 = Ata.eval_trans auto fcs1 nss1 ps config2 in
+
+ TRACE(html tree node _i config3 "Updating transitions (after next-sibling)");
+
+ if config2 != config3 then set cache tree node config3 _i;
+ let unstable_self =
+ unstable_left
+ || unstable_right
+ || Ata.(TransList.nil != config3.Config.node.todo)