- Reorder the keys used to cache transitions
authorKim Nguyễn <kn@lri.fr>
Sat, 16 Mar 2013 10:32:08 +0000 (11:32 +0100)
committerKim Nguyễn <kn@lri.fr>
Mon, 18 Mar 2013 19:56:55 +0000 (20:56 +0100)
- Use a new stop condition (gives optimal traversal for filter
  less queries)
- Reorder a variant type so that the hash of some variant becomes
smaller

src/auto/ata.ml
src/auto/eval.ml
src/tree/common.ml

index 419ab57..2710465 100644 (file)
@@ -14,7 +14,7 @@
 (***********************************************************************)
 
 (*
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-03-15 23:42:43 CET by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-03-16 07:38:04 CET by Kim Nguyen>
 *)
 
 INCLUDE "utils.ml"
 *)
 
 INCLUDE "utils.ml"
@@ -262,15 +262,13 @@ let int_of_conf is_left is_right has_left has_right kind =
     (Obj.magic has_right)
 
 let eval_trans auto ltrs fcs nss ps ss is_left is_right has_left has_right kind =
     (Obj.magic has_right)
 
 let eval_trans auto ltrs fcs nss ps ss is_left is_right has_left has_right kind =
-  let i = int_of_conf is_left is_right has_left has_right kind
+  let n = int_of_conf is_left is_right has_left has_right kind
   and k = (fcs.StateSet.id :> int)
   and l = (nss.StateSet.id :> int)
   and k = (fcs.StateSet.id :> int)
   and l = (nss.StateSet.id :> int)
-  and m = (ps.StateSet.id :> int)
-  in
-
+  and m = (ps.StateSet.id :> int) in
   let rec loop ltrs ss =
   let rec loop ltrs ss =
-    let j = (ltrs.TransList.id :> int)
-    and n = (ss.StateSet.id :> int) in
+    let i = (ltrs.TransList.id :> int)
+    and j = (ss.StateSet.id :> int) in
     let (new_ltrs, new_ss) as res =
       let res = Cache.N6.find auto.cache6 i j k l m n in
       if res == dummy6 then
     let (new_ltrs, new_ss) as res =
       let res = Cache.N6.find auto.cache6 i j k l m n in
       if res == dummy6 then
index e4def93..f51e0d5 100644 (file)
@@ -14,7 +14,7 @@
 (***********************************************************************)
 
 (*
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-03-15 23:46:44 CET by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-03-16 09:39:39 CET by Kim Nguyen>
 *)
 
 INCLUDE "utils.ml"
 *)
 
 INCLUDE "utils.ml"
@@ -96,7 +96,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;
           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;
       end
     in
     loop node;
@@ -122,6 +127,7 @@ END
     let iter = ref 0 in
     Ata.reset auto;
     while !redo do
     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;
       redo := top_down_run auto tree node cache !iter;
       incr iter;
     done;
index 099d751..76e6dc2 100644 (file)
 (***********************************************************************)
 
 (*
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-03-11 00:11:53 CET by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-03-16 07:01:10 CET by Kim Nguyen>
 *)
 
 module NodeKind =
   struct
     type t =
 *)
 
 module NodeKind =
   struct
     type t =
-        Document | Element | Text | Comment | Attribute | ProcessingInstruction
+        Document | Element | Text |  Attribute | Comment | ProcessingInstruction
       | Node
 
     let to_string =
       | Node
 
     let to_string =