- let states0 = get cache tree node in
- let trans0 = Ata.get_trans auto tag auto.Ata.states in
- let () =
- TRACE(Html.trace (T.preorder tree node) _i "Pre States: %a<br/>Pre Trans: %a<br/>"
- StateSet.print states0 (Ata.TransList.print ~sep:"<br/>") trans0)
- in
- let ps = get cache tree parent in
- let fcs = get cache tree fc in
- let nss = get cache tree ns in
- let is_left = node == T.first_child tree parent
- and is_right = node == T.next_sibling tree parent
- and has_left = fc != T.nil
- and has_right = ns != T.nil
- and kind = T.kind tree node
- in
- let trans1, states1 =
- Ata.eval_trans auto trans0
- fcs nss ps states0
- is_left is_right has_left has_right kind
- in
- let () =
- TRACE(Html.trace (T.preorder tree node) _i "TD States: %a<br/>TD Trans: %a<br/>" StateSet.print states1 (Ata.TransList.print ~sep:"<br/>") trans1)
- in
- if states1 != states0 then set cache tree node states1;
- let () = loop fc in
- let fcs1 = get cache tree fc in
- let trans2, states2 =
- Ata.eval_trans auto trans1
- fcs1 nss ps states1
- is_left is_right has_left has_right kind
+ let config0 =
+ let c = cache.(node_id) in
+ if c == Ata.dummy_config then
+ Ata.Config.make
+ { c.Ata.Config.node with
+ Ata.todo = Ata.get_trans auto tag auto.Ata.states;
+ summary = Ata.node_summary
+ (node == T.first_child tree parent) (* is_left *)
+ (node == T.next_sibling tree parent) (* is_right *)
+ (fc != T.nil) (* has_left *)
+ (ns != T.nil) (* has_right *)
+ (T.kind tree node) (* kind *)
+ }
+ else c