From 58e4b62160c6c0a68bc36dc1004d638a77417638 Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Tue, 3 Mar 2015 11:13:54 +0100
Subject: [PATCH] Fresh var names : keep only one mechanism to invent var
 names.

Indeed, having two different mechanisms is bad.

In the end, I've kept mine (and not the one of Pascal), because the
it was depending on LicPrg.t, which was creating a circular dep
(which could of course be fixed, but I am lazy).
---
 src/compile.ml         |  3 +-
 src/l2lExpandArrays.ml |  7 ++---
 src/l2lExpandMetaOp.ml |  6 ++--
 src/l2lOptimIte.ml     |  4 +--
 src/l2lSplit.ml        | 63 +++++++++++++++++++-----------------------
 src/licName.ml         | 46 ++++++++++++++++--------------
 src/licName.mli        | 26 ++++++++++-------
 src/licPrg.ml          | 57 +++++++++-----------------------------
 src/licPrg.mli         | 13 +--------
 src/lv6parserUtils.ml  |  2 +-
 test/lus2lic.sum       | 24 ++++++++--------
 test/lus2lic.time      | 14 +++++-----
 12 files changed, 110 insertions(+), 155 deletions(-)

diff --git a/src/compile.ml b/src/compile.ml
index 62a9ffe9..92ba6c82 100644
--- a/src/compile.ml
+++ b/src/compile.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 26/02/2015 (at 11:20) by Erwan Jahier> *)
+(* Time-stamp: <modified the 03/03/2015 (at 10:58) by Erwan Jahier> *)
 
 open Lxm
 open Lv6errors
@@ -151,7 +151,6 @@ let test_lex ( lexbuf ) = (
 let lus_load lexbuf = 
   let tree = Lv6parser.program Lv6lexer.lexer lexbuf in
     LicName.update_fresh_var_prefix ();
-    (* ICI  *)
     AstRecognizePredef.f tree
   
 type maybe_packed = 
diff --git a/src/l2lExpandArrays.ml b/src/l2lExpandArrays.ml
index 1702de02..8a48e375 100644
--- a/src/l2lExpandArrays.ml
+++ b/src/l2lExpandArrays.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 26/02/2015 (at 11:21) by Erwan Jahier> *)
+(** Time-stamp: <modified the 03/03/2015 (at 10:43) by Erwan Jahier> *)
 
 (* Replace structures and arrays by as many variables as necessary.
    Since structures can be nested, it migth be a lot of new variables...
@@ -38,7 +38,6 @@ let dbg =  (Verbose.get_flag "esa")
 (********************************************************************************)
 (* pack useful info (while expanding nodes) into a single struct *)
 type local_ctx = { 
-  idgen : LicPrg.id_generator;
   node : Lic.node_exp;
   prg : LicPrg.t;
 }
@@ -47,8 +46,7 @@ type local_ctx = {
    XXX code dupl. with Split.new_var 
 *)
 let new_var str lctx type_eff clock_eff = 
-  let id = Lv6Id.of_string (LicName.new_local_var str) in
-  (*   let id = lctx.idgen str in (* XXX use which one ??? *) *)
+  let id = Lv6Id.of_string (LicName.new_local_var str) in 
   let var =
     { 
       var_name_eff   = id;
@@ -655,7 +653,6 @@ let rec (doit : LicPrg.t -> LicPrg.t) =
         Verbose.exe ~flag:dbg (fun() -> Printf.printf "#DBG: L2lExpandArrays expands '%s'\n"
             (Lic.string_of_node_key nk));
         let lctx = {
-          idgen = LicPrg.fresh_var_id_generator inprg ne;
           node = ne;
           prg = inprg;
         }
diff --git a/src/l2lExpandMetaOp.ml b/src/l2lExpandMetaOp.ml
index d0ab95a2..da8f0cdf 100644
--- a/src/l2lExpandMetaOp.ml
+++ b/src/l2lExpandMetaOp.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 26/02/2015 (at 11:21) by Erwan Jahier> *)
+(** Time-stamp: <modified the 03/03/2015 (at 10:43) by Erwan Jahier> *)
 
 open Lxm
 open Lic
@@ -7,7 +7,6 @@ let dbg = (Verbose.get_flag "ei")
 
 (* pack useful info into a single struct *)
 type local_ctx = { 
-  idgen : LicPrg.id_generator;
   node : Lic.node_exp;
   prg : LicPrg.t;
 }
@@ -15,7 +14,7 @@ type local_ctx = {
 (********************************************************************************)
 (* stuff to create fresh var names. *)
 let new_var str lctx type_eff clock_eff = 
-  let id = Lv6Id.of_string (LicName.new_local_var str) in
+  let id = Lv6Id.of_string (LicName.new_local_var str) in 
   let var =
     { 
       var_name_eff   = id;
@@ -515,7 +514,6 @@ let (doit :  LicPrg.t -> LicPrg.t) =
     let rec (do_node : Lic.node_key -> Lic.node_exp -> LicPrg.t -> LicPrg.t) = 
       fun nk ne outprg -> 
         let lctx = {
-          idgen = LicPrg.fresh_var_id_generator inprg ne;
           node = ne;
           prg = inprg;
         }
diff --git a/src/l2lOptimIte.ml b/src/l2lOptimIte.ml
index bb4eb207..088ca249 100644
--- a/src/l2lOptimIte.ml
+++ b/src/l2lOptimIte.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 21/01/2015 (at 15:44) by Erwan Jahier> *)
+(** Time-stamp: <modified the 02/03/2015 (at 17:47) by Erwan Jahier> *)
 
 open Lxm
 open Lic
@@ -54,7 +54,7 @@ let  (val_exp_when_clk : Lic.val_exp -> Lic.clock -> Lic.val_exp) =
       ve_clk = List.map (fun _ -> clk) ve.ve_clk; (* *)
       ve_core = CallByPosLic({ src=lxm; it=Lic.WHEN clk },[ve]);
     }
-
+      
 let (gen_merge : Lxm.t -> Lic.val_exp -> Lic.val_exp -> Lic.val_exp -> acc ->
      Lic.val_exp_core * acc ) =
   fun lxm cond ve1 ve2 acc ->
diff --git a/src/l2lSplit.ml b/src/l2lSplit.ml
index 2cad1577..5bd08494 100644
--- a/src/l2lSplit.ml
+++ b/src/l2lSplit.ml
@@ -17,16 +17,13 @@ let info msg =
 
 (********************************************************************************)
 
-(* XXX  use LicName.new_var_info *)
-
-let new_var getid type_eff clock_eff = 
-  let id = getid "v" in
+let new_var type_eff clock_eff = 
+  let id = Lv6Id.of_string (LicName.new_local_var "v") in 
   let var =
     { 
       var_name_eff   = id;
       var_nature_eff = AstCore.VarLocal;
-      var_number_eff = -1; (* this field is used only for i/o. 
-                              Should i rather put something sensible there ? *)
+      var_number_eff = -1;
       var_type_eff   = type_eff;
       var_clock_eff  = id,clock_eff;
     } in
@@ -163,21 +160,19 @@ let (split_tuples:Lic.eq_info Lxm.srcflagged list -> Lic.eq_info Lxm.srcflagged
 *)
 type split_acc = (Lic.eq_info srcflagged) list * Lic.var_info list
 
-let rec (eq : LicPrg.id_generator -> Lic.eq_info Lxm.srcflagged -> split_acc) =
-  fun getid { src = lxm_eq ; it = (lhs, rhs) } ->
-    let n_rhs, (neqs, nlocs) = split_val_exp false true getid rhs in
+let rec (eq : Lic.eq_info Lxm.srcflagged -> split_acc) =
+  fun { src = lxm_eq ; it = (lhs, rhs) } ->
+    let n_rhs, (neqs, nlocs) = split_val_exp false true rhs in
     { src = lxm_eq ; it = (lhs, n_rhs) }::neqs, nlocs
 
-and (split_eq_acc :
-       LicPrg.id_generator -> split_acc -> Lic.eq_info srcflagged -> split_acc) =
-  fun getid (eqs, locs) equation ->
-    let (neqs, nlocs) = eq getid equation in 
+and (split_eq_acc : split_acc -> Lic.eq_info srcflagged -> split_acc) =
+  fun  (eqs, locs) equation ->
+    let (neqs, nlocs) = eq equation in 
     let neqs = split_tuples neqs in
     List.rev_append neqs eqs, List.rev_append nlocs locs
 
-and (split_val_exp : bool -> bool -> LicPrg.id_generator -> Lic.val_exp -> 
-     Lic.val_exp * split_acc) =
-  fun when_flag top_level getid ve -> 
+and (split_val_exp : bool -> bool -> Lic.val_exp -> Lic.val_exp * split_acc) =
+  fun when_flag top_level ve -> 
     (* [when_flag] is true is the call is made from a "when" statement.
        We need this flag in order to know if it is necessary to add
        a when on constants. Indeed, in Lustre V6, it is not necessary
@@ -191,9 +186,9 @@ and (split_val_exp : bool -> bool -> LicPrg.id_generator -> Lic.val_exp ->
     *)
     match ve.ve_core with
       | Merge(ce,cl) -> (
-        let ce,(eql1, vl1) = split_val_exp false false getid ce in
+        let ce,(eql1, vl1) = split_val_exp false false ce in
         let const_l, vel = List.split cl in
-        let vel,(eql2, vl2) = split_val_exp_list false false getid vel in
+        let vel,(eql2, vl2) = split_val_exp_list false false vel in
         let eql, vl = eql1@eql2, vl1@vl2 in
         let cl = List.combine const_l vel in
         let rhs = { ve with ve_core = Merge(ce,cl)} in
@@ -202,7 +197,7 @@ and (split_val_exp : bool -> bool -> LicPrg.id_generator -> Lic.val_exp ->
           let clk_l = ve.ve_clk in 
           let typ_l = ve.ve_typ in  
           assert (List.length typ_l = List.length clk_l);
-          let nv_l = List.map2 (new_var getid) typ_l clk_l  in
+          let nv_l = List.map2 new_var typ_l clk_l  in
           let lxm = lxm_of_val_exp ve in
           let vi2val_exp nv = 
             let _,clk = nv.var_clock_eff in
@@ -243,7 +238,7 @@ and (split_val_exp : bool -> bool -> LicPrg.id_generator -> Lic.val_exp ->
         let fl, eql, vl = 
           List.fold_left
             (fun (fl_acc, eql_acc, vl_acc) (fn, fv) ->
-              let fv, (eql, vl) = split_val_exp false false getid fv in
+              let fv, (eql, vl) = split_val_exp false false fv in
               ((fn,fv)::fl_acc, eql@eql_acc, vl@vl_acc)
             )
             ([],[],[])
@@ -257,7 +252,7 @@ and (split_val_exp : bool -> bool -> LicPrg.id_generator -> Lic.val_exp ->
           let clk_l = ve.ve_clk in 
           let typ_l = ve.ve_typ in  
           assert (List.length typ_l = List.length clk_l);
-          let nv_l = List.map2 (new_var getid) typ_l clk_l  in
+          let nv_l = List.map2 new_var typ_l clk_l  in
           let nve = match nv_l with
             | [nv] -> { ve with ve_core = 
                 CallByPosLic(
@@ -276,17 +271,17 @@ and (split_val_exp : bool -> bool -> LicPrg.id_generator -> Lic.val_exp ->
         let (rhs, (eql,vl)) =
           match by_pos_op_eff.it with 
             | Lic.HAT(i) ->
-              let vel, (eql, vl) = split_val_exp_list false false getid vel in
+              let vel, (eql, vl) = split_val_exp_list false false vel in
               let by_pos_op_eff = Lxm.flagit (Lic.HAT(i)) lxm in
               let rhs = CallByPosLic(by_pos_op_eff, vel) in
               rhs, (eql, vl)
             | Lic.WHEN ve -> (* should we create a var for the clock? *)
-              let vel,(eql, vl) = split_val_exp_list true false getid vel in
+              let vel,(eql, vl) = split_val_exp_list true false vel in
               let by_pos_op_eff = Lxm.flagit (Lic.WHEN(ve)) lxm in
               let rhs = CallByPosLic(by_pos_op_eff, vel) in
               rhs, (eql, vl)
             | _ -> 
-              let vel, (eql, vl) = split_val_exp_list false false getid vel in
+              let vel, (eql, vl) = split_val_exp_list false false vel in
               let rhs = CallByPosLic(by_pos_op_eff, vel) in
               rhs, (eql, vl)
         in
@@ -298,7 +293,7 @@ and (split_val_exp : bool -> bool -> LicPrg.id_generator -> Lic.val_exp ->
           let clk_l = ve.ve_clk in 
           let typ_l = ve.ve_typ in
           assert (List.length typ_l = List.length clk_l);
-          let nv_l = List.map2 (new_var getid) typ_l clk_l  in
+          let nv_l = List.map2 new_var typ_l clk_l  in
           let nve = 
             match nv_l with
               | [nv] -> {
@@ -334,17 +329,16 @@ and (split_val_exp : bool -> bool -> LicPrg.id_generator -> Lic.val_exp ->
 		    nve, (eql@[eq], vl@nv_l)
       )
 
-and (split_val_exp_list : bool -> 
-     bool -> LicPrg.id_generator -> Lic.val_exp list -> Lic.val_exp list * split_acc) =
-  fun when_flag top_level getid vel ->
+and (split_val_exp_list : bool -> bool -> Lic.val_exp list -> Lic.val_exp list * split_acc) =
+  fun when_flag top_level vel ->
     let vel, accl = 
-      List.split (List.map (split_val_exp when_flag top_level getid) vel) 
+      List.split (List.map (split_val_exp when_flag top_level) vel) 
     in
     let eqll,vll = List.split accl in
     let eql, vl = List.flatten eqll, List.flatten vll in
     (vel,(eql,vl))
 
-and split_node (opt:Lv6MainArgs.t) (getid: LicPrg.id_generator) (n: Lic.node_exp) : Lic.node_exp =
+and split_node (opt:Lv6MainArgs.t) (n: Lic.node_exp) : Lic.node_exp =
   Verbose.exe ~flag:dbg (fun () ->
     Printf.eprintf "*** Splitting node  %s\n"
       (LicDump.string_of_node_key_iter n.node_key_eff);
@@ -354,10 +348,10 @@ and split_node (opt:Lv6MainArgs.t) (getid: LicPrg.id_generator) (n: Lic.node_exp
     | MetaOpLic
     | AbstractLic None -> n
     | AbstractLic (Some pn) -> 
-      { n with def_eff = AbstractLic (Some (split_node opt getid pn)) }
+      { n with def_eff = AbstractLic (Some (split_node opt pn)) }
     | BodyLic b -> 
       let loc = match n.loclist_eff with None -> [] | Some l -> l in
-      let (neqs, nv) = List.fold_left (split_eq_acc getid) ([], loc) b.eqs_eff in
+      let (neqs, nv) = List.fold_left (split_eq_acc) ([], loc) b.eqs_eff in
       info (Printf.sprintf "Split %i equations into %i ones\n"
               (List.length b.eqs_eff)(List.length  neqs));
 
@@ -370,7 +364,7 @@ and split_node (opt:Lv6MainArgs.t) (getid: LicPrg.id_generator) (n: Lic.node_exp
           let asserts = List.map (fun x -> x.it) b.asserts_eff in 
           let lxm_asserts = List.map (fun x -> x.src) b.asserts_eff in 
           let nasserts,(neqs_asserts,nv_asserts) = 
-            split_val_exp_list false true getid asserts 
+            split_val_exp_list false true asserts 
           in
           assert (List.length nasserts = List.length lxm_asserts); 
           let nasserts = List.map2 Lxm.flagit nasserts lxm_asserts in 
@@ -403,8 +397,7 @@ let rec doit (opt:Lv6MainArgs.t) (inprg : LicPrg.t) : LicPrg.t =
    let rec do_node k (ne:Lic.node_exp) =
       (* On passe en parametre un constructeur de nouvelle variable locale *)
      info (Printf.sprintf  "#DBG: split equations of '%s'\n" (Lic.string_of_node_key k));
-      let getid = LicPrg.fresh_var_id_generator inprg ne in
-      let ne' = split_node opt getid ne in
+      let ne' = split_node opt ne in
       res := LicPrg.add_node k ne' !res
    in
    (*LET's GO *)
diff --git a/src/licName.ml b/src/licName.ml
index 77e68aa5..7ba3b1f8 100644
--- a/src/licName.ml
+++ b/src/licName.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 26/02/2015 (at 11:22) by Erwan Jahier> *)
+(* Time-stamp: <modified the 03/03/2015 (at 10:50) by Erwan Jahier> *)
 
 
 (* maps node_key to a string that won't clash *)
@@ -45,7 +45,7 @@ let local_var_tbl = Hashtbl.create 0
    by "_0", and then "_1", and so on so forth. We take the first
    possible one.
 
-   nb : this won't work if the user defined idents from "_1" to
+   nb : this won't work if the user have defined all idents from "_1" to
    "_1073741823" (on 32-bits machine), but I bet that this compiler
    would die before anyway...
 
@@ -84,6 +84,9 @@ module IntSet =
              let compare = compare
            end)
 
+(* Make sure that update_fresh_var_prefix has been called *)
+let fresh_var_prefix_updated = ref false
+
 (* exported *)
 let (update_fresh_var_prefix : unit -> unit) =
   fun _ ->
@@ -116,42 +119,43 @@ let (update_fresh_var_prefix : unit -> unit) =
             prerr_string ("I use " ^ new_prefix ^ " as prefix for fresh var names.\n");
             flush stderr
           )
-      )
+      );
+    fresh_var_prefix_updated := true
 
-(********************************************************************************)
-(* exported 
 
-XXX duplique le job de LicPrg.id_generator !!!
-*)
+(********************************************************************************)
+(* exported *)
 
 let (new_local_var : string -> string) =
   fun prefix ->
     try 
       let cpt = Hashtbl.find local_var_tbl prefix in
-        Hashtbl.replace local_var_tbl prefix (cpt+1);
-        !fresh_var_prefix ^ prefix ^"_"^ (string_of_int cpt)
+      assert (!fresh_var_prefix_updated);
+      Hashtbl.replace local_var_tbl prefix (cpt+1);
+      !fresh_var_prefix ^ prefix ^"_"^ (string_of_int cpt)
     with
         Not_found -> 
           Hashtbl.add local_var_tbl prefix 2;
           !fresh_var_prefix ^ prefix ^ "_1"
 
+
 (********************************************************************************)
 (* exported *)
 open Lic
 let (new_var_info : string -> Lic.type_ -> Lic.id_clock -> Lic.var_info) =
   fun str type_eff clock_eff ->
-  let id = Lv6Id.of_string (new_local_var str) in
-  let var =
-    { 
-      var_name_eff   = id;
-      var_nature_eff = AstCore.VarLocal;
-      var_number_eff = -1; (* this field is used only for i/o. 
-                              Should i rather put something sensible there ? *)
-      var_type_eff   = type_eff;
-      var_clock_eff  = clock_eff;
-    }
-  in
-  var
+    let id = Lv6Id.of_string (new_local_var str) in
+    let var =
+      { 
+        var_name_eff   = id;
+        var_nature_eff = AstCore.VarLocal;
+        var_number_eff = -1; (* this field is used only for i/o. 
+                                Should i rather put something sensible there ? *)
+        var_type_eff   = type_eff;
+        var_clock_eff  = clock_eff;
+      }
+    in
+    var
 
 
 (********************************************************************************)
diff --git a/src/licName.mli b/src/licName.mli
index 818748bc..7ca61ad0 100644
--- a/src/licName.mli
+++ b/src/licName.mli
@@ -1,16 +1,24 @@
-(* Time-stamp: <modified the 16/01/2015 (at 13:52) by Erwan Jahier> *)
+(* Time-stamp: <modified the 03/03/2015 (at 11:01) by Erwan Jahier> *)
 
 
 (** All new identifier names ougth to be created via this module. *)
 
+(** To be called just after the parsing (to make sure that fresh
+    var names won't clash with user idents. ) 
+
+    Indeed, during the parsing, we collect the set of forbidden id that
+    we (somehow) transmit to the fresh id generator below.
+*)
+val update_fresh_var_prefix : unit -> unit
+
 (** [node_key nk] returns a fresh node ident. 
 
-   The idea is the following: the caller propose a name to map the
-   node key. But since that name may clash, we need to work a little bit
-   more. This is the purpose of that function.
-   
-   nb : for a certain node key, it will always return the same string 
-   (which means that [name] migth be ignored).
+    The idea is the following: the caller propose a name to map the
+    node key. But since that name may clash, we sometimes need to work
+    a little bit more. This is the purpose of that function.
+    
+    nb : for a  node key, it will always return the same string 
+    (which means that [name] migth be ignored).
 *)
 val node_key: Lic.node_key -> string -> string
 
@@ -27,7 +35,5 @@ val new_var_info : string -> Lic.type_ -> Lic.id_clock -> Lic.var_info
 (**  *)
 val array_type : Lic.type_ -> string -> string
 
-(** To be called just after the parsing (to make sure that fresh var names won't clash with 
-    user idents. ) *)
-val update_fresh_var_prefix : unit -> unit
+
 
diff --git a/src/licPrg.ml b/src/licPrg.ml
index a40c870b..612ead37 100644
--- a/src/licPrg.ml
+++ b/src/licPrg.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 26/02/2015 (at 11:22) by Erwan Jahier> *)
+(* Time-stamp: <modified the 03/03/2015 (at 10:42) by Erwan Jahier> *)
 
 module ItemKeyMap = struct
 	include Map.Make (
@@ -47,15 +47,6 @@ let rec pretty_sfx i =
    else
       (pretty_sfx ((i-1)/5))^(Char.escaped (char_of_int (97 + (i-1) mod 5)))
 
-(** CREER DES IDENTS TOUT FRAIS *)
-let fresh_type_id this pname pfx =
-   let rec fresh x =
-      let id = Printf.sprintf "%s%s" pfx (pretty_sfx x) in
-      let res = Lv6Id.make_long pname id in
-      if ItemKeyMap.mem res this.types then fresh (x+1)
-      else res
-   in
-   fresh 0
 
 (** RECHERCHE *)
 let find_type  this k = try Some(ItemKeyMap.find k this.types ) with Not_found -> None
@@ -265,38 +256,16 @@ let to_file (opt: Lv6MainArgs.t) (this:t) (main_node: Lv6Id.idref option) =
       this.nodes
   )
 
-(* GENERATEUR DE NOM DE VARIABLES 
+(********************************************************************************)
+(* exported *)
+
+(** Creer Des Idents De Type Tout Frais *)
+let fresh_type_id this pname pfx =
+   let rec fresh x =
+      let id = Printf.sprintf "%s%s" pfx (pretty_sfx x) in
+      let res = Lv6Id.make_long pname id in
+      if ItemKeyMap.mem res this.types then fresh (x+1)
+      else res
+   in
+   fresh 0
 
-XXX Refait le boulot de LicName !!! Merger les 2 mechanismes et prendre le meilleur !!!
-ce qui est sur, c'est qu'il est mal rangé ici !!!
-*)
-type id_generator = string -> string
-
-let fresh_var_id_generator : t -> Lic.node_exp -> id_generator =
-  fun prg ne ->
-    let cpt = ref 0 in
-    let forbidden = Hashtbl.create 100 in
-    let _ = iter_consts (fun i c -> match c with
-      | Lic.Extern_const_eff (s,_)
-      | Lic.Abstract_const_eff (s,_,_,_)
-      | Lic.Enum_const_eff   (s,_) -> Hashtbl.add forbidden (snd s) ()
-      | _ -> ()
-    ) prg in
-    let dovar vi = Hashtbl.add forbidden vi.Lic.var_name_eff () in
-    let _ = List.iter dovar ne.Lic.inlist_eff in
-    let _ = List.iter dovar ne.Lic.outlist_eff in
-    let _ = match ne.Lic.loclist_eff with
-      | Some l -> List.iter dovar l | None -> ()
-    in
-    let rec dogen (pfx: string) : string =
-      let id = Printf.sprintf "%s%02d" pfx !cpt in
-      incr cpt;
-      try (
-        let _ = Hashtbl.find forbidden id in
-        dogen pfx
-      ) with Not_found -> (
-        Hashtbl.add forbidden id ();
-        id 
-      )
-    in
-    dogen
diff --git a/src/licPrg.mli b/src/licPrg.mli
index abadb2f2..99d5760a 100644
--- a/src/licPrg.mli
+++ b/src/licPrg.mli
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 26/02/2015 (at 13:45) by Erwan Jahier> *)
+(* Time-stamp: <modified the 03/03/2015 (at 10:42) by Erwan Jahier> *)
 
 (** The data structure resulting from the compilation process *)
 
@@ -57,14 +57,3 @@ val choose_node  : t -> (Lic.node_key * Lic.node_exp) option
 val find_var : Lv6Id.t -> Lic.node_exp -> Lic.var_info option
 
 val fresh_type_id : t -> Lv6Id.pack_name -> string -> Lv6Id.long
-
-(** utile : générateur de noms de flow 'frais'
-   ATTENTION ! si on en utilise plusieurs
-   en meme temps, il ne doivent pas interferer !
-*)
-type id_generator = string -> string
-(** Initialisé avec
-- le programme (pour éviter les constantes existantes)
-- le noeud auquel on veut ajouter des variables 
-Et renvoie un générateur d'id unique  prefixe -> nom *)
-val fresh_var_id_generator : t -> Lic.node_exp -> id_generator
diff --git a/src/lv6parserUtils.ml b/src/lv6parserUtils.ml
index ef8a4855..da06a0f3 100644
--- a/src/lv6parserUtils.ml
+++ b/src/lv6parserUtils.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 26/02/2015 (at 11:22) by Erwan Jahier> *)
+(* Time-stamp: <modified the 03/03/2015 (at 10:57) by Erwan Jahier> *)
 
 (** *)
 
diff --git a/test/lus2lic.sum b/test/lus2lic.sum
index f29d1670..f63f5b21 100644
--- a/test/lus2lic.sum
+++ b/test/lus2lic.sum
@@ -1,5 +1,5 @@
 ==> lus2lic0.sum <==
-Test Run By jahier on Fri Feb 27 09:29:00 
+Test Run By jahier on Tue Mar  3 11:08:43 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic0 tests ===
@@ -63,7 +63,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
 XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
 
 ==> lus2lic1.sum <==
-Test Run By jahier on Fri Feb 27 09:29:05 
+Test Run By jahier on Tue Mar  3 11:08:52 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic1 tests ===
@@ -397,7 +397,7 @@ PASS: gcc -o multipar.exec multipar_multipar.c multipar_multipar_loop.c
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus  {}
 
 ==> lus2lic2.sum <==
-Test Run By jahier on Fri Feb 27 09:29:43 
+Test Run By jahier on Tue Mar  3 11:09:30 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic2 tests ===
@@ -727,7 +727,7 @@ PASS: gcc -o zzz2.exec zzz2_zzz2.c zzz2_zzz2_loop.c
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus  {}
 
 ==> lus2lic3.sum <==
-Test Run By jahier on Fri Feb 27 09:31:01 
+Test Run By jahier on Tue Mar  3 11:10:33 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic3 tests ===
@@ -1230,7 +1230,7 @@ PASS: ./myec2c {-o multipar.c multipar.ec}
 PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
 
 ==> lus2lic4.sum <==
-Test Run By jahier on Fri Feb 27 09:31:53 
+Test Run By jahier on Tue Mar  3 11:11:13 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic4 tests ===
@@ -1726,14 +1726,14 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
 # of unexpected failures	3
 ===============================
 # Total number of failures: 14
-lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 5 seconds
+lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 9 seconds
 lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 38 seconds
-lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 78 seconds
-lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 51 seconds
-lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 86 seconds
+lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 63 seconds
+lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 39 seconds
+lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 71 seconds
 * Ref time: 
-0.04user 0.04system 4:19.05elapsed 0%CPU (0avgtext+0avgdata 5120maxresident)k
-160inputs+0outputs (0major+5547minor)pagefaults 0swaps
+0.05user 0.03system 3:40.99elapsed 0%CPU (0avgtext+0avgdata 5092maxresident)k
+160inputs+0outputs (0major+5545minor)pagefaults 0swaps
 * Quick time (-j 4):
-0.04user 0.02system 1:27.38elapsed 0%CPU (0avgtext+0avgdata 5088maxresident)k
+0.04user 0.01system 1:28.07elapsed 0%CPU (0avgtext+0avgdata 5088maxresident)k
 160inputs+0outputs (0major+5580minor)pagefaults 0swaps
diff --git a/test/lus2lic.time b/test/lus2lic.time
index 250753ec..5c371ba2 100644
--- a/test/lus2lic.time
+++ b/test/lus2lic.time
@@ -1,11 +1,11 @@
-lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 5 seconds
+lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 9 seconds
 lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 38 seconds
-lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 78 seconds
-lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 51 seconds
-lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 86 seconds
+lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 63 seconds
+lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 39 seconds
+lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 71 seconds
 * Ref time: 
-0.04user 0.04system 4:19.05elapsed 0%CPU (0avgtext+0avgdata 5120maxresident)k
-160inputs+0outputs (0major+5547minor)pagefaults 0swaps
+0.05user 0.03system 3:40.99elapsed 0%CPU (0avgtext+0avgdata 5092maxresident)k
+160inputs+0outputs (0major+5545minor)pagefaults 0swaps
 * Quick time (-j 4):
-0.04user 0.02system 1:27.38elapsed 0%CPU (0avgtext+0avgdata 5088maxresident)k
+0.04user 0.01system 1:28.07elapsed 0%CPU (0avgtext+0avgdata 5088maxresident)k
 160inputs+0outputs (0major+5580minor)pagefaults 0swaps
-- 
GitLab