From 8b898b3c4bcae0a084c8cf78e8897708c5435299 Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Thu, 17 Jan 2013 10:47:52 +0100
Subject: [PATCH] Unplug the L2lAliasType pass as it breaks a lot of test (and
 looks useless).

Remove all test that now passes from the broken dir.
---
 src/ast2lic.ml                                |   2 +-
 src/compile.ml                                |   4 +-
 src/evalClock.ml                              | 322 ++++++------
 src/evalType.ml                               | 494 +++++++++---------
 src/l2lAliasType.ml                           |  50 +-
 src/lic.ml                                    |   5 +-
 src/unifyClock.ml                             | 195 ++++---
 src/unifyClock.mli                            |  27 +-
 test/lus2lic.sum                              | 181 ++++---
 test/lus2lic.time                             |   4 +-
 test/should_work/{broken => }/Condact.lus     |   0
 .../contractForElementSelectionInArray.lus    |   0
 test/should_work/{broken => }/decl.lus        |   0
 test/should_work/{broken => }/enum0.lus       |   0
 test/should_work/{broken => }/lustre.lus      |   0
 .../should_work/{broken => }/map_red_iter.lus |   0
 test/should_work/{broken => }/model.lus       |   0
 test/should_work/{broken => }/model2.lus      |   0
 test/should_work/{broken => }/modelInst.lus   |   0
 test/should_work/{broken => }/newpacks.lus    |   0
 test/should_work/{broken => }/nodeparam.lus   |   0
 test/should_work/{broken => }/normal.lus      |   0
 test/should_work/{broken => }/over3.lus       |   0
 test/should_work/{broken => }/p.lus           |   0
 test/should_work/{broken => }/packs.lus       |   0
 .../{broken => }/parametric_node2.lus         |   0
 test/should_work/{broken => }/ply01.lus       |   0
 .../{broken => }/polymorphic_pack.lus         |   0
 test/should_work/{broken => }/simple.lus      |   0
 test/should_work/{broken => }/test_clash.lus  |   0
 test/should_work/{broken => }/toolate.lus     |   0
 {bug => test/should_work}/triSel.lus          |   0
 test/should_work/{broken => }/type_decl.lus   |   0
 test/site.exp                                 |   1 +
 todo.org                                      | 182 ++++---
 todo.org_archive                              |  64 +++
 36 files changed, 836 insertions(+), 695 deletions(-)
 rename test/should_work/{broken => }/Condact.lus (100%)
 rename test/should_work/{broken => }/contractForElementSelectionInArray.lus (100%)
 rename test/should_work/{broken => }/decl.lus (100%)
 rename test/should_work/{broken => }/enum0.lus (100%)
 rename test/should_work/{broken => }/lustre.lus (100%)
 rename test/should_work/{broken => }/map_red_iter.lus (100%)
 rename test/should_work/{broken => }/model.lus (100%)
 rename test/should_work/{broken => }/model2.lus (100%)
 rename test/should_work/{broken => }/modelInst.lus (100%)
 rename test/should_work/{broken => }/newpacks.lus (100%)
 rename test/should_work/{broken => }/nodeparam.lus (100%)
 rename test/should_work/{broken => }/normal.lus (100%)
 rename test/should_work/{broken => }/over3.lus (100%)
 rename test/should_work/{broken => }/p.lus (100%)
 rename test/should_work/{broken => }/packs.lus (100%)
 rename test/should_work/{broken => }/parametric_node2.lus (100%)
 rename test/should_work/{broken => }/ply01.lus (100%)
 rename test/should_work/{broken => }/polymorphic_pack.lus (100%)
 rename test/should_work/{broken => }/simple.lus (100%)
 rename test/should_work/{broken => }/test_clash.lus (100%)
 rename test/should_work/{broken => }/toolate.lus (100%)
 rename {bug => test/should_work}/triSel.lus (100%)
 rename test/should_work/{broken => }/type_decl.lus (100%)

diff --git a/src/ast2lic.ml b/src/ast2lic.ml
index fa99c6a0..551e8375 100644
--- a/src/ast2lic.ml
+++ b/src/ast2lic.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 21/12/2012 (at 10:12) by Erwan Jahier> *)
+(* Time-stamp: <modified the 17/01/2013 (at 10:46) by Erwan Jahier> *)
 
 
 open Lxm
diff --git a/src/compile.ml b/src/compile.ml
index 1e751ec5..a03e36fb 100644
--- a/src/compile.ml
+++ b/src/compile.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 16/01/2013 (at 18:14) by Erwan Jahier> *)
+(* Time-stamp: <modified the 17/01/2013 (at 10:39) by Erwan Jahier> *)
 
 
 open Lxm
@@ -43,7 +43,7 @@ let (doit : AstV6.pack_or_model list -> Ident.idref option -> LicPrg.t) =
     (* élimination polymorphisme  surcharge *)
     let zelic = L2lRmPoly.doit zelic in
     (* alias des types array *)
-    let zelic = L2lAliasType.doit zelic in
+(*     let zelic = L2lAliasType.doit zelic in *)
     let zelic = if not !Global.inline_iterator then zelic else
         (* Array and struct expansion: to do after polymorphism elimination *)
         L2lExpandMetaOp.doit zelic 
diff --git a/src/evalClock.ml b/src/evalClock.ml
index 2dabf462..f6755949 100644
--- a/src/evalClock.ml
+++ b/src/evalClock.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 13/12/2012 (at 11:32) by Erwan Jahier> *)
+(* Time-stamp: <modified the 18/01/2013 (at 08:32) by Erwan Jahier> *)
  
   
 open AstPredef
@@ -26,7 +26,7 @@ open UnifyClock
     headers.
 
 
-   ** clock checking of expression. 
+   ** clock checking of expressions. 
 
    nb:
    In the following, we speak about input/output arguments/parameters of an 
@@ -104,24 +104,24 @@ let (check_args : Lxm.t -> subst -> Lic.id_clock list -> Lic.id_clock list -> su
 
 let rec (var_info_eff_of_left_eff: Lic.left -> Lic.var_info) =
   function
-  | LeftVarLic   (v, _) -> v
-  | LeftFieldLic (l, id,_) -> 
+    | LeftVarLic   (v, _) -> v
+    | LeftFieldLic (l, id,_) -> 
       let v = var_info_eff_of_left_eff l in
       let new_name = (Ident.to_string v.var_name_eff) ^ "." ^ (Ident.to_string id) in
-        { v with  var_name_eff = Ident.of_string new_name }
+      { v with  var_name_eff = Ident.of_string new_name }
 
-  | LeftArrayLic (l,i,_) -> 
+    | LeftArrayLic (l,i,_) -> 
       let v = var_info_eff_of_left_eff l in
       let new_name = (Ident.to_string v.var_name_eff) ^ "[" ^ 
         (string_of_int i) ^ "]" 
       in
-        { v with  var_name_eff = Ident.of_string new_name }
+      { v with  var_name_eff = Ident.of_string new_name }
 
-  | LeftSliceLic (l,si,_) -> 
+    | LeftSliceLic (l,si,_) -> 
       let v = var_info_eff_of_left_eff l in
       let new_name = (Ident.to_string v.var_name_eff) ^ (LicDump.string_of_slice_info_eff si)
       in
-        { v with  var_name_eff = Ident.of_string new_name }
+      { v with  var_name_eff = Ident.of_string new_name }
 
 
 let var_info_eff_to_clock_eff v = v.var_clock_eff
@@ -181,7 +181,7 @@ let ci2str = LicDump.string_of_clock2
 
     
 let rec (f : Lxm.t -> Lic.id_solver -> subst -> Lic.val_exp -> Lic.clock list -> 
-          Lic.val_exp * Lic.id_clock list * subst) =
+         Lic.val_exp * Lic.id_clock list * subst) =
   fun lxm id_solver s ve exp_clks ->
     (* we split f so that we can reinit the fresh clock var generator *)
     let ve, inf_clks, s = f_aux id_solver s ve in
@@ -196,191 +196,191 @@ let rec (f : Lxm.t -> Lic.id_solver -> subst -> Lic.val_exp -> Lic.clock list ->
     let inf_clks = List.map (fun (id,clk) -> id, apply_subst2 s clk) inf_clks in
     let clks = snd (List.split inf_clks) in
     let ve = { ve with ve_clk = clks } in
-      Verbose.print_string ~level:3 (
-        "Clocking the expression '" ^ (LicDump.string_of_val_exp_eff ve) ^"': "^ 
-          (LicDump.string_of_clock2 (List.hd clks)) ^"\n");
-      ve, inf_clks, s
+    Verbose.print_string ~level:3 (
+      "Clocking the expression '" ^ (LicDump.string_of_val_exp_eff ve) ^"': "^ 
+        (LicDump.string_of_clock2 (List.hd clks)) ^"\n");
+    ve, inf_clks, s
       
 
 
 and f_aux id_solver s ve =
-    let (cel, s), lxm = 
-      match ve.ve_core with
-        | CallByPosLic ({it=posop; src=lxm}, OperLic args) ->
-            eval_by_pos_clock id_solver posop lxm args s, lxm
-              
-        | CallByNameLic ({it=nmop; src=lxm}, nmargs ) ->
-            try eval_by_name_clock id_solver nmop lxm nmargs s, lxm
-            with EvalConst_error msg ->
-              raise (Compile_error(lxm, "\n*** can't eval constant: "^msg))
-    in
-    let new_clk = snd (List.split cel) in
-    let s, ve = 
-      if ve.ve_clk = [] then (s, { ve with ve_clk = new_clk }) else
-        let s = List.fold_left2 (UnifyClock.f lxm) s ve.ve_clk new_clk in
-          s, ve
-    in
-      apply_subst_val_exp s ve, cel, s
+  let (cel, s), lxm = 
+    match ve.ve_core with
+      | CallByPosLic ({it=posop; src=lxm}, OperLic args) ->
+        eval_by_pos_clock id_solver posop lxm args s, lxm
+          
+      | CallByNameLic ({it=nmop; src=lxm}, nmargs ) ->
+        try eval_by_name_clock id_solver nmop lxm nmargs s, lxm
+        with EvalConst_error msg ->
+          raise (Compile_error(lxm, "\n*** can't eval constant: "^msg))
+  in
+  let new_clk = snd (List.split cel) in
+  let s, ve = 
+    if ve.ve_clk = [] then (s, { ve with ve_clk = new_clk }) else
+      let s = List.fold_left2 (UnifyClock.f lxm) s ve.ve_clk new_clk in
+      s, ve
+  in
+  apply_subst_val_exp s ve, cel, s
 
 (* iterate f on a list of expressions *)
 and (f_list : Lic.id_solver -> subst -> Lic.val_exp list -> 
-      Lic.val_exp list * Lic.id_clock list list * subst) =
+     Lic.val_exp list * Lic.id_clock list list * subst) =
   fun id_solver s args ->
     let aux (args,acc,s) arg =
       let arg, cil, s = f_aux id_solver s arg in 
-        (arg::args, cil::acc, s)
+      (arg::args, cil::acc, s)
     in
     let (args, cil, s) = List.fold_left aux ([],[],s) args in
     let args = List.rev args in
     let cil = List.rev cil in
     let cil = List.map (List.map(fun (id,clk) -> id, apply_subst2 s clk)) cil in
-      args, cil, s
+    args, cil, s
 
 and (eval_by_pos_clock : Lic.id_solver -> Lic.by_pos_op -> Lxm.t -> Lic.val_exp list ->
-      subst -> Lic.id_clock list * subst) =
+     subst -> Lic.id_clock list * subst) =
   fun id_solver posop lxm args s ->
     let apply_subst s (id,clk) = id, UnifyClock.apply_subst s clk in
     match posop,args with
       | Lic.CURRENT,args -> ( (* we return the clock of the argument *)
-          let _args, clocks_of_args, s = f_list id_solver s args in
-          let current_clock = function
-            | (id, BaseLic) -> (id, BaseLic)
-            | (id, On(_,clk)) -> (id, clk)
-            | (_, ClockVar _) -> assert false
-          in
-            List.map current_clock (List.flatten clocks_of_args), s
-        )
+        let _args, clocks_of_args, s = f_list id_solver s args in
+        let current_clock = function
+          | (id, BaseLic) -> (id, BaseLic)
+          | (id, On(_,clk)) -> (id, clk)
+          | (_, ClockVar _) -> assert false
+        in
+        List.map current_clock (List.flatten clocks_of_args), s
+      )
       | Lic.WHEN clk_exp,args -> (
-          let c_clk, when_exp_clk =
-            match clk_exp with
-              | Base -> BaseLic, BaseLic
-              | NamedClock { it = (cc,c) ; src = lxm } ->
-                  let id, c_clk =
-                    (id_solver.id2var (Ident.to_idref c) lxm).var_clock_eff
-                  in
-                    c_clk, On((cc,c), c_clk)
-          in
-	  let aux_when exp_clk s =
+        let c_clk, when_exp_clk =
+          match clk_exp with
+            | Base -> BaseLic, BaseLic
+            | NamedClock { it = (cc,c) ; src = lxm } ->
+              let id, c_clk =
+                (id_solver.id2var (Ident.to_idref c) lxm).var_clock_eff
+              in
+              c_clk, On((cc,c), c_clk)
+        in
+	     let aux_when exp_clk s =
             (* 
                In order to clock check an expression such as
 
-                 exp when C(c)
+               exp when C(c)
                
                (1) we first need to check that the clock of c (c_clk)
-                   is a sub-clock of the clock of exp (exp_clk).
+               is a sub-clock of the clock of exp (exp_clk).
                (2) 
             *)
 
-            match is_a_sub_clock lxm s exp_clk (fst exp_clk,c_clk) with
-              | None -> 
-                  let msg = "\n*** clock error: '" ^ (ci2str (snd exp_clk)) ^ 
-                    "' is not a sub-clock of '" ^ (ci2str c_clk) ^ "'"
-                  in
-                    raise (Compile_error(lxm, msg))
-              | Some s -> 
-                  let id_when_exp_clk, s =
-                    match exp_clk with
-                      | id, On(var, _) -> (id, when_exp_clk), s
-                      | id, BaseLic -> (id, when_exp_clk), s
-                      | id, ClockVar i ->
-                          let id_when_exp_clk = id, when_exp_clk in
-                          let (s1,s2) = s in
-                            id_when_exp_clk, 
-                          (s1, UnifyClock.add_subst2 i when_exp_clk s2)
-                  in
-                    id_when_exp_clk, s
-	  in
-            (match f_list id_solver s args with
-                 (* XXX ce cas ne sert à rien !!!
-                    le traitement du cas ou la liste ne contient qu'un element
-                    n'a aucun raison d'etre particulier, si ???
-                 *)
-               | _args,[[exp_clk]], s -> 
-		   let (exp_clk,s) = aux_when exp_clk s in
-		     ([exp_clk], s)
-
-               | _args, [exp_clk_list], s ->
-                   (* when on tuples *)
-		   let exp_clk_list, s = 
-		     List.fold_left 
-		       (fun (acc,s) exp_clk -> 
-			  let (exp_clk,s) = aux_when exp_clk s in
-			    exp_clk::acc, s
-		       ) 
-		       ([],s) 
-		       exp_clk_list
-		   in
-		     (List.rev exp_clk_list, s)
-               |  _ -> assert false (* "(x1,x2) when node (x,y)" *)
-            )
+          match is_a_sub_clock lxm s exp_clk (fst exp_clk,c_clk) with
+            | None -> 
+              let msg = "\n*** clock error: '" ^ (ci2str (snd exp_clk)) ^ 
+                "' is not a sub-clock of '" ^ (ci2str c_clk) ^ "'"
+              in
+              raise (Compile_error(lxm, msg))
+            | Some s -> 
+              let id_when_exp_clk, s =
+                match exp_clk with
+                  | id, On(var, _) -> (id, when_exp_clk), s
+                  | id, BaseLic -> (id, when_exp_clk), s
+                  | id, ClockVar i ->
+                    let id_when_exp_clk = id, when_exp_clk in
+                    let (s1,s2) = s in
+                    id_when_exp_clk, 
+                    (s1, UnifyClock.add_subst2 i when_exp_clk s2)
+              in
+              id_when_exp_clk, s
+	     in
+        (match f_list id_solver s args with
+               (* XXX ce cas ne sert à rien !!!
+                  le traitement du cas ou la liste ne contient qu'un element
+                  n'a aucun raison d'etre particulier, si ???
+               *)
+          | _args,[[exp_clk]], s -> 
+		      let (exp_clk,s) = aux_when exp_clk s in
+		      ([exp_clk], s)
+
+          | _args, [exp_clk_list], s ->
+         (* when on tuples *)
+		      let exp_clk_list, s = 
+		        List.fold_left 
+		          (fun (acc,s) exp_clk -> 
+			         let (exp_clk,s) = aux_when exp_clk s in
+			         exp_clk::acc, s
+		          ) 
+		          ([],s) 
+		          exp_clk_list
+		      in
+		      (List.rev exp_clk_list, s)
+          |  _ -> assert false (* "(x1,x2) when node (x,y)" *)
         )
+      )
 
       | Lic.MERGE _,args -> assert false (* TODO *)
-          (*      f_aux id_solver (List.hd args) *)
+      (*      f_aux id_solver (List.hd args) *)
 
       | Lic.HAT(i,ve),args -> 
-          let (_,clk,s) = f_aux id_solver s ve in
-            clk,s
-          (* nb: the args have been put inside the HAT_eff constructor *)
+        let (_,clk,s) = f_aux id_solver s ve in
+        clk,s
+      (* nb: the args have been put inside the HAT_eff constructor *)
           
 
       | Lic.VAR_REF id,args -> 
-         let vi = UglyStuff.var_info_of_ident id_solver id lxm in
-         ([var_info_eff_to_clock_eff vi], s)
+        let vi = UglyStuff.var_info_of_ident id_solver id lxm in
+        ([var_info_eff_to_clock_eff vi], s)
 
       | Lic.CONST_REF idl,args -> 
-         let _const = UglyStuff.const_eff_of_item_key id_solver idl lxm in
-         let s, clk = UnifyClock.new_clock_var s in
-         ([Ident.of_long idl, clk], s)
+        let _const = UglyStuff.const_eff_of_item_key id_solver idl lxm in
+        let s, clk = UnifyClock.new_clock_var s in
+        ([Ident.of_long idl, clk], s)
 
       | Lic.CALL nkf,args -> 
-          let node_key = nkf.it in
-          let node_exp_eff = UglyStuff.node_exp_of_node_key id_solver node_key lxm in
-          let (cil_arg, cil_res) = get_clock_profile node_exp_eff in
-          let s, rel_base = UnifyClock.new_clock_var s in
-            (*  the value of the base clock of a node is actually relative
-                to the context into which the node is called.
-                
-                Hence we create a fresh var clock, that will be instanciated
-                by the caller.
-            *)
-          let (replace_base : Lic.clock -> Lic.id_clock -> Lic.id_clock) =
-            fun rel_base (id,ci) -> 
+        let node_key = nkf.it in
+        let node_exp_eff = UglyStuff.node_exp_of_node_key id_solver node_key lxm in
+        let (cil_arg, cil_res) = get_clock_profile node_exp_eff in
+        let s, rel_base = UnifyClock.new_clock_var s in
+          (*  the value of the base clock of a node is actually relative
+              to the context into which the node is called.
+              
+              Hence we create a fresh var clock, that will be instanciated
+              by the caller.
+          *)
+        let (replace_base : Lic.clock -> Lic.id_clock -> Lic.id_clock) =
+          fun rel_base (id,ci) -> 
               (* [replace_base rel_base ci ] replaces in [ci] any occurences of the
                  base clock by [rel_base] *)
-              let rec aux ci =
-                match ci with
-                  | BaseLic -> rel_base
-                  | On(v,clk) -> On(v, aux clk)
-                  | ClockVar i -> ci
-              in
-                id, aux ci
-          in
-          let cil_arg = List.map (replace_base rel_base) cil_arg in 
-          let cil_res = List.map (replace_base rel_base) cil_res in 
-          let args, clk_args, s = f_list id_solver s args in
-          let s = check_args lxm s cil_arg (List.flatten clk_args) in
-            List.map (apply_subst s) cil_res, s
+            let rec aux ci =
+              match ci with
+                | BaseLic -> rel_base
+                | On(v,clk) -> On(v, aux clk)
+                | ClockVar i -> ci
+            in
+            id, aux ci
+        in
+        let cil_arg = List.map (replace_base rel_base) cil_arg in 
+        let cil_res = List.map (replace_base rel_base) cil_res in 
+        let args, clk_args, s = f_list id_solver s args in
+        let s = check_args lxm s cil_arg (List.flatten clk_args) in
+        List.map (apply_subst s) cil_res, s
 
       (* One argument. *)
       | Lic.PRE,args
       | Lic.STRUCT_ACCESS _,args
       | Lic.ARRAY_ACCES  (_),args
       | Lic.ARRAY_SLICE (_),args  -> 
-          assert(List.length args = 1);
-          let (_,clk,s) = f_aux id_solver s (List.hd args) in
-            clk,s  
+        assert(List.length args = 1);
+        let (_,clk,s) = f_aux id_solver s (List.hd args) in
+        clk,s  
 
       | Lic.PREDEF_CALL (op,sargs),args  -> 
-          let args, clk_args, s =  f_list id_solver s args in
-          let flat_clk_args = List.flatten clk_args in (* => mono-clock! *)
-          let _,flat_clk_args = List.split flat_clk_args in
-          let clk_list, s =       
-            if args = [] then [],s else
-              let _clk,s = UnifyClock.list lxm flat_clk_args s in
-                List.map (List.map (apply_subst s)) clk_args, s
-          in
-            LicEvalClock.f id_solver op lxm sargs s clk_list
+        let args, clk_args, s =  f_list id_solver s args in
+        let flat_clk_args = List.flatten clk_args in (* => mono-clock! *)
+        let _,flat_clk_args = List.split flat_clk_args in
+        let clk_list, s =       
+          if args = [] then [],s else
+            let _clk,s = UnifyClock.list lxm flat_clk_args s in
+            List.map (List.map (apply_subst s)) clk_args, s
+        in
+        LicEvalClock.f id_solver op lxm sargs s clk_list
 
       (* may have tuples as arguments *)
       | Lic.TUPLE,args
@@ -401,31 +401,31 @@ and (eval_by_pos_clock : Lic.id_solver -> Lic.by_pos_op -> Lxm.t -> Lic.val_exp
           let clk_list =
             match posop with
               | Lic.TUPLE -> 
-                  let clk_l = List.map (UnifyClock.apply_subst s) flat_clk_args in
-                    List.combine idl clk_l
+                let clk_l = List.map (UnifyClock.apply_subst s) flat_clk_args in
+                List.combine idl clk_l
               | _ -> List.map (apply_subst s) (List.hd clk_args)
           in
-            clk_list, s
-        )
+          clk_list, s
+      )
       | Lic.WITH(ve),args -> 
-          let (_,clk,s) = f_aux id_solver s ve in
-            clk, s
-            
-        
+        let (_,clk,s) = f_aux id_solver s ve in
+        clk, s
+          
+          
 
 and (eval_by_name_clock : Lic.id_solver -> Lic.by_name_op -> Lxm.t -> 
-      (Ident.t Lxm.srcflagged * Lic.val_exp) list -> subst -> 
-      Lic.id_clock list * subst) =
+     (Ident.t Lxm.srcflagged * Lic.val_exp) list -> subst -> 
+     Lic.id_clock list * subst) =
   fun id_solver namop lxm namargs s -> 
     match namop with
       | Lic.STRUCT_anonymous -> assert false (* cf EvalType.E *)
       | Lic.STRUCT _ ->
-          let apply_subst s (id,clk) = id, UnifyClock.apply_subst s clk in
-          let args = List.map (fun (id,ve) -> ve) namargs in
+        let apply_subst s (id,clk) = id, UnifyClock.apply_subst s clk in
+        let args = List.map (fun (id,ve) -> ve) namargs in
           (* XXX The 3 following lines duplicates the code of TUPLE_eff and co *)
-          let args, clk_args, s =  f_list id_solver s args in
-          let flat_clk_args = List.flatten clk_args in (* => mono-clock! *)
-          let _,flat_clk_args = List.split flat_clk_args in
-          let clk,s = UnifyClock.list lxm flat_clk_args s in
-          let clk_list = List.map (apply_subst s) (List.hd clk_args) in
-            clk_list, s
+        let args, clk_args, s =  f_list id_solver s args in
+        let flat_clk_args = List.flatten clk_args in (* => mono-clock! *)
+        let _,flat_clk_args = List.split flat_clk_args in
+        let clk,s = UnifyClock.list lxm flat_clk_args s in
+        let clk_list = List.map (apply_subst s) (List.hd clk_args) in
+        clk_list, s
diff --git a/src/evalType.ml b/src/evalType.ml
index cea9b508..59842748 100644
--- a/src/evalType.ml
+++ b/src/evalType.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 13/12/2012 (at 11:32) by Erwan Jahier> *)
+(** Time-stamp: <modified the 18/01/2013 (at 10:21) by Erwan Jahier> *)
  
   
 open AstPredef
@@ -38,280 +38,280 @@ let rec (f : Lic.id_solver -> Lic.val_exp -> Lic.val_exp * Lic.type_ list) =
     let ve_core, tl =
       match ve.ve_core with
         | CallByPosLic ({it=posop; src=lxm}, OperLic args) -> (
-            let posop_opt, args, tl = 
-              try eval_by_pos_type id_solver posop lxm args
-              with EvalType_error msg -> 
-                raise (Compile_error(lxm, "type error: "^msg))
-            in
-            let ve = 
-              match posop_opt with
-                | None -> CallByPosLic ({it=posop; src=lxm}, OperLic args)
-                | Some posop -> CallByPosLic ({it=posop; src=lxm}, OperLic args)
-            in
-              ve, tl
-          )
+          let posop_opt, args, tl = 
+            try eval_by_pos_type id_solver posop lxm args
+            with EvalType_error msg -> 
+              raise (Compile_error(lxm, "type error: "^msg))
+          in
+          let ve = 
+            match posop_opt with
+              | None -> CallByPosLic ({it=posop; src=lxm}, OperLic args)
+              | Some posop -> CallByPosLic ({it=posop; src=lxm}, OperLic args)
+          in
+          ve, tl
+        )
         | CallByNameLic ({it=nmop; src=lxm}, nmargs ) ->
-            let nmargs, tl = 
-              try eval_by_name_type id_solver nmop lxm nmargs
-              with EvalConst_error msg ->
-                raise (Compile_error(lxm, "\n*** can't eval constant: "^msg))
-            in
-              CallByNameLic ({it=nmop; src=lxm}, nmargs ), tl
+          let nmargs, tl = 
+            try eval_by_name_type id_solver nmop lxm nmargs
+            with EvalConst_error msg ->
+              raise (Compile_error(lxm, "\n*** can't eval constant: "^msg))
+          in
+          CallByNameLic ({it=nmop; src=lxm}, nmargs ), tl
     in
-      { ve_core = ve_core; ve_typ = tl ; ve_clk = ve.ve_clk }, tl
+    { ve_core = ve_core; ve_typ = tl ; ve_clk = ve.ve_clk }, tl
       
 
 and eval_by_pos_type
-   (id_solver: Lic.id_solver)
-   (posop: Lic.by_pos_op)
-   (lxm: Lxm.t)
-   (args: Lic.val_exp list)
-: (
-      Lic.by_pos_op option (* For op that hold a val_exp, we return the modified op *)
-      * Lic.val_exp list   (* The args with type info added *)
-      * Lic.type_ list     (* The type of the val_exp "posop(args)" *)
+    (id_solver: Lic.id_solver)
+  (posop: Lic.by_pos_op)
+  (lxm: Lxm.t)
+  (args: Lic.val_exp list)
+  : (
+    Lic.by_pos_op option (* For op that hold a val_exp, we return the modified op *)
+    * Lic.val_exp list   (* The args with type info added *)
+    * Lic.type_ list     (* The type of the val_exp "posop(args)" *)
   ) =
-    match posop with
-      | PREDEF_CALL (op,sargs) -> (
-          let args, targs = List.split (List.map (f id_solver) args) in
+  match posop with
+    | PREDEF_CALL (op,sargs) -> (
+      let args, targs = List.split (List.map (f id_solver) args) in
           (* ICI pas de matches possible ? *)
-          let tve = LicEvalType.f id_solver op lxm sargs targs in
-            None, args, tve
-        )
-      | Lic.CALL nkf -> 
-         let node_key = nkf.it in
+      let tve = LicEvalType.f id_solver op lxm sargs targs in
+      None, args, tve
+    )
+    | Lic.CALL nkf -> 
+      let node_key = nkf.it in
          (* let node_exp_eff = id_solver.id2node node_key lxm in *)
-         let node_exp_eff = UglyStuff.node_exp_of_node_key id_solver node_key lxm in
-         let (lti, lto) = Lic.profile_of_node_exp node_exp_eff in
-         let args, t_argsl = List.split (List.map (f id_solver) args) in
-         let t_args = List.flatten t_argsl in
-         let llti = List.length lti and lt_args = List.length t_args in
-         let _ = if llti <> lt_args then
-            raise_arity_error "" lt_args llti
-         in
+      let node_exp_eff = UglyStuff.node_exp_of_node_key id_solver node_key lxm in
+      let (lti, lto) = Lic.profile_of_node_exp node_exp_eff in
+      let args, t_argsl = List.split (List.map (f id_solver) args) in
+      let t_args = List.flatten t_argsl in
+      let llti = List.length lti and lt_args = List.length t_args in
+      let _ = if llti <> lt_args then
+          raise_arity_error "" lt_args llti
+      in
          (* lti = expecteds, t_args = given *)
-         let tmatches = try UnifyType.is_matched lti t_args 
-         with UnifyType.Match_failed msg -> (
-            let msg' = Printf.sprintf 
-               "\n***    while unifing (%s) with (%s)"
-               (Lic.string_of_type_list lti)
-               (Lic.string_of_type_list t_args)
-            in raise (EvalType_error(msg'^msg))
-         ) in
-         let tve = match tmatches with
-            | [] -> lto
-            | _  -> 
-               Verbose.exe ~flag:dbgpoly (fun () ->
-                  Printf.fprintf stderr "#DBG: EvalType of CALL '%s' (%s)\n"
-                     (Lic.string_of_node_key node_key) 
-                     (Lxm.details lxm);
-                  Printf.fprintf stderr "#     unifying '%s' with '%s'\n"
-                     (Lic.string_of_type_list lti)
-                     (Lic.string_of_type_list t_args) ;
-                  Printf.fprintf stderr "#     required matches %s\n"
-                     (Lic.string_of_type_matches tmatches) 
-               );
-               Lic.apply_type_matches tmatches lto
-         in
-          (None, args, tve)
-      | Lic.CONST_REF idl ->
-         let ceff = UglyStuff.const_eff_of_item_key id_solver idl lxm in
-         let tve = [Lic.type_of_const ceff] in
-         None, [], tve
-      | Lic.VAR_REF id ->
-         let tve = [
-            (UglyStuff.var_info_of_ident id_solver id lxm).var_type_eff
-         ] in
-         None, [], tve
-      | Lic.WITH(ve) ->
-          let ve, tve = f id_solver ve in
-            Some(Lic.WITH(ve)), [], tve
-            
-      | Lic.TUPLE ->
-          let args, targs = List.split (List.map (f id_solver) args) in
-            None, args, List.flatten targs
+      let tmatches = try UnifyType.is_matched lti t_args 
+        with UnifyType.Match_failed msg -> (
+          let msg' = Printf.sprintf 
+            "\n***    while unifing (%s) with (%s)"
+            (Lic.string_of_type_list lti)
+            (Lic.string_of_type_list t_args)
+          in raise (EvalType_error(msg'^msg))
+        ) in
+      let tve = match tmatches with
+        | [] -> lto
+        | _  -> 
+          Verbose.exe ~flag:dbgpoly (fun () ->
+            Printf.fprintf stderr "#DBG: EvalType of CALL '%s' (%s)\n"
+              (Lic.string_of_node_key node_key) 
+              (Lxm.details lxm);
+            Printf.fprintf stderr "#     unifying '%s' with '%s'\n"
+              (Lic.string_of_type_list lti)
+              (Lic.string_of_type_list t_args) ;
+            Printf.fprintf stderr "#     required matches %s\n"
+              (Lic.string_of_type_matches tmatches) 
+          );
+          Lic.apply_type_matches tmatches lto
+      in
+      (None, args, tve)
+    | Lic.CONST_REF idl ->
+      let ceff = UglyStuff.const_eff_of_item_key id_solver idl lxm in
+      let tve = [Lic.type_of_const ceff] in
+      None, [], tve
+    | Lic.VAR_REF id ->
+      let tve = [
+        (UglyStuff.var_info_of_ident id_solver id lxm).var_type_eff
+      ] in
+      None, [], tve
+    | Lic.WITH(ve) ->
+      let ve, tve = f id_solver ve in
+      Some(Lic.WITH(ve)), [], tve
+        
+    | Lic.TUPLE ->
+      let args, targs = List.split (List.map (f id_solver) args) in
+      None, args, List.flatten targs
 
-      | Lic.CONCAT ->
-         let args, targs = List.split (List.map (f id_solver) args) in
-         let tve = match targs with
-         | [ [Array_type_eff (t0, s0)]; [Array_type_eff (t1, s1)]] ->
-            if t0 = t1 then [Array_type_eff (t0, s0+s1)]
-            else
-               raise_type_error (List.flatten targs) []
-                  "two arrays of the same type was expected"
-         | _ -> 
-            raise_arity_error "" (List.length args) 2
-          in
-            None, args, tve
-      | Lic.STRUCT_ACCESS (fid) ->
-          assert (List.length args = 1);          
-          let arg, targ = f id_solver (List.hd args) in
-          let teff_field =
-            match targ with
-              | [Struct_type_eff (name, fl)] -> (
-                  try fst (List.assoc fid fl)
-                  with Not_found ->
-                    raise (
-                      EvalType_error
-                        (Printf.sprintf "%s is not a field of struct %s"
-                           (Ident.to_string fid)
-                           (Lic.string_of_type (List.hd targ))))
-                )
-              | [x] -> raise_type_error [x] [] "some struct type was expected"
-              |  x -> raise_arity_error "" (List.length x) 1 
-          in
-            None, [arg], [teff_field]
+    | Lic.CONCAT ->
+      let args, targs = List.split (List.map (f id_solver) args) in
+      let tve = match targs with
+        | [ [Array_type_eff (t0, s0)]; [Array_type_eff (t1, s1)]] ->
+          if t0 = t1 then [Array_type_eff (t0, s0+s1)]
+          else
+            raise_type_error (List.flatten targs) []
+              "two arrays of the same type was expected"
+        | _ -> 
+          raise_arity_error "" (List.length args) 2
+      in
+      None, args, tve
+    | Lic.STRUCT_ACCESS (fid) ->
+      assert (List.length args = 1);          
+      let arg, targ = f id_solver (List.hd args) in
+      let teff_field =
+        match targ with
+          | [Struct_type_eff (name, fl)] -> (
+            try fst (List.assoc fid fl)
+            with Not_found ->
+              raise (
+                EvalType_error
+                  (Printf.sprintf "%s is not a field of struct %s"
+                     (Ident.to_string fid)
+                     (Lic.string_of_type (List.hd targ))))
+          )
+          | [x] -> raise_type_error [x] [] "some struct type was expected"
+          |  x -> raise_arity_error "" (List.length x) 1 
+      in
+      None, [arg], [teff_field]
 
 
-      | Lic.ARRAY_ACCES(i) ->
-          assert (List.length args = 1);          
-          let arg, targ = f id_solver (List.hd args) in
-          let sz, teff =
-            match targ with
-              | [Array_type_eff(teff_elt, size)] -> size, teff_elt
-              | _ ->
-                  let msg = 
-                    "\n*** Type error: '"^(Lic.string_of_type_list targ) ^
-                      "' was expected to be an array"
-                  in
-                    raise (Compile_error(lxm, msg))
-          in
-          let _ = if ((i >= 0) && (i < sz)) then () else
-            raise(EvalType_error(sprintf "array index %d out of bounds 0..%d" i (sz-1)))
-          in
-            None, [arg], [teff]
+    | Lic.ARRAY_ACCES(i) ->
+      assert (List.length args = 1);          
+      let arg, targ = f id_solver (List.hd args) in
+      let sz, teff =
+        match targ with
+          | [Array_type_eff(teff_elt, size)] -> size, teff_elt
+          | _ ->
+            let msg = 
+              "\n*** Type error: '"^(Lic.string_of_type_list targ) ^
+                "' was expected to be an array"
+            in
+            raise (Compile_error(lxm, msg))
+      in
+      let _ = if ((i >= 0) && (i < sz)) then () else
+          raise(EvalType_error(sprintf "array index %d out of bounds 0..%d" i (sz-1)))
+      in
+      None, [arg], [teff]
 
-      | Lic.ARRAY_SLICE(sieff) ->
-          assert (List.length args = 1);          
-          let arg, targ = f id_solver (List.hd args) in
-          let sz, teff_elt =
-            match targ with
-              | [Array_type_eff(teff_elt, size)] -> size, teff_elt
-              | _ ->
-                  raise (Compile_error(
-                           lxm, "\n*** Type error: '" ^ 
-                             (Lic.string_of_type_list targ) ^ 
-                             "' was expected to be an array"))
-          in
-          let _ = if ((sieff.se_first >= 0) && (sieff.se_first < sz)) then () else
-            raise(
-              EvalType_error(sprintf "array index %d out of bounds 0..%d" 
-                               sieff.se_first (sz-1)))
-          in
-          let _ = if ((sieff.se_last >= 0) && (sieff.se_last < sz)) then () else
-            raise(
-              EvalType_error(sprintf "array index %d out of bounds 0..%d" 
-                               sieff.se_last (sz-1)))
-          in
-            None, [arg], [Array_type_eff(teff_elt, sieff.se_width)]
+    | Lic.ARRAY_SLICE(sieff) ->
+      assert (List.length args = 1);          
+      let arg, targ = f id_solver (List.hd args) in
+      let sz, teff_elt =
+        match targ with
+          | [Array_type_eff(teff_elt, size)] -> size, teff_elt
+          | _ ->
+            raise (Compile_error(
+              lxm, "\n*** Type error: '" ^ 
+                (Lic.string_of_type_list targ) ^ 
+                "' was expected to be an array"))
+      in
+      let _ = if ((sieff.se_first >= 0) && (sieff.se_first < sz)) then () else
+          raise(
+            EvalType_error(sprintf "array index %d out of bounds 0..%d" 
+                             sieff.se_first (sz-1)))
+      in
+      let _ = if ((sieff.se_last >= 0) && (sieff.se_last < sz)) then () else
+          raise(
+            EvalType_error(sprintf "array index %d out of bounds 0..%d" 
+                             sieff.se_last (sz-1)))
+      in
+      None, [arg], [Array_type_eff(teff_elt, sieff.se_width)]
 
-      | Lic.HAT(size,ceff) -> 
-          let ceff, teff_list = f id_solver ceff in
-          let tl = List.map (fun teff -> Array_type_eff(teff, size)) teff_list in
-            Some(Lic.HAT(size,ceff)), [], tl
-              
-      | Lic.ARRAY(args) ->
+    | Lic.HAT(size,ceff) -> 
+      let ceff, teff_list = f id_solver ceff in
+      let tl = List.map (fun teff -> Array_type_eff(teff, size)) teff_list in
+      Some(Lic.HAT(size,ceff)), [], tl
+        
+    | Lic.ARRAY(args) ->
           (* check that args are of the same type *)
-          let args, targs = List.split (List.map (f id_solver) args) in
-          let teff_elt =
-            List.fold_left
-              (fun acc teff ->
-                 match acc with
-                   | [] -> teff
-                   | [sacc] -> if acc = teff then acc else
-                       raise(EvalType_error(
-                               "all array elements should be of the same type"))
-                   | _ -> assert false
-              )
-              []
-              targs
-          in
-          let tve =
-            assert (List.length teff_elt = 1);
-            [Array_type_eff(List.hd teff_elt, List.length args)]
-          in
-            Some(Lic.ARRAY(args)), [], tve
+      let args, targs = List.split (List.map (f id_solver) args) in
+      let teff_elt =
+        List.fold_left
+          (fun acc teff ->
+            match acc with
+              | [] -> teff
+              | [sacc] -> if acc = teff then acc else
+                  raise(EvalType_error(
+                    "all array elements should be of the same type"))
+              | _ -> assert false
+          )
+          []
+          targs
+      in
+      let tve =
+        assert (List.length teff_elt = 1);
+        [Array_type_eff(List.hd teff_elt, List.length args)]
+      in
+      Some(Lic.ARRAY(args)), [], tve
 
-      | Lic.WHEN clk_exp -> (
-          let args, targs = List.split (List.map (f id_solver) args) in
-          let _ = match clk_exp with
-            | Base -> ()
-            | NamedClock( { it = (cc,cv) ; src = lxm }) -> 
-                let vi = id_solver.id2var (Ident.to_idref cv) lxm in
-                  (match vi.var_type_eff with
-	             | Lic.Bool_type_eff
-                     | Lic.Enum_type_eff _ -> ()
-	             | teff  -> 
-		         let msg = "the type of a clock cannot be " ^
-                           (Lic.string_of_type teff) 
-		         in
-		           raise(Compile_error(lxm,msg))
-                  )
-          in
-            match targs with
-              | [teff] -> None, args, teff
-              | _ -> raise_arity_error "" (List.length targs) 1 
-        )
-      | Lic.ARROW
-      | Lic.FBY -> (
-          let args, targs = List.split (List.map (f id_solver) args) in
-            match targs with
-              | [init; teff] -> if init = teff then None, args, teff else 
-                  raise(EvalType_error("type mismatch. "))
-              | _ -> raise_arity_error "" (List.length targs) 2
-        )
-      | Lic.CURRENT 
-      | Lic.PRE -> (
-          let args, targs = List.split (List.map (f id_solver) args) in
-            match targs with
-              | [teff] -> None, args, teff
-              | _ -> raise_arity_error "" (List.length targs) 1
-        )
-      | Lic.MERGE _ -> finish_me "merge"; assert false
+    | Lic.WHEN clk_exp -> (
+      let args, targs = List.split (List.map (f id_solver) args) in
+      let _ = match clk_exp with
+        | Base -> ()
+        | NamedClock( { it = (cc,cv) ; src = lxm }) -> 
+          let vi = id_solver.id2var (Ident.to_idref cv) lxm in
+          (match vi.var_type_eff with
+	         | Lic.Bool_type_eff
+            | Lic.Enum_type_eff _ -> ()
+	         | teff  -> 
+		        let msg = "the type of a clock cannot be " ^
+                (Lic.string_of_type teff) 
+		        in
+		        raise(Compile_error(lxm,msg))
+          )
+      in
+      match targs with
+        | [teff] -> None, args, teff
+        | _ -> raise_arity_error "" (List.length targs) 1 
+    )
+    | Lic.ARROW
+    | Lic.FBY -> (
+      let args, targs = List.split (List.map (f id_solver) args) in
+      match targs with
+        | [init; teff] -> if init = teff then None, args, teff else 
+            raise(EvalType_error("type mismatch. "))
+        | _ -> raise_arity_error "" (List.length targs) 2
+    )
+    | Lic.CURRENT 
+    | Lic.PRE -> (
+      let args, targs = List.split (List.map (f id_solver) args) in
+      match targs with
+        | [teff] -> None, args, teff
+        | _ -> raise_arity_error "" (List.length targs) 1
+    )
+    | Lic.MERGE _ -> finish_me "merge"; assert false
 
 
 (**
    Juste pour les structures ...
 *)
 and eval_by_name_type
-   (id_solver:  Lic.id_solver)
-   (namop: Lic.by_name_op)
-   (lxm: Lxm.t)
-   (namargs: (Ident.t Lxm.srcflagged * Lic.val_exp) list )
+    (id_solver:  Lic.id_solver)
+  (namop: Lic.by_name_op)
+  (lxm: Lxm.t)
+  (namargs: (Ident.t Lxm.srcflagged * Lic.val_exp) list )
 (* renvoie la lsite de modif de champs compilée + le type du résultat *)
-:  (Ident.t Lxm.srcflagged * Lic.val_exp) list * Lic.type_ list
-= match namop with
+  :  (Ident.t Lxm.srcflagged * Lic.val_exp) list * Lic.type_ list
+    = match namop with
 
-   | Lic.STRUCT_anonymous -> 
+      | Lic.STRUCT_anonymous -> 
       (* ??? comment faire ici pour recuperer son type ???
-             il faut que je recherche à l'aide des noms de champs
-             le type structure qui va bien !
+         il faut que je recherche à l'aide des noms de champs
+         le type structure qui va bien !
 
-             - creer une table [liste des noms de champs -> ident de type structure] ?
-             - rajouter dans la table a sa creation une entree dont le nom
-             est composé du nom des champs ?
+         - creer une table [liste des noms de champs -> ident de type structure] ?
+         - rajouter dans la table a sa creation une entree dont le nom
+         est composé du nom des champs ?
       *)
-      finish_me "anonymous struct not yet supported"; 
-      assert false
-      
-   | Lic.STRUCT (pn,opid) -> 
-      let struct_type = id_solver.id2type opid lxm in
-      match struct_type with
-      | Struct_type_eff(sn, fl) -> 
-         let do_field_assign (fn, fv) =
-         (* traitement d'un ''field_name  = field_value'' *)
-            let (ft,fopt) = try
-               List.assoc fn.it fl
-               with Not_found -> 
+        finish_me "anonymous struct not yet supported"; 
+        assert false
+          
+      | Lic.STRUCT (pn,opid) -> 
+        let struct_type = id_solver.id2type opid lxm in
+        match struct_type with
+          | Struct_type_eff(sn, fl) -> 
+            let do_field_assign (fn, fv) =
+            (* traitement d'un ''field_name  = field_value'' *)
+              let (ft,fopt) = try
+                                List.assoc fn.it fl
+                with Not_found -> 
                   let msg = "type error: bad field"^(Ident.to_string fn.it) in
                   raise (Compile_error(lxm, msg))
-            in
+              in
             (* let's check the type of fv *)
-            let fv, fv_type = f id_solver fv in
-            if fv_type = [ft] then (fn,fv)
-            else raise_type_error fv_type [ft]
+              let fv, fv_type = f id_solver fv in
+              if fv_type = [ft] then (fn,fv)
+              else raise_type_error fv_type [ft]
                 ("while checking struct field "^(Lxm.details fn.src))
-         in
-         let namargs = List.map do_field_assign namargs
-         in (namargs, [struct_type])
-      | _ -> raise (Compile_error(lxm, "type error: a structure is expected"))
+            in
+            let namargs = List.map do_field_assign namargs
+            in (namargs, [struct_type])
+          | _ -> raise (Compile_error(lxm, "type error: a structure is expected"))
diff --git a/src/l2lAliasType.ml b/src/l2lAliasType.ml
index bdf5403e..f9574e27 100644
--- a/src/l2lAliasType.ml
+++ b/src/l2lAliasType.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 18/12/2012 (at 10:10) by Erwan Jahier> *)
+(* Time-stamp: <modified the 17/01/2013 (at 10:39) by Erwan Jahier> *)
 
 (**  
 Source 2 source transformation :
@@ -11,12 +11,12 @@ open Lic
 
 
 let doit (inp : LicPrg.t) : LicPrg.t =
-   (* n.b. on fait un minumum d'effet de bord pour
-      pas avoir trop d'acummulateur ... *)
+  (* n.b. on fait un minumum d'effet de bord pour
+     pas avoir trop d'acummulateur ... *)
   let atab = Hashtbl.create 10 in
   let res = ref inp in
 
-   (** UTILE : nommage des alias d'array *)
+  (** UTILE : nommage des alias d'array *)
   let array_ident ty sz =
     let tid = Lic.ident_of_type ty in
     let sfx = Printf.sprintf "%s_%d" (snd tid) sz in
@@ -24,7 +24,7 @@ let doit (inp : LicPrg.t) : LicPrg.t =
     id 
   in
 
-   (** UTILE : cherche/crée un alias de type *)
+  (** UTILE : cherche/crée un alias de type *)
   let rec alias_type te =
     match te with
       | Array_type_eff (ty, sz) -> (
@@ -32,32 +32,32 @@ let doit (inp : LicPrg.t) : LicPrg.t =
         let te = Array_type_eff (ty, sz) in
         try
           let ref_te = Hashtbl.find atab te in
-            (*
-              Verbose.printf "--> alias_type %s = %s ^ %d FOUND : %s\n"
-              (LicDump.string_of_type_eff te)
-              (LicDump.string_of_type_eff ty)
-              sz
-              (LicDump.string_of_type_eff ref_te);
-            *)
+          (*
+            Verbose.printf "--> alias_type %s = %s ^ %d FOUND : %s\n"
+            (LicDump.string_of_type_eff te)
+            (LicDump.string_of_type_eff ty)
+            sz
+            (LicDump.string_of_type_eff ref_te);
+          *)
           ref_te
         with Not_found -> (
           let id = array_ident ty sz in
           let ref_te = Abstract_type_eff (id, te) in
           res := LicPrg.add_type id ref_te !res;
           Hashtbl.add atab te ref_te; 
-            (*
-              Verbose.printf "--> alias_type %s = %s ^ %d NOT FOUND, gives: %s\n"
-              (LicDump.string_of_type_eff te)
-              (LicDump.string_of_type_eff ty)
-              sz
-              (LicDump.string_of_type_eff ref_te);
-            *)
+          (*
+            Verbose.printf "--> alias_type %s = %s ^ %d NOT FOUND, gives: %s\n"
+            (LicDump.string_of_type_eff te)
+            (LicDump.string_of_type_eff ty)
+            sz
+            (LicDump.string_of_type_eff ref_te);
+          *)
           ref_te 
         )
       ) | _ -> te
   in
 
-   (** TRAITE LES TYPES *)
+  (** TRAITE LES TYPES *)
   let do_type k te =
     let te' = match te with
       | Array_type_eff (tel, sz) ->
@@ -76,7 +76,7 @@ let doit (inp : LicPrg.t) : LicPrg.t =
   in
   LicPrg.iter_types do_type inp;
 
-   (** TRAITE LES CONSTANTES *)
+  (** TRAITE LES CONSTANTES *)
   let do_const k ec =
     let ec' = match ec with
       | Extern_const_eff (i, te) ->
@@ -97,14 +97,14 @@ let doit (inp : LicPrg.t) : LicPrg.t =
     in
     if (ec = ec') then ()
     else 
-         (* n.b. add=replace *)
+      (* n.b. add=replace *)
       res := LicPrg.add_const k ec' !res 
   in 
   LicPrg.iter_consts do_const inp ;
 
-   (** TRAITE LES NOEUDS *)
+  (** TRAITE LES NOEUDS *)
   let do_node k en =
-      (* n.b. les Lic.type_ apparraissent uniquement dans les var infos *)
+    (* n.b. les Lic.type_ apparraissent uniquement dans les var infos *)
     let do_var vi =
       let ty = alias_type vi.var_type_eff in
       {vi with var_type_eff = ty}
@@ -118,7 +118,7 @@ let doit (inp : LicPrg.t) : LicPrg.t =
           | None -> None
       )
     } in
-      (* on fait pas dans la dentelle, on remplace ... *)
+    (* on fait pas dans la dentelle, on remplace ... *)
     res := LicPrg.add_node k en' !res
   in
   LicPrg.iter_nodes do_node inp;
diff --git a/src/lic.ml b/src/lic.ml
index cd6bc313..6e4b8225 100644
--- a/src/lic.ml
+++ b/src/lic.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 14/01/2013 (at 14:01) by Erwan Jahier> *)
+(* Time-stamp: <modified the 18/01/2013 (at 09:37) by Erwan Jahier> *)
 
 
 (** Define the Data Structure representing Compiled programs. *)
@@ -122,6 +122,9 @@ and type_ =
   | Real_type_eff
   | External_type_eff of Ident.long
   | Abstract_type_eff of Ident.long * type_ 
+
+(*   | Alias_type_eff of Ident.long *)
+
   | Enum_type_eff     of Ident.long * (Ident.long list)
   | Array_type_eff    of type_ * int
   | Struct_type_eff   of 
diff --git a/src/unifyClock.ml b/src/unifyClock.ml
index 5477651e..588cc811 100644
--- a/src/unifyClock.ml
+++ b/src/unifyClock.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 16/01/2013 (at 17:26) by Erwan Jahier> *)
+(* Time-stamp: <modified the 18/01/2013 (at 08:35) by Erwan Jahier> *)
 
 
 open LicDump
@@ -53,29 +53,26 @@ type cv_info =
          it.
       *)
 
-
 type cv_tbl = cv_info IntMap.t
 type subst2 = { cpt : int; cv_tbl : cv_tbl }
 
 type subst = subst1 * subst2
 
-
 (******************************************************************************)
-
 let (subst2_to_string : subst2 -> string) = 
   fun s2 -> 
     (String.concat ",\n\t " 
        (IntMap.fold 
           (fun i cvi acc ->
-             (match cvi with
-                | Clk c -> 
-                    "CV_" ^ (string_of_int i) ^ "/" ^ 
-		      (ci2str c)
-                | Equiv is -> "CV_" ^ (string_of_int i) ^ " in  {" ^ 
-                    (String.concat "," 
-                       (IntSet.fold (fun i acc -> (string_of_int i)::acc) is [])) ^
-                      "}"
-             )::acc
+            (match cvi with
+              | Clk c -> 
+                "CV_" ^ (string_of_int i) ^ "/" ^ 
+		            (ci2str c)
+              | Equiv is -> "CV_" ^ (string_of_int i) ^ " in  {" ^ 
+                (String.concat "," 
+                   (IntSet.fold (fun i acc -> (string_of_int i)::acc) is [])) ^
+                "}"
+            )::acc
           )
           s2.cv_tbl
           []
@@ -107,16 +104,16 @@ let rec (add_link2 : int -> int -> subst2 -> subst2) =
       let tbl =
         match cvi_i, cvi_j with
           | Equiv li, Equiv lj ->
-              let l = IntSet.union li lj in
-              let tbl = IntSet.fold (fun i tbl -> IntMap.add i (Equiv l) tbl) l tbl in
-                tbl
+            let l = IntSet.union li lj in
+            let tbl = IntSet.fold (fun i tbl -> IntMap.add i (Equiv l) tbl) l tbl in
+            tbl
           | Equiv l, Clk c 
           | Clk c, Equiv l ->
-              IntSet.fold (fun i tbl -> IntMap.add i (Clk c) tbl) l tbl
+            IntSet.fold (fun i tbl -> IntMap.add i (Clk c) tbl) l tbl
           | Clk c1, Clk c2 -> 
-              assert (c1=c2); tbl
+            assert (c1=c2); tbl
       in
-        { s2 with cv_tbl = tbl }
+      { s2 with cv_tbl = tbl }
 
 
 let (add_subst2 : int -> Lic.clock -> subst2 -> subst2) =
@@ -124,11 +121,11 @@ let (add_subst2 : int -> Lic.clock -> subst2 -> subst2) =
     let tbl =
       match IntMap.find i s2.cv_tbl with
         | Equiv l -> 
-            IntSet.fold (fun i tbl -> IntMap.add i (Clk c) tbl) l s2.cv_tbl
+          IntSet.fold (fun i tbl -> IntMap.add i (Clk c) tbl) l s2.cv_tbl
         | Clk c2 -> 
-            IntMap.add i (Clk c2) s2.cv_tbl
+          IntMap.add i (Clk c2) s2.cv_tbl
     in
-      { s2 with cv_tbl = tbl }
+    { s2 with cv_tbl = tbl }
 
 
 
@@ -169,45 +166,45 @@ let rec (apply_subst:subst -> Lic.clock -> Lic.clock) =
     match c with
       | BaseLic -> BaseLic
       | On((cc,cv),clk) ->
-	  let cv = match find_subst1 cv s1 with Some cv2 -> cv2 | None -> cv in
-          let clk = apply_subst (s1,s2) clk in
-	    On((cc,cv),  clk)
+	     let cv = match find_subst1 cv s1 with Some cv2 -> cv2 | None -> cv in
+        let clk = apply_subst (s1,s2) clk in
+	     On((cc,cv),  clk)
       | ClockVar i ->
-          match find_subst2 i s2 with
-            | Some clk -> apply_subst (s1,s2) clk
-            | None -> c
+        match find_subst2 i s2 with
+          | Some clk -> apply_subst (s1,s2) clk
+          | None -> c
 
 
 (* exported *)
 (* apply only the second part of the subst *)
 let rec (apply_subst2:subst -> Lic.clock -> Lic.clock) =
   fun (s1,s2) c ->
-      match c with
-        | BaseLic -> BaseLic 
-        | On(v,clk) -> 
-            let clk = apply_subst2 (s1,s2) clk in
-              On(v, clk)
-        | ClockVar i -> 
-            match find_subst2 i s2 with
-              | Some clk -> apply_subst2 (s1,s2) clk
-              | None -> c
+    match c with
+      | BaseLic -> BaseLic 
+      | On(v,clk) -> 
+        let clk = apply_subst2 (s1,s2) clk in
+        On(v, clk)
+      | ClockVar i -> 
+        match find_subst2 i s2 with
+          | Some clk -> apply_subst2 (s1,s2) clk
+          | None -> c
 	    
 let rec (apply_subst_val_exp : subst -> Lic.val_exp -> Lic.val_exp) =
   fun s ve ->
     let ve_core = 
       match ve.ve_core with
         | CallByPosLic (by_pos_op, OperLic vel) -> 
-            let vel = List.map (apply_subst_val_exp s) vel in
-              CallByPosLic (by_pos_op, OperLic vel)
+          let vel = List.map (apply_subst_val_exp s) vel in
+          CallByPosLic (by_pos_op, OperLic vel)
         | CallByNameLic(by_name_op, fl) -> 
-            let fl = List.map
-              (fun (fn,ve) -> (fn, apply_subst_val_exp s ve)) fl
-            in
-              CallByNameLic(by_name_op, fl)
+          let fl = List.map
+            (fun (fn,ve) -> (fn, apply_subst_val_exp s ve)) fl
+          in
+          CallByNameLic(by_name_op, fl)
     in
     let new_clk = List.map (apply_subst s) ve.ve_clk in
     let ve = { ve with ve_core = ve_core ; ve_clk = new_clk } in
-      ve
+    ve
 
 
 let is_clock_var = function 
@@ -222,9 +219,9 @@ let (f : Lxm.t -> subst -> Lic.clock -> Lic.clock -> subst) =
       match (c1,c2) with
 	     | On(v,clk), BaseLic
 	     | BaseLic, On(v,clk) -> (s1,s2)
-	(* not unifiable: we stop trying to find a substitution and return s;
-	   the error message is issued outside [aux] (just below).
-	*)
+	     (* not unifiable: we stop trying to find a substitution and return s;
+	        the error message is issued outside [aux] (just below).
+	     *)
 	     | BaseLic, BaseLic -> (s1,s2) (* ok *)
 	     | On((cc1,cv1), clk1), On((cc2,cv2), clk2) ->
 	       let s1 = if cv1 = cv2 then s1 else add_subst1 cv2 cv1 s1 in
@@ -281,57 +278,57 @@ let rec (const_to_val_eff: Lxm.t -> bool -> subst -> const -> subst * val_exp) =
       }
     in
     let id_of_int i = Ident.of_string (string_of_int i) in
-      match const with
-        | Bool_const_eff b -> 
-            s, mk_by_pos_op (PREDEF_CALL((if b then AstPredef.TRUE_n else AstPredef.FALSE_n), [])) 
-        | Int_const_eff  i ->
-            s, mk_by_pos_op (PREDEF_CALL((AstPredef.ICONST_n (id_of_int i)),[]))
-        | Real_const_eff r -> 
-            s, mk_by_pos_op (PREDEF_CALL((AstPredef.RCONST_n (Ident.of_string r)),[]))
-        | Enum_const_eff   (l, _)
-        | Extern_const_eff (l, _) -> s, mk_by_pos_op (CONST_REF l)
-
-        | Abstract_const_eff (l,  teff, c, is_exported) -> 
-            if expand_const 
-            then const_to_val_eff lxm expand_const s c
-            else s, mk_by_pos_op (CONST_REF l)
-
-        | Array_const_eff  (ct, _) -> 
-            let s, vel = 
-              List.fold_left 
-                (fun (s,vel) c -> 
-                   let s,ve = const_to_val_eff lxm expand_const s c in
-                     (s,ve::vel)
-                ) 
-                (s,[])
-                ct
-            in
-            let vel = List.rev  vel in
-              s, mk_by_pos_op (ARRAY vel)
-
-        | Struct_const_eff (fl, stype) ->
-            let sname = match stype with 
-              | Struct_type_eff(sname, _) -> sname
-              | _ -> assert false
-            in
-            let pack = Ident.pack_of_long sname in
-            let name_op_flg = flagit (STRUCT(pack, Ident.idref_of_long sname)) lxm in
-
-            let s, fl = 
-              List.fold_left
-                (fun (s,fl) (id,const) -> 
-                   let s, ve = const_to_val_eff lxm expand_const s const in
-                   s, (flagit id lxm, ve)::fl
-                )
-                (s,[])
-                fl
-            in
-            let fl = List.rev fl in
-              s, { ve_core = (CallByNameLic(name_op_flg, fl));
-                   ve_typ = [stype] ;
-                   ve_clk = [BaseLic]
-                 }
+    match const with
+      | Bool_const_eff b -> 
+        s, mk_by_pos_op (PREDEF_CALL((if b then AstPredef.TRUE_n else AstPredef.FALSE_n), [])) 
+      | Int_const_eff  i ->
+        s, mk_by_pos_op (PREDEF_CALL((AstPredef.ICONST_n (id_of_int i)),[]))
+      | Real_const_eff r -> 
+        s, mk_by_pos_op (PREDEF_CALL((AstPredef.RCONST_n (Ident.of_string r)),[]))
+      | Enum_const_eff   (l, _)
+      | Extern_const_eff (l, _) -> s, mk_by_pos_op (CONST_REF l)
+
+      | Abstract_const_eff (l,  teff, c, is_exported) -> 
+        if expand_const 
+        then const_to_val_eff lxm expand_const s c
+        else s, mk_by_pos_op (CONST_REF l)
+
+      | Array_const_eff  (ct, _) -> 
+        let s, vel = 
+          List.fold_left 
+            (fun (s,vel) c -> 
+              let s,ve = const_to_val_eff lxm expand_const s c in
+              (s,ve::vel)
+            ) 
+            (s,[])
+            ct
+        in
+        let vel = List.rev  vel in
+        s, mk_by_pos_op (ARRAY vel)
+
+      | Struct_const_eff (fl, stype) ->
+        let sname = match stype with 
+          | Struct_type_eff(sname, _) -> sname
+          | _ -> assert false
+        in
+        let pack = Ident.pack_of_long sname in
+        let name_op_flg = flagit (STRUCT(pack, Ident.idref_of_long sname)) lxm in
+
+        let s, fl = 
+          List.fold_left
+            (fun (s,fl) (id,const) -> 
+              let s, ve = const_to_val_eff lxm expand_const s const in
+              s, (flagit id lxm, ve)::fl
+            )
+            (s,[])
+            fl
+        in
+        let fl = List.rev fl in
+        s, { ve_core = (CallByNameLic(name_op_flg, fl));
+             ve_typ = [stype] ;
+             ve_clk = [BaseLic]
+           }
 		| Tuple_const_eff _ ->
-			print_internal_error "UnifyClock.const_to_val_eff" "should not have been called for a tuple";
-			assert false
+		  print_internal_error "UnifyClock.const_to_val_eff" "should not have been called for a tuple";
+		  assert false
 
diff --git a/src/unifyClock.mli b/src/unifyClock.mli
index dd95c527..07afd0b4 100644
--- a/src/unifyClock.mli
+++ b/src/unifyClock.mli
@@ -1,25 +1,24 @@
-(* Time-stamp: <modified the 13/12/2012 (at 14:33) by Erwan Jahier> *)
+(* Time-stamp: <modified the 18/01/2013 (at 08:32) by Erwan Jahier> *)
 
-(** Define clock-checking utilities.
+(** Sub module of EvalClock that defines clock-checking utilities.
 
    We have Two kind of substitutions. 
 
-   - One is used to deal with the clock name binding, to relate node
+   - subst1 is used to deal with the clock name binding, to relate node
    parameters and node arguments.
 
-   - The other one is used to deal with polymorphic clock
-   variables. Indeed, constant clock is intrinsically
-   polymorphic. Hence, when clocking a contant (e.g., "42"), we
-   return the clock_info Ci_var i, where i is a fresh
-   integer. Afterwards, when encoutering an expression such as
-   "42+x", where we know the clock of x (clk_x), we produce the
-   substitution (i,clk_x).
+    - subst2 is used to deal with polymorphic clock variables. Indeed,
+    constant clock is intrinsically polymorphic. Hence, when clocking
+    a contant (e.g., "42"), we return the clock_info Ci_var i, where i
+    is a fresh integer. Afterwards, when encoutering an expression
+    such as "42+x", where we know the clock of x (clk_x), we produce
+    the substitution (i,clk_x).
 
-   XXX Shouldn't I merge the 2 kind of substitutions ?  That would
-   mean I need to invent a fake var_info_eff, but it would make the
-   whole more homogeous.
+    XXX Shouldn't I merge the 2 kind of substitutions ?  That would
+    mean I need to invent a fake var_info_eff, but it would make the
+    whole more homogeous.
 
-   XXX Make it abstract?
+    XXX Make it abstract?
 *)
 
 type subst1 = (Ident.t * Ident.t) list
diff --git a/test/lus2lic.sum b/test/lus2lic.sum
index 246afb49..d30dd22c 100644
--- a/test/lus2lic.sum
+++ b/test/lus2lic.sum
@@ -1,4 +1,4 @@
-Test Run By jahier on Wed Jan 16 18:35:13 2013
+Test Run By jahier on Fri Jan 18 10:57:18 2013
 Native configuration is i686-pc-linux-gnu
 
 		=== lus2lic tests ===
@@ -24,11 +24,21 @@ PASS: ec2c {-o /tmp/fby.c /tmp/fby.ec}
 PASS: ./lus2lic {-o /tmp/assertion.lic should_work/assertion.lus}
 PASS: ./lus2lic {-ec -o /tmp/assertion.ec should_work/assertion.lus}
 PASS: ec2c {-o /tmp/assertion.c /tmp/assertion.ec}
+PASS: ./lus2lic {-o /tmp/normal.lic should_work/normal.lus}
+PASS: ./lus2lic {-ec -o /tmp/normal.ec should_work/normal.lus}
+PASS: ec2c {-o /tmp/normal.c /tmp/normal.ec}
+PASS: ./lus2lic {-o /tmp/nodeparam.lic should_work/nodeparam.lus}
+PASS: ./lus2lic {-ec -o /tmp/nodeparam.ec should_work/nodeparam.lus}
+PASS: ec2c {-o /tmp/nodeparam.c /tmp/nodeparam.ec}
+PASS: ./lus2lic {-o /tmp/enum0.lic should_work/enum0.lus}
+PASS: ./lus2lic {-ec -o /tmp/enum0.ec should_work/enum0.lus}
+FAIL: Try ec2c on the result: ec2c {-o /tmp/enum0.c /tmp/enum0.ec}
 PASS: ./lus2lic {-o /tmp/ck6.lic should_work/ck6.lus}
 PASS: ./lus2lic {-ec -o /tmp/ck6.ec should_work/ck6.lus}
 PASS: ec2c {-o /tmp/ck6.c /tmp/ck6.ec}
 PASS: ./lus2lic {-o /tmp/Gyroscope2.lic should_work/Gyroscope2.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/Gyroscope2.ec should_work/Gyroscope2.lus}
+PASS: ./lus2lic {-ec -o /tmp/Gyroscope2.ec should_work/Gyroscope2.lus}
+PASS: ec2c {-o /tmp/Gyroscope2.c /tmp/Gyroscope2.ec}
 PASS: ./lus2lic {-o /tmp/mouse2.lic should_work/mouse2.lus}
 PASS: ./lus2lic {-ec -o /tmp/mouse2.ec should_work/mouse2.lus}
 PASS: ec2c {-o /tmp/mouse2.c /tmp/mouse2.ec}
@@ -78,7 +88,8 @@ PASS: ./lus2lic {-o /tmp/call06.lic should_work/call06.lus}
 PASS: ./lus2lic {-ec -o /tmp/call06.ec should_work/call06.lus}
 PASS: ec2c {-o /tmp/call06.c /tmp/call06.ec}
 PASS: ./lus2lic {-o /tmp/deSimone.lic should_work/deSimone.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/deSimone.ec should_work/deSimone.lus}
+PASS: ./lus2lic {-ec -o /tmp/deSimone.ec should_work/deSimone.lus}
+PASS: ec2c {-o /tmp/deSimone.c /tmp/deSimone.ec}
 PASS: ./lus2lic {-o /tmp/bug2.lic should_work/bug2.lus}
 PASS: ./lus2lic {-ec -o /tmp/bug2.ec should_work/bug2.lus}
 PASS: ec2c {-o /tmp/bug2.c /tmp/bug2.ec}
@@ -88,6 +99,9 @@ PASS: ec2c {-o /tmp/mm.c /tmp/mm.ec}
 PASS: ./lus2lic {-o /tmp/yyy.lic should_work/yyy.lus}
 PASS: ./lus2lic {-ec -o /tmp/yyy.ec should_work/yyy.lus}
 PASS: ec2c {-o /tmp/yyy.c /tmp/yyy.ec}
+PASS: ./lus2lic {-o /tmp/toolate.lic should_work/toolate.lus}
+PASS: ./lus2lic {-ec -o /tmp/toolate.ec should_work/toolate.lus}
+PASS: ec2c {-o /tmp/toolate.c /tmp/toolate.ec}
 PASS: ./lus2lic {-o /tmp/testCapt.lic should_work/testCapt.lus}
 PASS: ./lus2lic {-ec -o /tmp/testCapt.ec should_work/testCapt.lus}
 PASS: ec2c {-o /tmp/testCapt.c /tmp/testCapt.ec}
@@ -95,7 +109,8 @@ PASS: ./lus2lic {-o /tmp/nc7.lic should_work/nc7.lus}
 PASS: ./lus2lic {-ec -o /tmp/nc7.ec should_work/nc7.lus}
 PASS: ec2c {-o /tmp/nc7.c /tmp/nc7.ec}
 PASS: ./lus2lic {-o /tmp/predefOp.lic should_work/predefOp.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/predefOp.ec should_work/predefOp.lus}
+PASS: ./lus2lic {-ec -o /tmp/predefOp.ec should_work/predefOp.lus}
+PASS: ec2c {-o /tmp/predefOp.c /tmp/predefOp.ec}
 PASS: ./lus2lic {-o /tmp/t1.lic should_work/t1.lus}
 PASS: ./lus2lic {-ec -o /tmp/t1.ec should_work/t1.lus}
 PASS: ec2c {-o /tmp/t1.c /tmp/t1.ec}
@@ -160,7 +175,8 @@ PASS: ./lus2lic {-o /tmp/v1.lic should_work/v1.lus}
 PASS: ./lus2lic {-ec -o /tmp/v1.ec should_work/v1.lus}
 PASS: ec2c {-o /tmp/v1.c /tmp/v1.ec}
 PASS: ./lus2lic {-o /tmp/call04.lic should_work/call04.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/call04.ec should_work/call04.lus}
+PASS: ./lus2lic {-ec -o /tmp/call04.ec should_work/call04.lus}
+PASS: ec2c {-o /tmp/call04.c /tmp/call04.ec}
 PASS: ./lus2lic {-o /tmp/bascule.lic should_work/bascule.lus}
 PASS: ./lus2lic {-ec -o /tmp/bascule.ec should_work/bascule.lus}
 PASS: ec2c {-o /tmp/bascule.c /tmp/bascule.ec}
@@ -173,6 +189,12 @@ PASS: ec2c {-o /tmp/mm22.c /tmp/mm22.ec}
 PASS: ./lus2lic {-o /tmp/X1.lic should_work/X1.lus}
 PASS: ./lus2lic {-ec -o /tmp/X1.ec should_work/X1.lus}
 PASS: ec2c {-o /tmp/X1.c /tmp/X1.ec}
+PASS: ./lus2lic {-o /tmp/test_clash.lic should_work/test_clash.lus}
+PASS: ./lus2lic {-ec -o /tmp/test_clash.ec should_work/test_clash.lus}
+PASS: ec2c {-o /tmp/test_clash.c /tmp/test_clash.ec}
+PASS: ./lus2lic {-o /tmp/model2.lic should_work/model2.lus}
+PASS: ./lus2lic {-ec -o /tmp/model2.ec should_work/model2.lus}
+PASS: ec2c {-o /tmp/model2.c /tmp/model2.ec}
 PASS: ./lus2lic {-o /tmp/alarme.lic should_work/alarme.lus}
 PASS: ./lus2lic {-ec -o /tmp/alarme.ec should_work/alarme.lus}
 PASS: ec2c {-o /tmp/alarme.c /tmp/alarme.ec}
@@ -185,6 +207,9 @@ PASS: ec2c {-o /tmp/X6.c /tmp/X6.ec}
 PASS: ./lus2lic {-o /tmp/zzz2.lic should_work/zzz2.lus}
 PASS: ./lus2lic {-ec -o /tmp/zzz2.ec should_work/zzz2.lus}
 PASS: ec2c {-o /tmp/zzz2.c /tmp/zzz2.ec}
+PASS: ./lus2lic {-o /tmp/polymorphic_pack.lic should_work/polymorphic_pack.lus}
+PASS: ./lus2lic {-ec -o /tmp/polymorphic_pack.ec should_work/polymorphic_pack.lus}
+PASS: ec2c {-o /tmp/polymorphic_pack.c /tmp/polymorphic_pack.ec}
 PASS: ./lus2lic {-o /tmp/COUNTER.lic should_work/COUNTER.lus}
 PASS: ./lus2lic {-ec -o /tmp/COUNTER.ec should_work/COUNTER.lus}
 PASS: ec2c {-o /tmp/COUNTER.c /tmp/COUNTER.ec}
@@ -201,7 +226,8 @@ UNRESOLVED: Time out: ./lus2lic {-o /tmp/ec.lic should_work/ec.lus}
 UNRESOLVED: Time out: ./lus2lic {-ec -o /tmp/ec.ec should_work/ec.lus}
 PASS: ec2c {-o /tmp/ec.c /tmp/ec.ec}
 PASS: ./lus2lic {-o /tmp/morel3.lic should_work/morel3.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/morel3.ec should_work/morel3.lus}
+PASS: ./lus2lic {-ec -o /tmp/morel3.ec should_work/morel3.lus}
+PASS: ec2c {-o /tmp/morel3.c /tmp/morel3.ec}
 PASS: ./lus2lic {-o /tmp/fresh_name.lic should_work/fresh_name.lus}
 PASS: ./lus2lic {-ec -o /tmp/fresh_name.ec should_work/fresh_name.lus}
 PASS: ec2c {-o /tmp/fresh_name.c /tmp/fresh_name.ec}
@@ -227,13 +253,20 @@ PASS: ./lus2lic {-o /tmp/shift_ludic.lic should_work/shift_ludic.lus}
 PASS: ./lus2lic {-ec -o /tmp/shift_ludic.ec should_work/shift_ludic.lus}
 PASS: ec2c {-o /tmp/shift_ludic.c /tmp/shift_ludic.ec}
 PASS: ./lus2lic {-o /tmp/pilote-1.0.lic should_work/pilote-1.0.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/pilote-1.0.ec should_work/pilote-1.0.lus}
+PASS: ./lus2lic {-ec -o /tmp/pilote-1.0.ec should_work/pilote-1.0.lus}
+PASS: ec2c {-o /tmp/pilote-1.0.c /tmp/pilote-1.0.ec}
 PASS: ./lus2lic {-o /tmp/trivial.lic should_work/trivial.lus}
 PASS: ./lus2lic {-ec -o /tmp/trivial.ec should_work/trivial.lus}
 PASS: ec2c {-o /tmp/trivial.c /tmp/trivial.ec}
+PASS: ./lus2lic {-o /tmp/packs.lic should_work/packs.lus}
+PASS: ./lus2lic {-ec -o /tmp/packs.ec should_work/packs.lus}
+PASS: ec2c {-o /tmp/packs.c /tmp/packs.ec}
 PASS: ./lus2lic {-o /tmp/sincos.lic should_work/sincos.lus}
 PASS: ./lus2lic {-ec -o /tmp/sincos.ec should_work/sincos.lus}
 PASS: ec2c {-o /tmp/sincos.c /tmp/sincos.ec}
+PASS: ./lus2lic {-o /tmp/newpacks.lic should_work/newpacks.lus}
+PASS: ./lus2lic {-ec -o /tmp/newpacks.ec should_work/newpacks.lus}
+PASS: ec2c {-o /tmp/newpacks.c /tmp/newpacks.ec}
 PASS: ./lus2lic {-o /tmp/morel5.lic should_work/morel5.lus}
 PASS: ./lus2lic {-ec -o /tmp/morel5.ec should_work/morel5.lus}
 PASS: ec2c {-o /tmp/morel5.c /tmp/morel5.ec}
@@ -241,7 +274,8 @@ PASS: ./lus2lic {-o /tmp/bred.lic should_work/bred.lus}
 PASS: ./lus2lic {-ec -o /tmp/bred.ec should_work/bred.lus}
 PASS: ec2c {-o /tmp/bred.c /tmp/bred.ec}
 PASS: ./lus2lic {-o /tmp/tri.lic should_work/tri.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/tri.ec should_work/tri.lus}
+PASS: ./lus2lic {-ec -o /tmp/tri.ec should_work/tri.lus}
+PASS: ec2c {-o /tmp/tri.c /tmp/tri.ec}
 PASS: ./lus2lic {-o /tmp/calculs_max.lic should_work/calculs_max.lus}
 PASS: ./lus2lic {-ec -o /tmp/calculs_max.ec should_work/calculs_max.lus}
 PASS: ec2c {-o /tmp/calculs_max.c /tmp/calculs_max.ec}
@@ -258,7 +292,8 @@ PASS: ./lus2lic {-o /tmp/clock_ite.lic should_work/clock_ite.lus}
 PASS: ./lus2lic {-ec -o /tmp/clock_ite.ec should_work/clock_ite.lus}
 PASS: ec2c {-o /tmp/clock_ite.c /tmp/clock_ite.ec}
 PASS: ./lus2lic {-o /tmp/morel4.lic should_work/morel4.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/morel4.ec should_work/morel4.lus}
+PASS: ./lus2lic {-ec -o /tmp/morel4.ec should_work/morel4.lus}
+PASS: ec2c {-o /tmp/morel4.c /tmp/morel4.ec}
 PASS: ./lus2lic {-o /tmp/enum.lic should_work/enum.lus}
 PASS: ./lus2lic {-ec -o /tmp/enum.ec should_work/enum.lus}
 PASS: ec2c {-o /tmp/enum.c /tmp/enum.ec}
@@ -269,7 +304,8 @@ PASS: ./lus2lic {-o /tmp/onlyroll.lic should_work/onlyroll.lus}
 PASS: ./lus2lic {-ec -o /tmp/onlyroll.ec should_work/onlyroll.lus}
 PASS: ec2c {-o /tmp/onlyroll.c /tmp/onlyroll.ec}
 PASS: ./lus2lic {-o /tmp/produitBool.lic should_work/produitBool.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/produitBool.ec should_work/produitBool.lus}
+PASS: ./lus2lic {-ec -o /tmp/produitBool.ec should_work/produitBool.lus}
+PASS: ec2c {-o /tmp/produitBool.c /tmp/produitBool.ec}
 PASS: ./lus2lic {-o /tmp/noeudsIndependants.lic should_work/noeudsIndependants.lus}
 PASS: ./lus2lic {-ec -o /tmp/noeudsIndependants.ec should_work/noeudsIndependants.lus}
 PASS: ec2c {-o /tmp/noeudsIndependants.c /tmp/noeudsIndependants.ec}
@@ -297,6 +333,9 @@ PASS: ec2c {-o /tmp/mm3.c /tmp/mm3.ec}
 PASS: ./lus2lic {-o /tmp/over2.lic should_work/over2.lus}
 PASS: ./lus2lic {-ec -o /tmp/over2.ec should_work/over2.lus}
 PASS: ec2c {-o /tmp/over2.c /tmp/over2.ec}
+PASS: ./lus2lic {-o /tmp/over3.lic should_work/over3.lus}
+PASS: ./lus2lic {-ec -o /tmp/over3.ec should_work/over3.lus}
+FAIL: Try ec2c on the result: ec2c {-o /tmp/over3.c /tmp/over3.ec}
 PASS: ./lus2lic {-o /tmp/complex.lic should_work/complex.lus}
 PASS: ./lus2lic {-ec -o /tmp/complex.ec should_work/complex.lus}
 PASS: ec2c {-o /tmp/complex.c /tmp/complex.ec}
@@ -328,7 +367,8 @@ PASS: ./lus2lic {-o /tmp/compteur.lic should_work/compteur.lus}
 PASS: ./lus2lic {-ec -o /tmp/compteur.ec should_work/compteur.lus}
 PASS: ec2c {-o /tmp/compteur.c /tmp/compteur.ec}
 PASS: ./lus2lic {-o /tmp/Int.lic should_work/Int.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/Int.ec should_work/Int.lus}
+PASS: ./lus2lic {-ec -o /tmp/Int.ec should_work/Int.lus}
+PASS: ec2c {-o /tmp/Int.c /tmp/Int.ec}
 PASS: ./lus2lic {-o /tmp/t2.lic should_work/t2.lus}
 PASS: ./lus2lic {-ec -o /tmp/t2.ec should_work/t2.lus}
 PASS: ec2c {-o /tmp/t2.c /tmp/t2.ec}
@@ -369,7 +409,8 @@ PASS: ./lus2lic {-o /tmp/nc2.lic should_work/nc2.lus}
 PASS: ./lus2lic {-ec -o /tmp/nc2.ec should_work/nc2.lus}
 PASS: ec2c {-o /tmp/nc2.c /tmp/nc2.ec}
 PASS: ./lus2lic {-o /tmp/morel.lic should_work/morel.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/morel.ec should_work/morel.lus}
+PASS: ./lus2lic {-ec -o /tmp/morel.ec should_work/morel.lus}
+PASS: ec2c {-o /tmp/morel.c /tmp/morel.ec}
 PASS: ./lus2lic {-o /tmp/SOURIS.lic should_work/SOURIS.lus}
 PASS: ./lus2lic {-ec -o /tmp/SOURIS.ec should_work/SOURIS.lus}
 PASS: ec2c {-o /tmp/SOURIS.c /tmp/SOURIS.ec}
@@ -379,8 +420,12 @@ PASS: ec2c {-o /tmp/param_node2.c /tmp/param_node2.ec}
 PASS: ./lus2lic {-o /tmp/o2l_feux_compl.lic should_work/o2l_feux_compl.lus}
 PASS: ./lus2lic {-ec -o /tmp/o2l_feux_compl.ec should_work/o2l_feux_compl.lus}
 PASS: ec2c {-o /tmp/o2l_feux_compl.c /tmp/o2l_feux_compl.ec}
+PASS: ./lus2lic {-o /tmp/model.lic should_work/model.lus}
+PASS: ./lus2lic {-ec -o /tmp/model.ec should_work/model.lus}
+PASS: ec2c {-o /tmp/model.c /tmp/model.ec}
 PASS: ./lus2lic {-o /tmp/matrice.lic should_work/matrice.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/matrice.ec should_work/matrice.lus}
+PASS: ./lus2lic {-ec -o /tmp/matrice.ec should_work/matrice.lus}
+PASS: ec2c {-o /tmp/matrice.c /tmp/matrice.ec}
 PASS: ./lus2lic {-o /tmp/TIME_STABLE.lic should_work/TIME_STABLE.lus}
 PASS: ./lus2lic {-ec -o /tmp/TIME_STABLE.ec should_work/TIME_STABLE.lus}
 PASS: ec2c {-o /tmp/TIME_STABLE.c /tmp/TIME_STABLE.ec}
@@ -399,12 +444,18 @@ PASS: ec2c {-o /tmp/exclusion.c /tmp/exclusion.ec}
 PASS: ./lus2lic {-o /tmp/def.lic should_work/def.lus}
 PASS: ./lus2lic {-ec -o /tmp/def.ec should_work/def.lus}
 UNRESOLVED: Time out: ec2c {-o /tmp/def.c /tmp/def.ec}
+PASS: ./lus2lic {-o /tmp/ply01.lic should_work/ply01.lus}
+PASS: ./lus2lic {-ec -o /tmp/ply01.ec should_work/ply01.lus}
+PASS: ec2c {-o /tmp/ply01.c /tmp/ply01.ec}
 PASS: ./lus2lic {-o /tmp/consensus.lic should_work/consensus.lus}
 PASS: ./lus2lic {-ec -o /tmp/consensus.ec should_work/consensus.lus}
 PASS: ec2c {-o /tmp/consensus.c /tmp/consensus.ec}
 PASS: ./lus2lic {-o /tmp/activation2.lic should_work/activation2.lus}
 PASS: ./lus2lic {-ec -o /tmp/activation2.ec should_work/activation2.lus}
 PASS: ec2c {-o /tmp/activation2.c /tmp/activation2.ec}
+PASS: ./lus2lic {-o /tmp/type_decl.lic should_work/type_decl.lus}
+PASS: ./lus2lic {-ec -o /tmp/type_decl.ec should_work/type_decl.lus}
+FAIL: Try ec2c on the result: ec2c {-o /tmp/type_decl.c /tmp/type_decl.ec}
 PASS: ./lus2lic {-o /tmp/import1.lic should_work/import1.lus}
 PASS: ./lus2lic {-ec -o /tmp/import1.ec should_work/import1.lus}
 PASS: ec2c {-o /tmp/import1.c /tmp/import1.ec}
@@ -423,10 +474,15 @@ PASS: ec2c {-o /tmp/struct.c /tmp/struct.ec}
 PASS: ./lus2lic {-o /tmp/stopwatch.lic should_work/stopwatch.lus}
 PASS: ./lus2lic {-ec -o /tmp/stopwatch.ec should_work/stopwatch.lus}
 PASS: ec2c {-o /tmp/stopwatch.c /tmp/stopwatch.ec}
+PASS: ./lus2lic {-o /tmp/contractForElementSelectionInArray.lic should_work/contractForElementSelectionInArray.lus}
+PASS: ./lus2lic {-ec -o /tmp/contractForElementSelectionInArray.ec should_work/contractForElementSelectionInArray.lus}
+PASS: ec2c {-o /tmp/contractForElementSelectionInArray.c /tmp/contractForElementSelectionInArray.ec}
 PASS: ./lus2lic {-o /tmp/iterFibo.lic should_work/iterFibo.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/iterFibo.ec should_work/iterFibo.lus}
+PASS: ./lus2lic {-ec -o /tmp/iterFibo.ec should_work/iterFibo.lus}
+PASS: ec2c {-o /tmp/iterFibo.c /tmp/iterFibo.ec}
 PASS: ./lus2lic {-o /tmp/morel2.lic should_work/morel2.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/morel2.ec should_work/morel2.lus}
+PASS: ./lus2lic {-ec -o /tmp/morel2.ec should_work/morel2.lus}
+PASS: ec2c {-o /tmp/morel2.c /tmp/morel2.ec}
 PASS: ./lus2lic {-o /tmp/minmax1.lic should_work/minmax1.lus}
 PASS: ./lus2lic {-ec -o /tmp/minmax1.ec should_work/minmax1.lus}
 PASS: ec2c {-o /tmp/minmax1.c /tmp/minmax1.ec}
@@ -458,10 +514,17 @@ PASS: ./lus2lic {-o /tmp/lecteur.lic should_work/lecteur.lus}
 PASS: ./lus2lic {-ec -o /tmp/lecteur.ec should_work/lecteur.lus}
 PASS: ec2c {-o /tmp/lecteur.c /tmp/lecteur.ec}
 PASS: ./lus2lic {-o /tmp/bug.lic should_work/bug.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/bug.ec should_work/bug.lus}
+PASS: ./lus2lic {-ec -o /tmp/bug.ec should_work/bug.lus}
+PASS: ec2c {-o /tmp/bug.c /tmp/bug.ec}
 PASS: ./lus2lic {-o /tmp/ck4.lic should_work/ck4.lus}
 PASS: ./lus2lic {-ec -o /tmp/ck4.ec should_work/ck4.lus}
 PASS: ec2c {-o /tmp/ck4.c /tmp/ck4.ec}
+PASS: ./lus2lic {-o /tmp/map_red_iter.lic should_work/map_red_iter.lus}
+PASS: ./lus2lic {-ec -o /tmp/map_red_iter.ec should_work/map_red_iter.lus}
+PASS: ec2c {-o /tmp/map_red_iter.c /tmp/map_red_iter.ec}
+PASS: ./lus2lic {-o /tmp/p.lic should_work/p.lus}
+PASS: ./lus2lic {-ec -o /tmp/p.ec should_work/p.lus}
+PASS: ec2c {-o /tmp/p.c /tmp/p.ec}
 PASS: ./lus2lic {-o /tmp/struct0.lic should_work/struct0.lus}
 PASS: ./lus2lic {-ec -o /tmp/struct0.ec should_work/struct0.lus}
 PASS: ec2c {-o /tmp/struct0.c /tmp/struct0.ec}
@@ -475,7 +538,8 @@ PASS: ./lus2lic {-o /tmp/nested.lic should_work/nested.lus}
 PASS: ./lus2lic {-ec -o /tmp/nested.ec should_work/nested.lus}
 PASS: ec2c {-o /tmp/nested.c /tmp/nested.ec}
 PASS: ./lus2lic {-o /tmp/Gyroscope.lic should_work/Gyroscope.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/Gyroscope.ec should_work/Gyroscope.lus}
+PASS: ./lus2lic {-ec -o /tmp/Gyroscope.ec should_work/Gyroscope.lus}
+PASS: ec2c {-o /tmp/Gyroscope.c /tmp/Gyroscope.ec}
 PASS: ./lus2lic {-o /tmp/asservi.lic should_work/asservi.lus}
 PASS: ./lus2lic {-ec -o /tmp/asservi.ec should_work/asservi.lus}
 PASS: ec2c {-o /tmp/asservi.c /tmp/asservi.ec}
@@ -485,6 +549,9 @@ PASS: ec2c {-o /tmp/rediter.c /tmp/rediter.ec}
 PASS: ./lus2lic {-o /tmp/mapdeRed.lic should_work/mapdeRed.lus}
 PASS: ./lus2lic {-ec -o /tmp/mapdeRed.ec should_work/mapdeRed.lus}
 PASS: ec2c {-o /tmp/mapdeRed.c /tmp/mapdeRed.ec}
+PASS: ./lus2lic {-o /tmp/modelInst.lic should_work/modelInst.lus}
+PASS: ./lus2lic {-ec -o /tmp/modelInst.ec should_work/modelInst.lus}
+PASS: ec2c {-o /tmp/modelInst.c /tmp/modelInst.ec}
 PASS: ./lus2lic {-o /tmp/dependeur_struct.lic should_work/dependeur_struct.lus}
 PASS: ./lus2lic {-ec -o /tmp/dependeur_struct.ec should_work/dependeur_struct.lus}
 PASS: ec2c {-o /tmp/dependeur_struct.c /tmp/dependeur_struct.ec}
@@ -521,6 +588,9 @@ PASS: ec2c {-o /tmp/alias.c /tmp/alias.ec}
 PASS: ./lus2lic {-o /tmp/hanane.lic should_work/hanane.lus}
 PASS: ./lus2lic {-ec -o /tmp/hanane.ec should_work/hanane.lus}
 PASS: ec2c {-o /tmp/hanane.c /tmp/hanane.ec}
+PASS: ./lus2lic {-o /tmp/lustre.lic should_work/lustre.lus}
+PASS: ./lus2lic {-ec -o /tmp/lustre.ec should_work/lustre.lus}
+PASS: ec2c {-o /tmp/lustre.c /tmp/lustre.ec}
 PASS: ./lus2lic {-o /tmp/packed_cst.lic should_work/packed_cst.lus}
 PASS: ./lus2lic {-ec -o /tmp/packed_cst.ec should_work/packed_cst.lus}
 PASS: ec2c {-o /tmp/packed_cst.c /tmp/packed_cst.ec}
@@ -528,7 +598,8 @@ PASS: ./lus2lic {-o /tmp/predef02.lic should_work/predef02.lus}
 PASS: ./lus2lic {-ec -o /tmp/predef02.ec should_work/predef02.lus}
 PASS: ec2c {-o /tmp/predef02.c /tmp/predef02.ec}
 PASS: ./lus2lic {-o /tmp/toto.lic should_work/toto.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/toto.ec should_work/toto.lus}
+PASS: ./lus2lic {-ec -o /tmp/toto.ec should_work/toto.lus}
+PASS: ec2c {-o /tmp/toto.c /tmp/toto.ec}
 PASS: ./lus2lic {-o /tmp/minmax6.lic should_work/minmax6.lus}
 PASS: ./lus2lic {-ec -o /tmp/minmax6.ec should_work/minmax6.lus}
 PASS: ec2c {-o /tmp/minmax6.c /tmp/minmax6.ec}
@@ -556,6 +627,9 @@ PASS: ec2c {-o /tmp/ck7.c /tmp/ck7.ec}
 PASS: ./lus2lic {-o /tmp/nc10.lic should_work/nc10.lus}
 PASS: ./lus2lic {-ec -o /tmp/nc10.ec should_work/nc10.lus}
 PASS: ec2c {-o /tmp/nc10.c /tmp/nc10.ec}
+PASS: ./lus2lic {-o /tmp/triSel.lic should_work/triSel.lus}
+PASS: ./lus2lic {-ec -o /tmp/triSel.ec should_work/triSel.lus}
+PASS: ec2c {-o /tmp/triSel.c /tmp/triSel.ec}
 PASS: ./lus2lic {-o /tmp/s.lic should_work/s.lus}
 PASS: ./lus2lic {-ec -o /tmp/s.ec should_work/s.lus}
 PASS: ec2c {-o /tmp/s.c /tmp/s.ec}
@@ -568,11 +642,15 @@ PASS: ec2c {-o /tmp/flo.c /tmp/flo.ec}
 PASS: ./lus2lic {-o /tmp/shiftFill_ludic.lic should_work/shiftFill_ludic.lus}
 PASS: ./lus2lic {-ec -o /tmp/shiftFill_ludic.ec should_work/shiftFill_ludic.lus}
 PASS: ec2c {-o /tmp/shiftFill_ludic.c /tmp/shiftFill_ludic.ec}
+PASS: ./lus2lic {-o /tmp/parametric_node2.lic should_work/parametric_node2.lus}
+PASS: ./lus2lic {-ec -o /tmp/parametric_node2.ec should_work/parametric_node2.lus}
+PASS: ec2c {-o /tmp/parametric_node2.c /tmp/parametric_node2.ec}
 PASS: ./lus2lic {-o /tmp/after.lic should_work/after.lus}
 PASS: ./lus2lic {-ec -o /tmp/after.ec should_work/after.lus}
 PASS: ec2c {-o /tmp/after.c /tmp/after.ec}
 PASS: ./lus2lic {-o /tmp/arrays.lic should_work/arrays.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/arrays.ec should_work/arrays.lus}
+PASS: ./lus2lic {-ec -o /tmp/arrays.ec should_work/arrays.lus}
+PASS: ec2c {-o /tmp/arrays.c /tmp/arrays.ec}
 PASS: ./lus2lic {-o /tmp/eq1.lic should_work/eq1.lus}
 PASS: ./lus2lic {-ec -o /tmp/eq1.ec should_work/eq1.lus}
 PASS: ec2c {-o /tmp/eq1.c /tmp/eq1.ec}
@@ -592,7 +670,8 @@ PASS: ./lus2lic {-o /tmp/EDGE.lic should_work/EDGE.lus}
 PASS: ./lus2lic {-ec -o /tmp/EDGE.ec should_work/EDGE.lus}
 PASS: ec2c {-o /tmp/EDGE.c /tmp/EDGE.ec}
 PASS: ./lus2lic {-o /tmp/call03.lic should_work/call03.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/call03.ec should_work/call03.lus}
+PASS: ./lus2lic {-ec -o /tmp/call03.ec should_work/call03.lus}
+PASS: ec2c {-o /tmp/call03.c /tmp/call03.ec}
 PASS: ./lus2lic {-o /tmp/count.lic should_work/count.lus}
 PASS: ./lus2lic {-ec -o /tmp/count.ec should_work/count.lus}
 PASS: ec2c {-o /tmp/count.c /tmp/count.ec}
@@ -602,6 +681,9 @@ PASS: ec2c {-o /tmp/ck2.c /tmp/ck2.ec}
 PASS: ./lus2lic {-o /tmp/X.lic should_work/X.lus}
 PASS: ./lus2lic {-ec -o /tmp/X.ec should_work/X.lus}
 PASS: ec2c {-o /tmp/X.c /tmp/X.ec}
+PASS: ./lus2lic {-o /tmp/Condact.lic should_work/Condact.lus}
+PASS: ./lus2lic {-ec -o /tmp/Condact.ec should_work/Condact.lus}
+PASS: ec2c {-o /tmp/Condact.c /tmp/Condact.ec}
 PASS: ./lus2lic {-o /tmp/poussoir.lic should_work/poussoir.lus}
 PASS: ./lus2lic {-ec -o /tmp/poussoir.ec should_work/poussoir.lus}
 PASS: ec2c {-o /tmp/poussoir.c /tmp/poussoir.ec}
@@ -611,6 +693,9 @@ PASS: ec2c {-o /tmp/SWITCH1.c /tmp/SWITCH1.ec}
 PASS: ./lus2lic {-o /tmp/clock1_2ms.lic should_work/clock1_2ms.lus}
 PASS: ./lus2lic {-ec -o /tmp/clock1_2ms.ec should_work/clock1_2ms.lus}
 PASS: ec2c {-o /tmp/clock1_2ms.c /tmp/clock1_2ms.ec}
+PASS: ./lus2lic {-o /tmp/decl.lic should_work/decl.lus}
+PASS: ./lus2lic {-ec -o /tmp/decl.ec should_work/decl.lus}
+FAIL: Try ec2c on the result: ec2c {-o /tmp/decl.c /tmp/decl.ec}
 PASS: ./lus2lic {-o /tmp/bred_lv4.lic should_work/bred_lv4.lus}
 PASS: ./lus2lic {-ec -o /tmp/bred_lv4.ec should_work/bred_lv4.lus}
 PASS: ec2c {-o /tmp/bred_lv4.c /tmp/bred_lv4.ec}
@@ -620,6 +705,9 @@ PASS: ec2c {-o /tmp/trivial2.c /tmp/trivial2.ec}
 PASS: ./lus2lic {-o /tmp/param_node.lic should_work/param_node.lus}
 PASS: ./lus2lic {-ec -o /tmp/param_node.ec should_work/param_node.lus}
 PASS: ec2c {-o /tmp/param_node.c /tmp/param_node.ec}
+PASS: ./lus2lic {-o /tmp/simple.lic should_work/simple.lus}
+PASS: ./lus2lic {-ec -o /tmp/simple.ec should_work/simple.lus}
+PASS: ec2c {-o /tmp/simple.c /tmp/simple.ec}
 PASS: ./lus2lic {-o /tmp/func_with_body.lic should_work/func_with_body.lus}
 PASS: ./lus2lic {-ec -o /tmp/func_with_body.ec should_work/func_with_body.lus}
 PASS: ec2c {-o /tmp/func_with_body.c /tmp/func_with_body.ec}
@@ -627,7 +715,8 @@ PASS: ./lus2lic {-o /tmp/minus.lic should_work/minus.lus}
 PASS: ./lus2lic {-ec -o /tmp/minus.ec should_work/minus.lus}
 PASS: ec2c {-o /tmp/minus.c /tmp/minus.ec}
 PASS: ./lus2lic {-o /tmp/remplissage-1.0.lic should_work/remplissage-1.0.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/remplissage-1.0.ec should_work/remplissage-1.0.lus}
+PASS: ./lus2lic {-ec -o /tmp/remplissage-1.0.ec should_work/remplissage-1.0.lus}
+PASS: ec2c {-o /tmp/remplissage-1.0.c /tmp/remplissage-1.0.ec}
 XFAIL: Test bad programs (syntax): lus2lic {-o /tmp/old_style_and_pack.lic should_fail/syntax/old_style_and_pack.lus}
 XFAIL: Test bad programs (syntax): lus2lic {-o /tmp/record.lic should_fail/syntax/record.lus}
 XFAIL: Test bad programs (type): lus2lic {-o /tmp/parametric_node3.lic should_fail/type/parametric_node3.lus}
@@ -657,18 +746,10 @@ XFAIL: Test bad programs (semantics): lus2lic {-o /tmp/m.lic should_fail/semanti
 Running ./lus2lic.tests/progression.exp ...
 FAIL: without any option: ./lus2lic {    -o /tmp/when_enum.out should_work/broken/when_enum.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/when_enum.ec  should_work/broken/when_enum.lus}
-PASS: ./lus2lic {    -o /tmp/normal.out should_work/broken/normal.lus}
-UNRESOLVED: Time out: ./lus2lic {-ec -o /tmp/normal.ec  should_work/broken/normal.lus}
-PASS: ./lus2lic {    -o /tmp/nodeparam.out should_work/broken/nodeparam.lus}
-PASS: ./lus2lic {-ec -o /tmp/nodeparam.ec  should_work/broken/nodeparam.lus}
-PASS: ./lus2lic {    -o /tmp/enum0.out should_work/broken/enum0.lus}
-PASS: ./lus2lic {-ec -o /tmp/enum0.ec  should_work/broken/enum0.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/parametric_node.out should_work/broken/parametric_node.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/parametric_node.ec  should_work/broken/parametric_node.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/bad_call02.out should_work/broken/bad_call02.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/bad_call02.ec  should_work/broken/bad_call02.lus}
-PASS: ./lus2lic {    -o /tmp/toolate.out should_work/broken/toolate.lus}
-FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/toolate.ec  should_work/broken/toolate.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/packageTableau.out should_work/broken/packageTableau.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/packageTableau.ec  should_work/broken/packageTableau.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/condact2.out should_work/broken/condact2.lus}
@@ -681,28 +762,16 @@ PASS: ./lus2lic {    -o /tmp/ply02.out should_work/broken/ply02.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/ply02.ec  should_work/broken/ply02.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/bug3.out should_work/broken/bug3.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/bug3.ec  should_work/broken/bug3.lus}
-PASS: ./lus2lic {    -o /tmp/test_clash.out should_work/broken/test_clash.lus}
-PASS: ./lus2lic {-ec -o /tmp/test_clash.ec  should_work/broken/test_clash.lus}
-PASS: ./lus2lic {    -o /tmp/model2.out should_work/broken/model2.lus}
-PASS: ./lus2lic {-ec -o /tmp/model2.ec  should_work/broken/model2.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/when_not.out should_work/broken/when_not.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/when_not.ec  should_work/broken/when_not.lus}
-PASS: ./lus2lic {    -o /tmp/polymorphic_pack.out should_work/broken/polymorphic_pack.lus}
-PASS: ./lus2lic {-ec -o /tmp/polymorphic_pack.ec  should_work/broken/polymorphic_pack.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/old_style_and_pack.out should_work/broken/old_style_and_pack.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/old_style_and_pack.ec  should_work/broken/old_style_and_pack.lus}
-PASS: ./lus2lic {    -o /tmp/packs.out should_work/broken/packs.lus}
-PASS: ./lus2lic {-ec -o /tmp/packs.ec  should_work/broken/packs.lus}
-PASS: ./lus2lic {    -o /tmp/newpacks.out should_work/broken/newpacks.lus}
-PASS: ./lus2lic {-ec -o /tmp/newpacks.ec  should_work/broken/newpacks.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/inonout.out should_work/broken/inonout.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/inonout.ec  should_work/broken/inonout.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/pfs.out should_work/broken/pfs.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/pfs.ec  should_work/broken/pfs.lus}
 PASS: ./lus2lic {    -o /tmp/bad_call03.out should_work/broken/bad_call03.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/bad_call03.ec  should_work/broken/bad_call03.lus}
-PASS: ./lus2lic {    -o /tmp/over3.out should_work/broken/over3.lus}
-PASS: ./lus2lic {-ec -o /tmp/over3.ec  should_work/broken/over3.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/packages.out should_work/broken/packages.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/packages.ec  should_work/broken/packages.lus}
 PASS: ./lus2lic {    -o /tmp/when_node.out should_work/broken/when_node.lus}
@@ -717,20 +786,12 @@ FAIL: without any option: ./lus2lic {    -o /tmp/Gyro.out should_work/broken/Gyr
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/Gyro.ec  should_work/broken/Gyro.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/import2.out should_work/broken/import2.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/import2.ec  should_work/broken/import2.lus}
-PASS: ./lus2lic {    -o /tmp/model.out should_work/broken/model.lus}
-PASS: ./lus2lic {-ec -o /tmp/model.ec  should_work/broken/model.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/multipar.out should_work/broken/multipar.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/multipar.ec  should_work/broken/multipar.lus}
-PASS: ./lus2lic {    -o /tmp/ply01.out should_work/broken/ply01.lus}
-PASS: ./lus2lic {-ec -o /tmp/ply01.ec  should_work/broken/ply01.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/bad_call01.out should_work/broken/bad_call01.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/bad_call01.ec  should_work/broken/bad_call01.lus}
-PASS: ./lus2lic {    -o /tmp/type_decl.out should_work/broken/type_decl.lus}
-PASS: ./lus2lic {-ec -o /tmp/type_decl.ec  should_work/broken/type_decl.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/clock.out should_work/broken/clock.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/clock.ec  should_work/broken/clock.lus}
-PASS: ./lus2lic {    -o /tmp/contractForElementSelectionInArray.out should_work/broken/contractForElementSelectionInArray.lus}
-PASS: ./lus2lic {-ec -o /tmp/contractForElementSelectionInArray.ec  should_work/broken/contractForElementSelectionInArray.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/x.out should_work/broken/x.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/x.ec  should_work/broken/x.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/record.out should_work/broken/record.lus}
@@ -741,22 +802,14 @@ FAIL: without any option: ./lus2lic {    -o /tmp/parametric_node4.out should_wor
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/parametric_node4.ec  should_work/broken/parametric_node4.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/testSystem.out should_work/broken/testSystem.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/testSystem.ec  should_work/broken/testSystem.lus}
-PASS: ./lus2lic {    -o /tmp/map_red_iter.out should_work/broken/map_red_iter.lus}
-PASS: ./lus2lic {-ec -o /tmp/map_red_iter.ec  should_work/broken/map_red_iter.lus}
-PASS: ./lus2lic {    -o /tmp/p.out should_work/broken/p.lus}
-PASS: ./lus2lic {-ec -o /tmp/p.ec  should_work/broken/p.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/ts03.out should_work/broken/ts03.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/ts03.ec  should_work/broken/ts03.lus}
-PASS: ./lus2lic {    -o /tmp/modelInst.out should_work/broken/modelInst.lus}
-PASS: ./lus2lic {-ec -o /tmp/modelInst.ec  should_work/broken/modelInst.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/const2.out should_work/broken/const2.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/const2.ec  should_work/broken/const2.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/car-orig.out should_work/broken/car-orig.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/car-orig.ec  should_work/broken/car-orig.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/sargs.out should_work/broken/sargs.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/sargs.ec  should_work/broken/sargs.lus}
-PASS: ./lus2lic {    -o /tmp/lustre.out should_work/broken/lustre.lus}
-PASS: ./lus2lic {-ec -o /tmp/lustre.ec  should_work/broken/lustre.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/patrick.out should_work/broken/patrick.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/patrick.ec  should_work/broken/patrick.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/const.out should_work/broken/const.lus}
@@ -767,8 +820,6 @@ PASS: ./lus2lic {    -o /tmp/cond01.out should_work/broken/cond01.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/cond01.ec  should_work/broken/cond01.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/ts02.out should_work/broken/ts02.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/ts02.ec  should_work/broken/ts02.lus}
-PASS: ./lus2lic {    -o /tmp/parametric_node2.out should_work/broken/parametric_node2.lus}
-PASS: ./lus2lic {-ec -o /tmp/parametric_node2.ec  should_work/broken/parametric_node2.lus}
 PASS: ./lus2lic {    -o /tmp/overload.out should_work/broken/overload.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/overload.ec  should_work/broken/overload.lus}
 PASS: ./lus2lic {    -o /tmp/main.out should_work/broken/main.lus}
@@ -779,14 +830,8 @@ FAIL: without any option: ./lus2lic {    -o /tmp/bad_id.out should_work/broken/b
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/bad_id.ec  should_work/broken/bad_id.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/car.out should_work/broken/car.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/car.ec  should_work/broken/car.lus}
-PASS: ./lus2lic {    -o /tmp/Condact.out should_work/broken/Condact.lus}
-PASS: ./lus2lic {-ec -o /tmp/Condact.ec  should_work/broken/Condact.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/merge.out should_work/broken/merge.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/merge.ec  should_work/broken/merge.lus}
-PASS: ./lus2lic {    -o /tmp/decl.out should_work/broken/decl.lus}
-PASS: ./lus2lic {-ec -o /tmp/decl.ec  should_work/broken/decl.lus}
-PASS: ./lus2lic {    -o /tmp/simple.out should_work/broken/simple.lus}
-PASS: ./lus2lic {-ec -o /tmp/simple.ec  should_work/broken/simple.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/clock2.out should_work/broken/clock2.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/clock2.ec  should_work/broken/clock2.lus}
 XPASS: Test bad programs (type): lus2lic {-o /tmp/bad_call03.lic should_fail/type/broken/bad_call03.lus}
@@ -800,8 +845,8 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman
 
 		=== lus2lic Summary ===
 
-# of expected passes		646
-# of unexpected failures	102
+# of expected passes		709
+# of unexpected failures	85
 # of unexpected successes	8
 # of expected failures		26
-# of unresolved testcases	6
+# of unresolved testcases	5
diff --git a/test/lus2lic.time b/test/lus2lic.time
index 9c3c3314..12344abc 100644
--- a/test/lus2lic.time
+++ b/test/lus2lic.time
@@ -1,2 +1,2 @@
-testcase ./lus2lic.tests/non-reg.exp completed in 160 seconds
-testcase ./lus2lic.tests/progression.exp completed in 12 seconds
+testcase ./lus2lic.tests/non-reg.exp completed in 141 seconds
+testcase ./lus2lic.tests/progression.exp completed in 8 seconds
diff --git a/test/should_work/broken/Condact.lus b/test/should_work/Condact.lus
similarity index 100%
rename from test/should_work/broken/Condact.lus
rename to test/should_work/Condact.lus
diff --git a/test/should_work/broken/contractForElementSelectionInArray.lus b/test/should_work/contractForElementSelectionInArray.lus
similarity index 100%
rename from test/should_work/broken/contractForElementSelectionInArray.lus
rename to test/should_work/contractForElementSelectionInArray.lus
diff --git a/test/should_work/broken/decl.lus b/test/should_work/decl.lus
similarity index 100%
rename from test/should_work/broken/decl.lus
rename to test/should_work/decl.lus
diff --git a/test/should_work/broken/enum0.lus b/test/should_work/enum0.lus
similarity index 100%
rename from test/should_work/broken/enum0.lus
rename to test/should_work/enum0.lus
diff --git a/test/should_work/broken/lustre.lus b/test/should_work/lustre.lus
similarity index 100%
rename from test/should_work/broken/lustre.lus
rename to test/should_work/lustre.lus
diff --git a/test/should_work/broken/map_red_iter.lus b/test/should_work/map_red_iter.lus
similarity index 100%
rename from test/should_work/broken/map_red_iter.lus
rename to test/should_work/map_red_iter.lus
diff --git a/test/should_work/broken/model.lus b/test/should_work/model.lus
similarity index 100%
rename from test/should_work/broken/model.lus
rename to test/should_work/model.lus
diff --git a/test/should_work/broken/model2.lus b/test/should_work/model2.lus
similarity index 100%
rename from test/should_work/broken/model2.lus
rename to test/should_work/model2.lus
diff --git a/test/should_work/broken/modelInst.lus b/test/should_work/modelInst.lus
similarity index 100%
rename from test/should_work/broken/modelInst.lus
rename to test/should_work/modelInst.lus
diff --git a/test/should_work/broken/newpacks.lus b/test/should_work/newpacks.lus
similarity index 100%
rename from test/should_work/broken/newpacks.lus
rename to test/should_work/newpacks.lus
diff --git a/test/should_work/broken/nodeparam.lus b/test/should_work/nodeparam.lus
similarity index 100%
rename from test/should_work/broken/nodeparam.lus
rename to test/should_work/nodeparam.lus
diff --git a/test/should_work/broken/normal.lus b/test/should_work/normal.lus
similarity index 100%
rename from test/should_work/broken/normal.lus
rename to test/should_work/normal.lus
diff --git a/test/should_work/broken/over3.lus b/test/should_work/over3.lus
similarity index 100%
rename from test/should_work/broken/over3.lus
rename to test/should_work/over3.lus
diff --git a/test/should_work/broken/p.lus b/test/should_work/p.lus
similarity index 100%
rename from test/should_work/broken/p.lus
rename to test/should_work/p.lus
diff --git a/test/should_work/broken/packs.lus b/test/should_work/packs.lus
similarity index 100%
rename from test/should_work/broken/packs.lus
rename to test/should_work/packs.lus
diff --git a/test/should_work/broken/parametric_node2.lus b/test/should_work/parametric_node2.lus
similarity index 100%
rename from test/should_work/broken/parametric_node2.lus
rename to test/should_work/parametric_node2.lus
diff --git a/test/should_work/broken/ply01.lus b/test/should_work/ply01.lus
similarity index 100%
rename from test/should_work/broken/ply01.lus
rename to test/should_work/ply01.lus
diff --git a/test/should_work/broken/polymorphic_pack.lus b/test/should_work/polymorphic_pack.lus
similarity index 100%
rename from test/should_work/broken/polymorphic_pack.lus
rename to test/should_work/polymorphic_pack.lus
diff --git a/test/should_work/broken/simple.lus b/test/should_work/simple.lus
similarity index 100%
rename from test/should_work/broken/simple.lus
rename to test/should_work/simple.lus
diff --git a/test/should_work/broken/test_clash.lus b/test/should_work/test_clash.lus
similarity index 100%
rename from test/should_work/broken/test_clash.lus
rename to test/should_work/test_clash.lus
diff --git a/test/should_work/broken/toolate.lus b/test/should_work/toolate.lus
similarity index 100%
rename from test/should_work/broken/toolate.lus
rename to test/should_work/toolate.lus
diff --git a/bug/triSel.lus b/test/should_work/triSel.lus
similarity index 100%
rename from bug/triSel.lus
rename to test/should_work/triSel.lus
diff --git a/test/should_work/broken/type_decl.lus b/test/should_work/type_decl.lus
similarity index 100%
rename from test/should_work/broken/type_decl.lus
rename to test/should_work/type_decl.lus
diff --git a/test/site.exp b/test/site.exp
index d0e9b08a..f1002e2d 100644
--- a/test/site.exp
+++ b/test/site.exp
@@ -39,6 +39,7 @@ proc should_work { test_name command_line args } {
         }
         "segmentation fault" {
             set failed 1
+            fail "coucou"
             exp_continue
         }
         # to avoid that match_max (the expect buffer size) is reached 
diff --git a/todo.org b/todo.org
index 82112a0d..3dd759d6 100644
--- a/todo.org
+++ b/todo.org
@@ -2,10 +2,11 @@
 #+CATEGORY: lv6
 
 
-* Urgent
-
-
-** TODO Ya un probleme avec ce fichier lustre (compilait avant)
+* Regressions introduites par Pascal
+  
+** WAITING Ya un probleme avec ce fichier lustre (compilait avant)
+   - State "WAITING"    from "STARTED"    [2013-01-17 Thu 10:48]
+   - State "STARTED"    from "TODO"       [2013-01-17 Thu 10:48]
 file:test/should_work/call/call04.lus
 
 il semble y avoir une confusion entre parametre et arguments lors
@@ -15,14 +16,51 @@ idem pour
 file:test/should_work/fab_test/morel2.lus
 et pleins d'autres. hm, y'aurait pas d'itérateurs dans celui la.
 
-** TODO Ya un probleme avec ce fichier lustre (compilait avant)
-   - State "TODO"       from ""           [2013-01-07 Mon 16:20]
+-> ok :  c'était à c'était cause de l2lAliasType  qui faisait que les
+types lic n'étaient  plus uniques et du coups  les substitutions dans
+l'expansion des noeuds ne se faisaient plus correctement.
+
+je met en attente en attendant de savoir ce qu'on fait de ce module.
+moi j'ai bien envie de virer AbstractType de Lic.type_. En effet, j'avais 
+fais attention à tous les virer pour éviter les soucis, mais le plus 
+propre c'est d'y virer vraiment. 
+
+Pascal lui, s'en ait servir pour  faire des types alias, alors que ca
+n'est pas fait pour. Cela dit, si  on créé des types alias, on risque
+d'avoir le memegenre de soucis. A  quoi ca sert d'avoir de tels types
+?  pour moi le role de la compil ca serait plutot de les virer que de
+les rajouter, mais bon. A discuter. cf point d'apres
+
+** TODO Enlever Abstract_type_eff de Lic.type_ ou vérifier partout que c'est correct.
+   - State "TODO"       from ""           [2012-12-20 Thu 17:26]
+dans lic.ml, on definit les types compilés ainsi :
+and type_ =
+  | Bool_type_eff
+  | Int_type_eff
+  | Real_type_eff
+  | Abstract_type_eff of Ident.long * type_
+  | Array_type_eff    of type_ * int
+  ...
+
+Mais est-ce vraiment utile de garder le Abstract_type_eff à ce niveau ?
+
+en effet, ca oblige à traiter les 2 cas en permanence (par ex lors des
+transfo llic2lic).
+
+Pascal suggerer carrément de 
+- definir un type type_ref of string 
+- transformer les expressions lic de telle sorte que il n'y ait plus 
+  de type_ mais juste des type_ref
 
-../objlinux/lus2lic   should_work/lionel/triSel.lus   -en -ei -o /tmp/xxx.lus
+Car en fait, actuellement, le type Lic.type_ sert à faire la verif de
+type et  a representer le type  des expressions lic. Du  coup le type
+des expressions est inutilement  compliqué; d'ou l'idée d'avoir juste
+des "type_ref  of string" (Ce  qui simplifiera la travail  des passes
+ultérieures, style lic2c).
+
+Bon, je ferai ca quand tous les tests fonctionneront et pendant que
+j'essairais de me passer de ulglyStuff/id_solcer
 
-** TODO le -o ne fonctionne plus
-   SCHEDULED: <2013-01-07 Mon>
-   - State "TODO"       from ""           [2013-01-07 Mon 14:28]
 ** TODO Refaire marcher les tests de non-reg qui sont cassés 
    SCHEDULED: <2013-01-07 lun.>
 suites aux modifs de Pascal de l'été 2012
@@ -37,96 +75,90 @@ il a fait
  - cp _tests/Makefile tests
  - créer des tests qu'il a mis dans  tests...
 
-    
-* Pas dur
-** TODO Nommage des variables fraiches
-   - State "TODO"       from ""           [2012-12-20 Thu 17:38]
+** TODO Il ne detecte plus les erreurs d'instanciation de modeles
+   - State "TODO"       from ""           [2012-12-21 Fri 11:08]
+#+begin_src sh
+cd src; ../objlinux/lus2lic -vl 2 --nonreg-test should_fail/type/parametric_node2.lus
+#+end_src
 
-Pascal a introduit un mechanisme qui shunte LicName -> en discuter avec lui.
+file:test/should_fail/type/parametric_node2.lus
 
+** TODO internal error in l2lExpandArrays.ml with -esa
+   - State "TODO"       from ""           [2013-01-18 Fri 10:48]
+./lus2lic -esa -o /tmp/ply02.ec  should_work/broken/ply02.lus
 
-** TODO Mettre le sha dans l'affichage de --version 
-car c'est plus facile dans git pour retrouver ses petits
-  - State "TODO"       from ""           [2012-10-26 Fri 14:59]
+ oops: lus2lic internal error
+File "objlinux/l2lExpandArrays.ml", line 213, column 14
+ when compiling lustre program file:test/should_work/broken/ply02.lus
+
+nb : le mode -en ne marche pas bas bien non plus...
+
+./lus2lic -en -o /tmp/ply02.ec  should_work/broken/ply02.lus
+ Error in file "/home/jahier/lus2lic/test/should_work/broken/ply02.lus", line 8, col 2 to 2, token 'o': 
+ Variable o is already defined.
 
-** STARTED   Intégrer le résultat de mly2bnf dans le manuel 
 
 
-* Regressions introduites par Pascal
 
-** TODO pb dans la verif de définition unique de variable en mode -en
-   - State "TODO"       from ""           [2013-01-11 Fri 09:49]
+** TODO mauvais numero de ligne lors d'erreur d'instanciation de parametres de noeud
+   - State "TODO"       from ""           [2012-12-21 Fri 10:58]
+
+#+begin_src sh
+cd src; ../objlinux/lus2lic -vl 2 --nonreg-test should_fail/type/parametric_node.lus
+#+end_src
 
-file:~/lus2lic/testsuite/should_work/heater_control.lus::39
+   Opening file /home/jahier/lus2lic/test/should_fail/type/parametric_node.lus
+   Error in file "parametric_node.lus", line 4, col 17 to 17, token 'n':
+   can't eval type: bad array size, int expected but get real
 
-** TODO Regression dans le mode -ec
-   - State "TODO"       from ""           [2013-01-11 Fri 09:33]
+le message serait meilleur s'il indiquait la ligne 17 où l'erreur est effectuée
 
-undefined new var :
-file:testsuite/should_work/Gyroscope2.lus
-file:/home/jahier/lus2lic/testsuite/should_work/deSimone.lus::47
+file:src/astInstanciateModel.ml
+file:test/should_fail/type/parametric_node.lus
 
-var defined twice:
-file:/home/jahier/lus2lic/testsuite/should_work/heater_control.lus
 
+* Pas dur
 
-Peut-etre est-ce  lié au pb  précédent ? plus  précisement, peut-etre
-que le bug existait  mais qu'on ne le voyait pas  car tous les noeuds
-n'étaient pas générés ?
+** TODO Mettre le sha dans l'affichage de --version 
+car c'est plus facile dans git pour retrouver ses petits
+  - State "TODO"       from ""           [2012-10-26 Fri 14:59]
 
-Quoiqu'il en soit, c'est interessant de tester tous les noeuds ce que
-ne font pas mes scripts tcl en l'état.
+** STARTED   Intégrer le résultat de mly2bnf dans le manuel 
 
-** TODO Reprendre LicVarName.ml
+** TODO Nommage des variables fraiches : Reprendre LicVarName.ml
    - State "TODO"       from ""           [2013-01-16 Wed 18:03]
 car c'est completement n'importe quoi (j'ai réussit a faire des clashs
 entre les var inventés dans split et dans expandnodes !!)
 
+Pascal a introduit un mecanisme qui shunte LicName -> en discuter avec lui.
+
+
+* A faire
 ** TODO fix unresolved tests (timeout -> performance bugs)
    - State "TODO"       from ""           [2013-01-11 Fri 11:04]
 
-par ex, file:./test/should_work/ec.lus
-prend un temps infini alors qu'il n'est pas si gros.
+par ex,  file:./test/should_work/ec.lus prend  un temps  infini alors
+qu'il n'est pas si gros (y'a  500 variables, mais bon).  bon, en fait
+il prend 26 seconds, ce qui n'est  pas infini, mais bien long tout de
+meme.
 
+nb: c'était deja le cas avant les changements de Pascal.
 
-** TODO Il ne detecte plus les erreurs d'instanciation de modeles
-   - State "TODO"       from ""           [2012-12-21 Fri 11:08]
-#+begin_src sh
-cd src; ../objlinux/lus2lic -vl 2 --nonreg-test should_fail/type/parametric_node2.lus
-#+end_src
+cf file:test/lus2lic.gprof
+69% du temps est passé dans unify clock !!!!!
+ 
+J'ai l'impression que  c'est lié au fait que ce  programme ne definit
+que  des  contantes.   Or  les constantes  sont  potentiellement  sur
+n'importe quelle horloge, ce qui fait que l'algo manipule un gros paquet
+de 'clock_var of int' et que l'on passe beaucoup de temps à faire des 
+apply_substs2
 
+cf file:test/perf/ contenant les resultats de gprof et ocamlprof sur ec.lus
 
-file:test/should_fail/type/parametric_node2.lus
 
-** TODO mauvais numero de ligne lors d'erreur d'instanciation de parametres de noeud
-   - State "TODO"       from ""           [2012-12-21 Fri 10:58]
 
-#+begin_src sh
-cd src; ../objlinux/lus2lic -vl 2 --nonreg-test should_fail/type/parametric_node.lus
-#+end_src
-
-file:src/astInstanciateModel.ml
-file:test/should_fail/type/parametric_node.lus
-
-
-* A faire
-** TODO les (nouveaux) tests ne capture pas les changement de # lignes dans les should_fail
+** TODO les (nouveaux) tests ne capturent pas les changements de # lignes dans les should_fail
    - State "TODO"       from ""    [2013-01-11 Fri 11:15]
-** TODO Enlever Abstract_type_eff de Lic.type_ ou vérifier partout que c'est correct.
-   - State "TODO"       from ""           [2012-12-20 Thu 17:26]
-dans lic.ml, on definit les types compilés ainsi :
-and type_ =
-  | Bool_type_eff
-  | Int_type_eff
-  | Real_type_eff
-  | Abstract_type_eff of Ident.long * type_
-  | Array_type_eff    of type_ * int
-  ...
-
-Mais est-ce vraiment utile de garder le Abstract_type_eff à ce niveau ?
-
-en effet, ca oblige à traiter les 2 cas en permanence (par ex lors des
-transfo llic2lic).
 
 ** TODO Définir les fonctions de UglyStuff proprement
    - State "TODO"       from ""           [2012-12-10 Mon 16:38]
@@ -135,7 +167,7 @@ file:~/lus2lic/src/uglyStuff.ml
 
 
 
-** TODO  Rajouter le with à la caml pour les structures
+** TODO Rajouter le with à la caml pour les structures
   - State "TODO"       from ""           [2012-10-26 Fri 14:59]
 
 ** TODO Dans file:src/eff.ml::195 on pourrait virer la notion de call by name
@@ -148,15 +180,15 @@ du with ?
 comment fait caml ?
   - State "TODO"       from ""           [2012-10-26 Fri 14:59]
 
-** TODO  on devrait se passer de 'static_arg list' pour le champ =PREDEF_CALL= 
+** TODO on devrait se passer de 'static_arg list' pour le champ =PREDEF_CALL= 
 (c'est censé marcher)
 cf file:./src/eff.ml::206
   - State "TODO"       from ""           [2012-10-26 Fri 14:59]
 
-** TODO  L'ideal serait de se passer du PREDEF_CALL (et de passer par le  CALL normal)
+** TODO L'ideal serait de se passer du PREDEF_CALL (et de passer par le  CALL normal)
   - State "TODO"       from ""           [2012-10-26 Fri 14:59]
 
-** TODO  le Eff.WITH (aka if statique) n'a pas lieu d'être !
+** TODO le Eff.WITH (aka if statique) n'a pas lieu d'être !
 y virer !!
   - State "TODO"       from ""           [2012-10-26 Fri 14:59]
 
diff --git a/todo.org_archive b/todo.org_archive
index 3ee55759..571fe56d 100644
--- a/todo.org_archive
+++ b/todo.org_archive
@@ -93,6 +93,70 @@ file:test/should_work/test.lus
 file:~/lus2lic/src/l2lExpandNodes.ml::131
 
 
+* TODO Ya un probleme avec ce fichier lustre (compilait avant)
+   - State "TODO" from "" [2013-01-07 Mon 16:20]
+  :PROPERTIES:
+  :ARCHIVE_TIME: 2013-01-17 Thu 10:57
+  :ARCHIVE_FILE: ~/lus2lic/todo.org
+  :ARCHIVE_OLPATH: Urgent
+  :ARCHIVE_CATEGORY: lv6
+  :ARCHIVE_TODO: TODO
+  :END:
+
+../objlinux/lus2lic   should_work/lionel/triSel.lus   -en -ei -o /tmp/xxx.lus
+
+* TODO le -o ne fonctionne plus
+  SCHEDULED: <2013-01-07 Mon>
+  - State "TODO"       from ""           [2013-01-07 Mon 14:28]
+  :PROPERTIES:
+  :ARCHIVE_TIME: 2013-01-17 Thu 10:57
+  :ARCHIVE_FILE: ~/lus2lic/todo.org
+  :ARCHIVE_OLPATH: Urgent
+  :ARCHIVE_CATEGORY: lv6
+  :ARCHIVE_TODO: TODO
+  :END:
+
+* TODO pb dans la verif de définition unique de variable en mode -en
+   - State "TODO"       from ""           [2013-01-11 Fri 09:49]
+  :PROPERTIES:
+  :ARCHIVE_TIME: 2013-01-17 Thu 10:58
+  :ARCHIVE_FILE: ~/lus2lic/todo.org
+  :ARCHIVE_OLPATH: Regressions introduites par Pascal
+  :ARCHIVE_CATEGORY: lv6
+  :ARCHIVE_TODO: TODO
+  :END:
+
+file:~/lus2lic/testsuite/should_work/heater_control.lus::39
+
+* TODO Regression dans le mode -ec
+   - State "TODO"       from ""           [2013-01-11 Fri 09:33]
+  :PROPERTIES:
+  :ARCHIVE_TIME: 2013-01-17 Thu 10:59
+  :ARCHIVE_FILE: ~/lus2lic/todo.org
+  :ARCHIVE_OLPATH: Regressions introduites par Pascal
+  :ARCHIVE_CATEGORY: lv6
+  :ARCHIVE_TODO: TODO
+  :END:
+
+undefined new var :
+file:testsuite/should_work/Gyroscope2.lus
+file:/home/jahier/lus2lic/testsuite/should_work/deSimone.lus::47
+
+var defined twice:
+file:/home/jahier/lus2lic/testsuite/should_work/heater_control.lus
+
+Peut-etre est-ce  lié au pb  précédent ? plus  précisement, peut-etre
+que le bug existait  mais qu'on ne le voyait pas  car tous les noeuds
+n'étaient pas générés ?
+
+Quoiqu'il en soit, c'est interessant de tester tous les noeuds ce que
+ne font pas mes scripts tcl en l'état.
+
+
+
+
+
+
 
 
 
-- 
GitLab