diff --git a/src/main.ml b/src/main.ml
index 0be634e6e1dac3b8b7f0986dd8c96049bccb296f..1b44bcadffb16d84a022a5f18a35d1089bc2b38e 100644
--- a/src/main.ml
+++ b/src/main.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 19/01/2010 (at 15:49) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/01/2010 (at 17:43) by Erwan Jahier> *)
 
 (** Here follows a description of the different modules used by this lus2lic compiler.
 
@@ -191,12 +191,12 @@ and
     )
 
 
-(* Retourne un parse_tree *)
-let lus_load lexbuf = (
-  SolveIdent.recognize_predef_op 
-    (Parser.sxLusFile Lexer.lexer lexbuf)
-) 
-
+(* Retourne un SyntaxTree.t *)
+let lus_load lexbuf = 
+  let tree = Parser.sxLusFile Lexer.lexer lexbuf in
+    Name.update_fresh_var_prefix ();
+    SolveIdent.recognize_predef_op tree
+   
 
   (*
     Lance le parser et renvoie la liste name-spaces d'entrée.   
diff --git a/src/name.ml b/src/name.ml
index 53be337412a5606fa12acea0c8befa298afab0d4..24d8954a1f1d395560e82383c222871df4ca34ef 100644
--- a/src/name.ml
+++ b/src/name.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 20/01/2010 (at 11:24) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/01/2010 (at 18:15) by Erwan Jahier> *)
 
 
 (* maps node_key to a string that won't clash *)
@@ -42,7 +42,6 @@ let (node_key: Eff.node_key -> string -> string) =
                     fresh_name
 
 
-
 (********************************************************************************)
 (* Dealing with fresh local (to the node) variable idents *)
 let local_var_tbl = Hashtbl.create 0
@@ -52,18 +51,100 @@ let (reset_local_var_prefix : string -> unit) =
   fun str -> 
     Hashtbl.remove local_var_tbl str
 
+
+
+(********************************************************************************)
+(* The idea is to prefix fresh var name by "_", except if at least
+   one user ident begins by "_". In that case, we try to prefix them
+   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
+   "_1073741823" (on 32-bits machine), but I bet that this compiler
+   would die before anyway...
+
+   nb : We stored in ParserUtils.name_table the set of idents that begins by "_".
+*)
+let fresh_var_prefix = ref "_"
+
+let char_is_int = function
+  |'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9' -> true
+  | _  -> false
+
+(* Returns None if str.[1] is not an int, and Some i otherwhise,
+   where i is the biggest possible int in str after the "_" (e.g.,
+   "_23toto" returns "Some 23" *)
+let (get_int : string -> int option) =
+  fun str -> 
+    let _ = assert (str<>"" && str.[0]='_') in
+    let s = String.length str in
+      if s>1 && char_is_int str.[1] then
+        let j = ref 2 in
+          while  !j<s && char_is_int str.[!j]  do incr j done;
+          Some (int_of_string (String.sub str 1 (!j-1)))
+      else
+        None
+
+let _ = (* A few unit tests *)
+  assert (get_int "_" = None);
+  assert (get_int "_toto" = None);
+  assert (get_int "_1" = Some 1);
+  assert (get_int "_1234" = Some 1234);
+  assert (get_int "_1234toto" = Some 1234)
+  
+module IntSet = 
+  Set.Make(struct
+             type t = int
+             let compare = compare
+           end)
+
+(* exported *)
+let (update_fresh_var_prefix : unit -> unit) =
+  fun _ ->
+    let used_ints = (* the set of ints apprearing after a "_" in program idents *)
+      Hashtbl.fold 
+        (fun name _ acc -> 
+           match get_int name with
+               None -> IntSet.add (-1) acc
+             | Some i -> IntSet.add i acc
+        )
+        ParserUtils.name_table
+        IntSet.empty
+    in
+    let used_ints = IntSet.elements used_ints in
+    let rec find_int l =
+      match l with 
+        | [] -> -1
+        | [i] -> if i > 0 then 0 else i+1
+        | i::j::tail -> if j=i+1 then find_int (j::tail) else i+1
+    in 
+    let index = find_int used_ints in
+      if index = (-1) then 
+        ()
+          (* no var begins by "_", so "_" is a good prefix.*)
+      else (
+        let new_prefix =  ("_" ^ (string_of_int index)) in
+          fresh_var_prefix := new_prefix ; 
+          if (Verbose.get_level()>1) then (
+            print_string ("I use " ^ new_prefix ^ " as prefix for fresh var names.\n");
+            flush stdout
+          )
+      )
+
+(********************************************************************************)
 (* 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);
-        "_" ^ prefix ^"_"^ (string_of_int cpt)
+        !fresh_var_prefix ^ prefix ^"_"^ (string_of_int cpt)
     with
         Not_found -> 
           Hashtbl.add local_var_tbl prefix 2;
-          "_" ^ prefix ^ "_1"
-    
+          !fresh_var_prefix ^ prefix ^ "_1"
+
+
 (********************************************************************************)
 
 let (array_type : Eff.type_ -> string -> string) =
diff --git a/src/name.mli b/src/name.mli
index 202a3642465500ad8f6ad25a346b36cdb9c51fb6..d23353948786339b54796a8229e4c0cc7fb1937d 100644
--- a/src/name.mli
+++ b/src/name.mli
@@ -1,12 +1,7 @@
-(** Time-stamp: <modified the 26/01/2009 (at 14:28) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/01/2010 (at 18:08) by Erwan Jahier> *)
 
 
-(** All new identifier names ougth to be created via this module.  
-
-    To avoid name clashes when inventing new identifiers, all user
-    program idents have been prefixed by "_". Hence, the new idents
-    generated here never begins with "_" and no clash is possible.
-*)
+(** All new identifier names ougth to be created via this module. *)
 
 (** [node_key nk name] returns a node ident that won't clash, using [name] or not. 
 
@@ -30,3 +25,7 @@ val reset_local_var_prefix : string -> unit
 
 (**  *)
 val array_type : Eff.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/parserUtils.ml b/src/parserUtils.ml
index 3edeefe1ba032230e8a0025a14062f06d9d1b973..c7054c063754a57bfeca50c6cf1228545fe1da36 100644
--- a/src/parserUtils.ml
+++ b/src/parserUtils.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 15/09/2008 (at 15:35) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/01/2010 (at 17:25) by Erwan Jahier> *)
 
 
 
@@ -145,11 +145,20 @@ open Ident
 
 (**********************************************************************************)
 (* Interface avec SyntaxTree *)
+
+(* we store ident names in a table to be able to generated fresh var
+   name that won't clash afterwards *)
+let (name_table : (string, unit) Hashtbl.t) = 
+  Hashtbl.create 0 
+
 let idref_of_lxm lxm =
-  try Lxm.flagit (Ident.idref_of_string (Lxm.str lxm)) lxm
-  with _ ->
-    print_string  ("Parser.idref_of_lxm" ^(Lxm.str lxm));
-    assert false
+  let name = (Lxm.str lxm) in
+    if name.[0] = '_' then (
+      Hashtbl.add name_table name ());
+    try Lxm.flagit (Ident.idref_of_string name) lxm
+    with _ ->
+      print_string  ("Parser.idref_of_lxm" ^(Lxm.str lxm));
+      assert false
 
 
 (**********************************************************************************)
diff --git a/src/syntaxTree.ml b/src/syntaxTree.ml
index e5e611ed1d35312fb2622d5cea1df8696acafd39..40702f8bb3bf451de2837d308ad0a8cd658b0a08 100644
--- a/src/syntaxTree.ml
+++ b/src/syntaxTree.ml
@@ -1,9 +1,9 @@
-(** Time-stamp: <modified the 23/10/2008 (at 10:51) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/01/2010 (at 14:30) by Erwan Jahier> *)
 
 
 (** (Raw) Abstract syntax tree of source programs. 
 
-    This syntax tree represented by Hash tables.
+    This is a syntax tree represented by Hash tables.
 *)
 
 open Printf
diff --git a/src/test/test.res.exp b/src/test/test.res.exp
index 55dde4f6635eda2f551c66970079853c04251377..ade758602afcd180d2b31c2258b5724e871a09a4 100644
--- a/src/test/test.res.exp
+++ b/src/test/test.res.exp
@@ -3262,6 +3262,7 @@ tel
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 should_work/NONREG/fresh_name.lus
 Opening file should_work/NONREG/fresh_name.lus
+I use _0 as prefix for fresh var names.
 --	 ../lus2lic -vl 2 should_work/NONREG/fresh_name.lus
 
 node fresh_name::n1(n1e1:bool; n1e2:bool) returns (n1s:bool);
@@ -3821,6 +3822,7 @@ tel
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 should_work/NONREG/model.lus
 Opening file should_work/NONREG/model.lus
+I use _0 as prefix for fresh var names.
 --	 ../lus2lic -vl 2 should_work/NONREG/model.lus
 
 node u::egal(i1:int; i2:int) returns (o:bool);
@@ -3843,6 +3845,7 @@ tel
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 should_work/NONREG/model2.lus
 Opening file should_work/NONREG/model2.lus
+I use _0 as prefix for fresh var names.
 --	 ../lus2lic -vl 2 should_work/NONREG/model2.lus
 
 type _p2::elementTypeBis = int;
@@ -20613,6 +20616,7 @@ type A_int_10 = int^10;
 ====> ../lus2lic -vl 2 should_work/packEnvTest/contractForElementSelectionInArray/main.lus
 Opening file should_work/packEnvTest/contractForElementSelectionInArray/main.lus
 Opening file should_work/packEnvTest/contractForElementSelectionInArray/packageTableau.lus
+I use _0 as prefix for fresh var names.
 --	 ../lus2lic -vl 2
 --		should_work/packEnvTest/contractForElementSelectionInArray/main.lus
 
@@ -20642,18 +20646,18 @@ node intArray::iterated_isElementOf_(
 returns (
 	acc_out:_intArray::T_isElementOf_);
 var
-   _v_2:bool;
-   _v_3:int;
-   _v_4:bool;
-   _v_5:bool;
-   _v_1:int;
+   _0v_2:bool;
+   _0v_3:int;
+   _0v_4:bool;
+   _0v_5:bool;
+   _0v_1:int;
 let
-   acc_out = _intArray::T_isElementOf_{eltToSearch=_v_1;iselementof=_v_5};
-   _v_2 = acc_in.iselementof;
-   _v_3 = acc_in.eltToSearch;
-   _v_4 = intArray::_isEqualTo_(_v_3, elt_in);
-   _v_5 = _v_2 or _v_4;
-   _v_1 = acc_in.eltToSearch;
+   acc_out = _intArray::T_isElementOf_{eltToSearch=_0v_1;iselementof=_0v_5};
+   _0v_2 = acc_in.iselementof;
+   _0v_3 = acc_in.eltToSearch;
+   _0v_4 = intArray::_isEqualTo_(_0v_3, elt_in);
+   _0v_5 = _0v_2 or _0v_4;
+   _0v_1 = acc_in.eltToSearch;
 tel
 -- end of node intArray::iterated_isElementOf_
 
@@ -20664,22 +20668,22 @@ returns (
 	iselementof:bool);
 var
    acc_out:_intArray::T_isElementOf_;
-   _v_1:_intArray::T_isElementOf_;
+   _0v_1:_intArray::T_isElementOf_;
 let
-   acc_out = red<<intArray::iterated_isElementOf_, 10>>(_v_1, t);
-   _v_1 = _intArray::T_isElementOf_{eltToSearch=e;iselementof=false};
+   acc_out = red<<intArray::iterated_isElementOf_, 10>>(_0v_1, t);
+   _0v_1 = _intArray::T_isElementOf_{eltToSearch=e;iselementof=false};
    iselementof = acc_out.iselementof;
 tel
 -- end of node intArray::_isElementOf_
 type _intArray::forSortingAlgo = struct  {previousElement : int; sortedUpToHere : bool};
 node intArray::_isGreaterOrEqualTo_(e1:int; e2:int) returns (ge:bool);
 var
-   _v_1:bool;
-   _v_2:bool;
+   _0v_1:bool;
+   _0v_2:bool;
 let
-   ge = _v_1 or _v_2;
-   _v_1 = intArray::_isGreaterThan_(e1, e2);
-   _v_2 = intArray::_isEqualTo_(e1, e2);
+   ge = _0v_1 or _0v_2;
+   _0v_1 = intArray::_isGreaterThan_(e1, e2);
+   _0v_2 = intArray::_isEqualTo_(e1, e2);
 tel
 -- end of node intArray::_isGreaterOrEqualTo_
 
@@ -20689,17 +20693,17 @@ node intArray::isLocallyLoselySorted(
 returns (
 	acc_out:_intArray::forSortingAlgo);
 var
-   _v_1:int;
-   _v_2:bool;
-   _v_3:bool;
-   _v_4:bool;
+   _0v_1:int;
+   _0v_2:bool;
+   _0v_3:bool;
+   _0v_4:bool;
 let
     acc_out =
-	 _intArray::forSortingAlgo{previousElement=elt;sortedUpToHere=_v_4};
-   _v_1 = acc_in.previousElement;
-   _v_2 = intArray::_isGreaterOrEqualTo_(elt, _v_1);
-   _v_3 = acc_in.sortedUpToHere;
-   _v_4 = _v_2 and _v_3;
+	 _intArray::forSortingAlgo{previousElement=elt;sortedUpToHere=_0v_4};
+   _0v_1 = acc_in.previousElement;
+   _0v_2 = intArray::_isGreaterOrEqualTo_(elt, _0v_1);
+   _0v_3 = acc_in.sortedUpToHere;
+   _0v_4 = _0v_2 and _0v_3;
 tel
 -- end of node intArray::isLocallyLoselySorted
 
@@ -20709,13 +20713,13 @@ returns (
 	array_isLoselySorted:bool);
 var
    result:_intArray::forSortingAlgo;
-   _v_1:int;
-   _v_2:_intArray::forSortingAlgo;
+   _0v_1:int;
+   _0v_2:_intArray::forSortingAlgo;
 let
-   result = red<<intArray::isLocallyLoselySorted, 10>>(_v_2, array);
-   _v_1 = array[0];
-    _v_2 =
-	 _intArray::forSortingAlgo{previousElement=_v_1;sortedUpToHere=true};
+   result = red<<intArray::isLocallyLoselySorted, 10>>(_0v_2, array);
+   _0v_1 = array[0];
+    _0v_2 =
+	 _intArray::forSortingAlgo{previousElement=_0v_1;sortedUpToHere=true};
    array_isLoselySorted = result.sortedUpToHere;
 tel
 -- end of node intArray::_isLoselySorted
@@ -20730,61 +20734,61 @@ node intArray::minFromRank(
 returns (
 	accu_out:_intArray::MinFR_accu);
 var
-   _v_25:int;
-   _v_26:int;
-   _v_24:int;
-   _v_14:int;
-   _v_15:int;
-   _v_16:bool;
-   _v_17:int;
-   _v_18:bool;
-   _v_19:int;
-   _v_20:int;
-   _v_21:int;
-   _v_22:int;
-   _v_23:int;
-   _v_1:int;
-   _v_2:int;
-   _v_3:bool;
-   _v_4:int;
-   _v_5:int;
-   _v_6:bool;
-   _v_7:int;
-   _v_8:bool;
-   _v_9:int;
-   _v_10:int;
-   _v_11:int;
-   _v_12:int;
-   _v_13:int;
+   _0v_25:int;
+   _0v_26:int;
+   _0v_24:int;
+   _0v_14:int;
+   _0v_15:int;
+   _0v_16:bool;
+   _0v_17:int;
+   _0v_18:bool;
+   _0v_19:int;
+   _0v_20:int;
+   _0v_21:int;
+   _0v_22:int;
+   _0v_23:int;
+   _0v_1:int;
+   _0v_2:int;
+   _0v_3:bool;
+   _0v_4:int;
+   _0v_5:int;
+   _0v_6:bool;
+   _0v_7:int;
+   _0v_8:bool;
+   _0v_9:int;
+   _0v_10:int;
+   _0v_11:int;
+   _0v_12:int;
+   _0v_13:int;
 let
     accu_out =
-	 _intArray::MinFR_accu{MinVal=_v_13;MinRank=_v_23;RankFrom=_v_24;Rank=_v_26};
-   _v_25 = accu_in.Rank;
-   _v_26 = _v_25 + 1;
-   _v_24 = accu_in.RankFrom;
-   _v_14 = accu_in.Rank;
-   _v_15 = accu_in.RankFrom;
-   _v_16 = _v_14 > _v_15;
-   _v_17 = accu_in.MinVal;
-   _v_18 = TabEltIn < _v_17;
-   _v_19 = accu_in.Rank;
-   _v_20 = accu_in.MinRank;
-   _v_21 =  if _v_18 then _v_19 else _v_20;
-   _v_22 = accu_in.MinRank;
-   _v_23 =  if _v_16 then _v_21 else _v_22;
-   _v_1 = accu_in.Rank;
-   _v_2 = accu_in.RankFrom;
-   _v_3 = _v_1 <= _v_2;
-   _v_4 = accu_in.Rank;
-   _v_5 = accu_in.RankFrom;
-   _v_6 = _v_4 >= _v_5;
-   _v_7 = accu_in.MinVal;
-   _v_8 = TabEltIn < _v_7;
-   _v_9 = accu_in.MinVal;
-   _v_10 =  if _v_8 then TabEltIn else _v_9;
-   _v_11 = accu_in.MinVal;
-   _v_12 =  if _v_6 then _v_10 else _v_11;
-   _v_13 =  if _v_3 then TabEltIn else _v_12;
+	 _intArray::MinFR_accu{MinVal=_0v_13;MinRank=_0v_23;RankFrom=_0v_24;Rank=_0v_26};
+   _0v_25 = accu_in.Rank;
+   _0v_26 = _0v_25 + 1;
+   _0v_24 = accu_in.RankFrom;
+   _0v_14 = accu_in.Rank;
+   _0v_15 = accu_in.RankFrom;
+   _0v_16 = _0v_14 > _0v_15;
+   _0v_17 = accu_in.MinVal;
+   _0v_18 = TabEltIn < _0v_17;
+   _0v_19 = accu_in.Rank;
+   _0v_20 = accu_in.MinRank;
+   _0v_21 =  if _0v_18 then _0v_19 else _0v_20;
+   _0v_22 = accu_in.MinRank;
+   _0v_23 =  if _0v_16 then _0v_21 else _0v_22;
+   _0v_1 = accu_in.Rank;
+   _0v_2 = accu_in.RankFrom;
+   _0v_3 = _0v_1 <= _0v_2;
+   _0v_4 = accu_in.Rank;
+   _0v_5 = accu_in.RankFrom;
+   _0v_6 = _0v_4 >= _0v_5;
+   _0v_7 = accu_in.MinVal;
+   _0v_8 = TabEltIn < _0v_7;
+   _0v_9 = accu_in.MinVal;
+   _0v_10 =  if _0v_8 then TabEltIn else _0v_9;
+   _0v_11 = accu_in.MinVal;
+   _0v_12 =  if _0v_6 then _0v_10 else _0v_11;
+   _0v_13 =  if _0v_3 then TabEltIn else _0v_12;
 tel
 -- end of node intArray::minFromRank
 
@@ -20794,25 +20798,25 @@ node intArray::select(
 returns (
 	accu_out:_intArray::Select_accu);
 var
-   _v_4:int;
-   _v_5:int;
-   _v_6:bool;
-   _v_7:int;
-   _v_8:int;
-   _v_2:int;
-   _v_3:int;
-   _v_1:int;
+   _0v_4:int;
+   _0v_5:int;
+   _0v_6:bool;
+   _0v_7:int;
+   _0v_8:int;
+   _0v_2:int;
+   _0v_3:int;
+   _0v_1:int;
 let
     accu_out =
-	 _intArray::Select_accu{RankToFind=_v_1;CurrentRank=_v_3;Val=_v_8};
-   _v_4 = accu_in.RankToFind;
-   _v_5 = accu_in.CurrentRank;
-   _v_6 = _v_4 = _v_5;
-   _v_7 = accu_in.Val;
-   _v_8 =  if _v_6 then elt else _v_7;
-   _v_2 = accu_in.CurrentRank;
-   _v_3 = _v_2 + 1;
-   _v_1 = accu_in.RankToFind;
+	 _intArray::Select_accu{RankToFind=_0v_1;CurrentRank=_0v_3;Val=_0v_8};
+   _0v_4 = accu_in.RankToFind;
+   _0v_5 = accu_in.CurrentRank;
+   _0v_6 = _0v_4 = _0v_5;
+   _0v_7 = accu_in.Val;
+   _0v_8 =  if _0v_6 then elt else _0v_7;
+   _0v_2 = accu_in.CurrentRank;
+   _0v_3 = _0v_2 + 1;
+   _0v_1 = accu_in.RankToFind;
 tel
 -- end of node intArray::select
 
@@ -20823,40 +20827,40 @@ returns (
 	accu_out:_intArray::Exchange_accu;
 	eltOut:int);
 var
-   _v_5:int;
-   _v_6:int;
-   _v_4:int;
-   _v_3:int;
-   _v_2:int;
-   _v_1:int;
-   _v_7:int;
-   _v_8:int;
-   _v_9:bool;
-   _v_10:int;
-   _v_11:int;
-   _v_12:int;
-   _v_13:bool;
-   _v_14:int;
-   _v_15:int;
+   _0v_5:int;
+   _0v_6:int;
+   _0v_4:int;
+   _0v_3:int;
+   _0v_2:int;
+   _0v_1:int;
+   _0v_7:int;
+   _0v_8:int;
+   _0v_9:bool;
+   _0v_10:int;
+   _0v_11:int;
+   _0v_12:int;
+   _0v_13:bool;
+   _0v_14:int;
+   _0v_15:int;
 let
     accu_out =
-	 _intArray::Exchange_accu{MinVal=_v_1;MinRank=_v_2;RankFrom=_v_3;CurrentVal=_v_4;Rank=_v_6};
-   _v_5 = accu_in.Rank;
-   _v_6 = _v_5 + 1;
-   _v_4 = accu_in.CurrentVal;
-   _v_3 = accu_in.RankFrom;
-   _v_2 = accu_in.MinRank;
-   _v_1 = accu_in.MinVal;
-   eltOut =  if _v_9 then _v_10 else _v_15;
-   _v_7 = accu_in.Rank;
-   _v_8 = accu_in.MinRank;
-   _v_9 = _v_7 = _v_8;
-   _v_10 = accu_in.CurrentVal;
-   _v_11 = accu_in.Rank;
-   _v_12 = accu_in.RankFrom;
-   _v_13 = _v_11 = _v_12;
-   _v_14 = accu_in.MinVal;
-   _v_15 =  if _v_13 then _v_14 else eltIn;
+	 _intArray::Exchange_accu{MinVal=_0v_1;MinRank=_0v_2;RankFrom=_0v_3;CurrentVal=_0v_4;Rank=_0v_6};
+   _0v_5 = accu_in.Rank;
+   _0v_6 = _0v_5 + 1;
+   _0v_4 = accu_in.CurrentVal;
+   _0v_3 = accu_in.RankFrom;
+   _0v_2 = accu_in.MinRank;
+   _0v_1 = accu_in.MinVal;
+   eltOut =  if _0v_9 then _0v_10 else _0v_15;
+   _0v_7 = accu_in.Rank;
+   _0v_8 = accu_in.MinRank;
+   _0v_9 = _0v_7 = _0v_8;
+   _0v_10 = accu_in.CurrentVal;
+   _0v_11 = accu_in.Rank;
+   _0v_12 = accu_in.RankFrom;
+   _0v_13 = _0v_11 = _0v_12;
+   _0v_14 = accu_in.MinVal;
+   _0v_15 =  if _0v_13 then _0v_14 else eltIn;
 tel
 -- end of node intArray::Exchange_i_j
 
@@ -20870,61 +20874,62 @@ var
    accu_out_min:_intArray::MinFR_accu;
    accu_out_exchange:_intArray::Exchange_accu;
    localTab:A_int_10;
-   _v_2:int;
-   _v_1:int;
-   _v_3:_intArray::MinFR_accu;
-   _v_4:A_int_10;
-   _v_5:int;
-   _v_6:_intArray::Select_accu;
-   _v_7:A_int_10;
-   _v_11:int;
-   _v_10:int;
-   _v_9:int;
-   _v_8:int;
-   _v_12:_intArray::Exchange_accu;
-   _v_13:A_int_10;
-   _v_14:int;
-   _v_15:int;
-let
-   accu_out_min = red<<intArray::minFromRank, 10>>(_v_3, _v_4);
-   _v_2 = accu_in.CurrentRank;
-   _v_1 = accu_in.CurrentRank;
-   _v_3 = _intArray::MinFR_accu{MinVal=0;MinRank=_v_1;RankFrom=_v_2;Rank=0};
-   _v_4 = accu_in.Tab;
-   accu_out_select = red<<intArray::select, 10>>(_v_6, _v_7);
-   _v_5 = accu_in.CurrentRank;
-   _v_6 = _intArray::Select_accu{RankToFind=_v_5;CurrentRank=0;Val=0};
-   _v_7 = accu_in.Tab;
+   _0v_2:int;
+   _0v_1:int;
+   _0v_3:_intArray::MinFR_accu;
+   _0v_4:A_int_10;
+   _0v_5:int;
+   _0v_6:_intArray::Select_accu;
+   _0v_7:A_int_10;
+   _0v_11:int;
+   _0v_10:int;
+   _0v_9:int;
+   _0v_8:int;
+   _0v_12:_intArray::Exchange_accu;
+   _0v_13:A_int_10;
+   _0v_14:int;
+   _0v_15:int;
+let
+   accu_out_min = red<<intArray::minFromRank, 10>>(_0v_3, _0v_4);
+   _0v_2 = accu_in.CurrentRank;
+   _0v_1 = accu_in.CurrentRank;
+    _0v_3 =
+	 _intArray::MinFR_accu{MinVal=0;MinRank=_0v_1;RankFrom=_0v_2;Rank=0};
+   _0v_4 = accu_in.Tab;
+   accu_out_select = red<<intArray::select, 10>>(_0v_6, _0v_7);
+   _0v_5 = accu_in.CurrentRank;
+   _0v_6 = _intArray::Select_accu{RankToFind=_0v_5;CurrentRank=0;Val=0};
+   _0v_7 = accu_in.Tab;
     (accu_out_exchange, localTab) = fillred<<intArray::Exchange_i_j,
-	 10>>(_v_12, _v_13);
-   _v_11 = accu_out_select.Val;
-   _v_10 = accu_out_select.RankToFind;
-   _v_9 = accu_out_min.MinRank;
-   _v_8 = accu_out_min.MinVal;
-    _v_12 =
-	 _intArray::Exchange_accu{MinVal=_v_8;MinRank=_v_9;RankFrom=_v_10;CurrentVal=_v_11;Rank=0};
-   _v_13 = accu_in.Tab;
-   accu_out = _intArray::Sort_accu{CurrentRank=_v_15;Tab=localTab};
-   _v_14 = accu_in.CurrentRank;
-   _v_15 = _v_14 + 1;
+	 10>>(_0v_12, _0v_13);
+   _0v_11 = accu_out_select.Val;
+   _0v_10 = accu_out_select.RankToFind;
+   _0v_9 = accu_out_min.MinRank;
+   _0v_8 = accu_out_min.MinVal;
+    _0v_12 =
+	 _intArray::Exchange_accu{MinVal=_0v_8;MinRank=_0v_9;RankFrom=_0v_10;CurrentVal=_0v_11;Rank=0};
+   _0v_13 = accu_in.Tab;
+   accu_out = _intArray::Sort_accu{CurrentRank=_0v_15;Tab=localTab};
+   _0v_14 = accu_in.CurrentRank;
+   _0v_15 = _0v_14 + 1;
 tel
 -- end of node intArray::UnarySort
 node intArray::sort_(array:A_int_10) returns (arraySorted:A_int_10);
 var
    UnarySort_accu_out:_intArray::Sort_accu;
-   _v_1:_intArray::Sort_accu;
+   _0v_1:_intArray::Sort_accu;
 let
-   UnarySort_accu_out = red<<intArray::UnarySort, 10>>(_v_1, array);
-   _v_1 = _intArray::Sort_accu{CurrentRank=0;Tab=array};
+   UnarySort_accu_out = red<<intArray::UnarySort, 10>>(_0v_1, array);
+   _0v_1 = _intArray::Sort_accu{CurrentRank=0;Tab=array};
    arraySorted = UnarySort_accu_out.Tab;
 tel
 -- end of node intArray::sort_
 node intArray::selectMax(e1:int; e2:int) returns (e:int);
 var
-   _v_1:bool;
+   _0v_1:bool;
 let
-   e =  if _v_1 then e1 else e2;
-   _v_1 = intArray::_isGreaterThan_(e1, e2);
+   e =  if _0v_1 then e1 else e2;
+   _0v_1 = intArray::_isGreaterThan_(e1, e2);
 tel
 -- end of node intArray::selectMax
 
@@ -20933,10 +20938,10 @@ node intArray::getMaximumIn_(
 returns (
 	maximumElement:int);
 var
-   _v_1:int;
+   _0v_1:int;
 let
-   maximumElement = red<<intArray::selectMax, 10>>(_v_1, array);
-   _v_1 = array[0];
+   maximumElement = red<<intArray::selectMax, 10>>(_0v_1, array);
+   _0v_1 = array[0];
 tel
 -- end of node intArray::getMaximumIn_
 type _intArray::iteratedStruct = struct  {currentRank : int; rankToSelect : int; elementSelected : int};
@@ -20947,25 +20952,25 @@ node intArray::selectOneStage(
 returns (
 	acc_out:_intArray::iteratedStruct);
 var
-   _v_4:int;
-   _v_5:int;
-   _v_6:bool;
-   _v_7:int;
-   _v_8:int;
-   _v_3:int;
-   _v_1:int;
-   _v_2:int;
+   _0v_4:int;
+   _0v_5:int;
+   _0v_6:bool;
+   _0v_7:int;
+   _0v_8:int;
+   _0v_3:int;
+   _0v_1:int;
+   _0v_2:int;
 let
     acc_out =
-	 _intArray::iteratedStruct{currentRank=_v_2;rankToSelect=_v_3;elementSelected=_v_8};
-   _v_4 = acc_in.currentRank;
-   _v_5 = acc_in.rankToSelect;
-   _v_6 = _v_4 = _v_5;
-   _v_7 = acc_in.elementSelected;
-   _v_8 =  if _v_6 then currentElt else _v_7;
-   _v_3 = acc_in.rankToSelect;
-   _v_1 = acc_in.currentRank;
-   _v_2 = _v_1 + 1;
+	 _intArray::iteratedStruct{currentRank=_0v_2;rankToSelect=_0v_3;elementSelected=_0v_8};
+   _0v_4 = acc_in.currentRank;
+   _0v_5 = acc_in.rankToSelect;
+   _0v_6 = _0v_4 = _0v_5;
+   _0v_7 = acc_in.elementSelected;
+   _0v_8 =  if _0v_6 then currentElt else _0v_7;
+   _0v_3 = acc_in.rankToSelect;
+   _0v_1 = acc_in.currentRank;
+   _0v_2 = _0v_1 + 1;
 tel
 -- end of node intArray::selectOneStage
 
@@ -20976,22 +20981,22 @@ returns (
 	elementSelected:int);
 var
    iterationResult:_intArray::iteratedStruct;
-   _v_1:int;
-   _v_2:_intArray::iteratedStruct;
+   _0v_1:int;
+   _0v_2:_intArray::iteratedStruct;
 let
-   iterationResult = red<<intArray::selectOneStage, 10>>(_v_2, array);
-   _v_1 = array[0];
-    _v_2 =
-	 _intArray::iteratedStruct{currentRank=0;rankToSelect=rankToSelect;elementSelected=_v_1};
+   iterationResult = red<<intArray::selectOneStage, 10>>(_0v_2, array);
+   _0v_1 = array[0];
+    _0v_2 =
+	 _intArray::iteratedStruct{currentRank=0;rankToSelect=rankToSelect;elementSelected=_0v_1};
    elementSelected = iterationResult.elementSelected;
 tel
 -- end of node intArray::selectElementOfRank_inArray_
 node intArray::selectMin(e1:int; e2:int) returns (e:int);
 var
-   _v_1:bool;
+   _0v_1:bool;
 let
-   e =  if _v_1 then e2 else e1;
-   _v_1 = intArray::_isGreaterThan_(e1, e2);
+   e =  if _0v_1 then e2 else e1;
+   _0v_1 = intArray::_isGreaterThan_(e1, e2);
 tel
 -- end of node intArray::selectMin
 
@@ -21014,31 +21019,31 @@ node intArray::selectMaxRank(
 returns (
 	acc_out:_intArray::currentRank_withMemorizedRank);
 var
-   _v_8:int;
-   _v_9:bool;
-   _v_10:int;
-   _v_11:int;
-   _v_3:int;
-   _v_4:bool;
-   _v_5:int;
-   _v_6:int;
-   _v_7:int;
-   _v_1:int;
-   _v_2:int;
+   _0v_8:int;
+   _0v_9:bool;
+   _0v_10:int;
+   _0v_11:int;
+   _0v_3:int;
+   _0v_4:bool;
+   _0v_5:int;
+   _0v_6:int;
+   _0v_7:int;
+   _0v_1:int;
+   _0v_2:int;
 let
     acc_out =
-	 _intArray::currentRank_withMemorizedRank{currentRank=_v_2;rankOfMemorizedVal=_v_7;memorizedVal=_v_11};
-   _v_8 = acc_in.memorizedVal;
-   _v_9 = intArray::_isGreaterThan_(e1, _v_8);
-   _v_10 = acc_in.memorizedVal;
-   _v_11 =  if _v_9 then e1 else _v_10;
-   _v_3 = acc_in.memorizedVal;
-   _v_4 = intArray::_isGreaterThan_(e1, _v_3);
-   _v_5 = acc_in.currentRank;
-   _v_6 = acc_in.rankOfMemorizedVal;
-   _v_7 =  if _v_4 then _v_5 else _v_6;
-   _v_1 = acc_in.currentRank;
-   _v_2 = _v_1 + 1;
+	 _intArray::currentRank_withMemorizedRank{currentRank=_0v_2;rankOfMemorizedVal=_0v_7;memorizedVal=_0v_11};
+   _0v_8 = acc_in.memorizedVal;
+   _0v_9 = intArray::_isGreaterThan_(e1, _0v_8);
+   _0v_10 = acc_in.memorizedVal;
+   _0v_11 =  if _0v_9 then e1 else _0v_10;
+   _0v_3 = acc_in.memorizedVal;
+   _0v_4 = intArray::_isGreaterThan_(e1, _0v_3);
+   _0v_5 = acc_in.currentRank;
+   _0v_6 = acc_in.rankOfMemorizedVal;
+   _0v_7 =  if _0v_4 then _0v_5 else _0v_6;
+   _0v_1 = acc_in.currentRank;
+   _0v_2 = _0v_1 + 1;
 tel
 -- end of node intArray::selectMaxRank
 
@@ -21048,13 +21053,13 @@ returns (
 	rankOfMaximumElement:int);
 var
    local:_intArray::currentRank_withMemorizedRank;
-   _v_1:int;
-   _v_2:_intArray::currentRank_withMemorizedRank;
+   _0v_1:int;
+   _0v_2:_intArray::currentRank_withMemorizedRank;
 let
-   local = red<<intArray::selectMaxRank, 10>>(_v_2, array);
-   _v_1 = array[0];
-    _v_2 =
-	 _intArray::currentRank_withMemorizedRank{currentRank=0;rankOfMemorizedVal=0;memorizedVal=_v_1};
+   local = red<<intArray::selectMaxRank, 10>>(_0v_2, array);
+   _0v_1 = array[0];
+    _0v_2 =
+	 _intArray::currentRank_withMemorizedRank{currentRank=0;rankOfMemorizedVal=0;memorizedVal=_0v_1};
    rankOfMaximumElement = local.rankOfMemorizedVal;
 tel
 -- end of node intArray::getRank_ofMaximumIn_
@@ -21065,25 +21070,25 @@ node intArray::selectMinRank(
 returns (
 	acc_out:_intArray::currentRank_withMemorizedRank);
 var
-   _v_8:int;
-   _v_3:int;
-   _v_4:bool;
-   _v_5:int;
-   _v_6:int;
-   _v_7:int;
-   _v_1:int;
-   _v_2:int;
+   _0v_8:int;
+   _0v_3:int;
+   _0v_4:bool;
+   _0v_5:int;
+   _0v_6:int;
+   _0v_7:int;
+   _0v_1:int;
+   _0v_2:int;
 let
     acc_out =
-	 _intArray::currentRank_withMemorizedRank{currentRank=_v_2;rankOfMemorizedVal=_v_7;memorizedVal=_v_8};
-   _v_8 = acc_in.memorizedVal;
-   _v_3 = acc_in.memorizedVal;
-   _v_4 = intArray::_isEqualTo_(_v_3, elt);
-   _v_5 = acc_in.currentRank;
-   _v_6 = acc_in.rankOfMemorizedVal;
-   _v_7 =  if _v_4 then _v_5 else _v_6;
-   _v_1 = acc_in.currentRank;
-   _v_2 = _v_1 + 1;
+	 _intArray::currentRank_withMemorizedRank{currentRank=_0v_2;rankOfMemorizedVal=_0v_7;memorizedVal=_0v_8};
+   _0v_8 = acc_in.memorizedVal;
+   _0v_3 = acc_in.memorizedVal;
+   _0v_4 = intArray::_isEqualTo_(_0v_3, elt);
+   _0v_5 = acc_in.currentRank;
+   _0v_6 = acc_in.rankOfMemorizedVal;
+   _0v_7 =  if _0v_4 then _0v_5 else _0v_6;
+   _0v_1 = acc_in.currentRank;
+   _0v_2 = _0v_1 + 1;
 tel
 -- end of node intArray::selectMinRank
 
@@ -21093,14 +21098,14 @@ returns (
 	rankOfMinimumElement:int);
 var
    minElement:int;
-   _v_1:_intArray::currentRank_withMemorizedRank;
-   _v_2:_intArray::currentRank_withMemorizedRank;
+   _0v_1:_intArray::currentRank_withMemorizedRank;
+   _0v_2:_intArray::currentRank_withMemorizedRank;
 let
    minElement = intArray::getMinimumIn_(array);
-   rankOfMinimumElement = _v_2.rankOfMemorizedVal;
-    _v_1 =
+   rankOfMinimumElement = _0v_2.rankOfMemorizedVal;
+    _0v_1 =
 	 _intArray::currentRank_withMemorizedRank{currentRank=0;rankOfMemorizedVal=0;memorizedVal=minElement};
-   _v_2 = red<<intArray::selectMinRank, 10>>(_v_1, array);
+   _0v_2 = red<<intArray::selectMinRank, 10>>(_0v_1, array);
 tel
 -- end of node intArray::getRank_ofMinimumIn_
 
@@ -21142,6 +21147,7 @@ tel
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 should_work/packEnvTest/contractForElementSelectionInArray/packageTableau.lus
 Opening file should_work/packEnvTest/contractForElementSelectionInArray/packageTableau.lus
+I use _0 as prefix for fresh var names.
 --	 ../lus2lic -vl 2
 --		should_work/packEnvTest/contractForElementSelectionInArray/packageTableau.lus
 
@@ -22187,22 +22193,23 @@ const const3::pi = 3.1416;
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 should_fail/semantics/cpt_dc.lus
 Opening file should_fail/semantics/cpt_dc.lus
+I use _0 as prefix for fresh var names.
 --	 ../lus2lic -vl 2 should_fail/semantics/cpt_dc.lus
 
 node cpt_dc::cpt_dc(evt:bool; reset:bool) returns (cpt:int);
 var
    _f3:bool;
    _f4:int;
-   _v_1:int;
-   _v_2:int;
-   _v_3:int;
+   _0v_1:int;
+   _0v_2:int;
+   _0v_3:int;
 let
    _f3 = false;
    _f4 = cpt;
-   cpt =  if reset then 0 else _v_3;
-   _v_1 =  if _f3 then 0 else _f4;
-   _v_2 =  if evt then 1 else 0;
-   _v_3 = _v_1 + _v_2;
+   cpt =  if reset then 0 else _0v_3;
+   _0v_1 =  if _f3 then 0 else _f4;
+   _0v_2 =  if evt then 1 else 0;
+   _0v_3 = _0v_1 + _0v_2;
 tel
 -- end of node cpt_dc::cpt_dc