- let res = Cache.N6.find cache i j k l m n in
- if res == Cache.N6.dummy cache then
- let res =
- Ata.TransList.fold (fun trs (acct, accs) ->
- let q, _, phi = Ata.Transition.node trs in
- if StateSet.mem q accs then (acct, accs) else
- if eval_form phi node_info fcs nss ps accs then
- (acct, StateSet.add q accs)
- else
- (Ata.TransList.cons trs acct, accs)
- ) ltrs (Ata.TransList.nil, ss)
- in
- Cache.N6.add cache i j k l m n res; res
- else
- res
+ let (new_ltrs, new_ss) as res =
+ let res = Cache.N6.find cache i j k l m n in
+ if res == Cache.N6.dummy cache then
+ let res =
+ Ata.TransList.fold (fun trs (acct, accs) ->
+ let q, _, phi = Ata.Transition.node trs in
+ if StateSet.mem q accs then (acct, accs) else
+ if eval_form phi node_info fcs nss ps accs then
+ (acct, StateSet.add q accs)
+ else
+ (Ata.TransList.cons trs acct, accs)
+ ) ltrs (Ata.TransList.nil, ss)
+ in
+ Cache.N6.add cache i j k l m n res; res
+ else
+ res
+ in
+ if new_ss == ss then res else
+ loop new_ltrs new_ss
+ in
+ loop ltrs ss