Merge branch 'master' of ssh://git.nguyen.vg/tatoo
[tatoo.git] / src / eval.ml
index 206debe..76d9153 100644 (file)
@@ -14,7 +14,7 @@
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-04-04 18:45:19 CEST by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-04-04 21:16:27 CEST by Kim Nguyen>
 *)
 
 INCLUDE "utils.ml"
@@ -95,7 +95,12 @@ END
           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)
         in
         if states3 != states2 then set cache tree node states3;
-        if states0 != states3 && (not !redo) then redo := true
+        (*if states0 != states3 && (not !redo) then redo := true *)
+        if (not !redo)
+          && not (Ata.TransList.nil == _trans3)
+          && (states1 != states3)
+          && not (StateSet.intersect states3 auto.Ata.selection_states)
+        then redo := true
       end
     in
     loop node;
@@ -121,9 +126,11 @@ END
     let iter = ref 0 in
     Ata.reset auto;
     while !redo do
+      redo := false;
       redo := top_down_run auto tree node cache !iter;
       incr iter;
     done;
+    at_exit (fun () -> eprintf "INFO: %i iterations\n" !iter);
     let r = get_results auto tree node cache in
     TRACE(Html.gen_trace (module T : Tree.Sig.S with type t = T.t) (tree));
     r