diff --git a/src/main.ml b/src/main.ml
index f2bd0ecbcf34e7cd18539ad4d8c34a75c363d2f4..e54e4d27a61315cbf1a9bbf7ec091b03dbc03a2d 100644
--- a/src/main.ml
+++ b/src/main.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 26/05/2014 (at 15:27) by Erwan Jahier> *)
+(* Time-stamp: <modified the 02/06/2014 (at 10:50) by Erwan Jahier> *)
 
 open Verbose
 open AstV6
@@ -217,7 +217,7 @@ let main () = (
             info "Soc Compilation done.\n";
             if opt.gen_c then (
               info "Start generating C code...\n";
-              Soc2c.f opt zesoc lic_prg);
+              Soc2c.f opt msk zesoc lic_prg);
             if opt.exec then (
               info "Start interpreting soc...\n";
               SocExec.f opt zesoc msk)          
@@ -234,7 +234,7 @@ let main () = (
           info "Soc Compilation done. \n";
           if opt.gen_c then (
             info "Start generating C code...\n";
-            Soc2c.f opt zesoc lic_prg);
+            Soc2c.f opt msk zesoc lic_prg);
 
           if opt.exec then (
             info "Start interpreting soc...\n";
diff --git a/src/soc2c.ml b/src/soc2c.ml
index 0b8c23610ec9ee4218d85f3460a500669ba12994..2f7c835f7742d7553c33a446042a7c90d86108ff 100644
--- a/src/soc2c.ml
+++ b/src/soc2c.ml
@@ -1,24 +1,11 @@
-(* Time-stamp: <modified the 28/05/2014 (at 11:53) by Erwan Jahier> *)
+(* Time-stamp: <modified the 02/06/2014 (at 15:54) by Erwan Jahier> *)
 
 
 (* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *)
 (* 	Printf.kprintf (fun t -> output_string os t) fmt *)
 
 open Printf
-
-let colcol = Str.regexp "::"
-let id2s id = (* XXX Refuser les noms de module à la con plutot *)
-  let str =
-	 match Str.split colcol id with
-	   | [s] -> s
-	   | [m;s] -> if Lv6MainArgs.global_opt.Lv6MainArgs.no_prefix then s else m^"_"^s 
-	   | _ -> id
-  in
-  let str = Str.global_replace colcol "_" str in
-  let str = Str.global_replace (Str.regexp "-") "" str in
-  str
-
-let long2s l = id2s (Ident.string_of_long l)
+open Soc2cIdent
 
 let rec (type_to_string : Data.t -> string) = 
   fun v -> 
@@ -44,43 +31,12 @@ type 'a soc_pp = {
   soc: Soc.t
 }
 
-let rec (type_to_short_string : Data.t -> string) = 
-  fun v -> 
-    let str =
-      match v with
-        | Data.Bool -> "b"
-        | Data.Int -> "i"
-        | Data.Real-> "r"
-        | Data.Extern s -> s 
-        | Data.Enum  (s, sl) -> "i" (* s *) 
-        | Data.Struct (sid,_) -> sid
-        | Data.Array (ty, sz) -> Printf.sprintf "%sp%d" (type_to_short_string ty) sz 
-        | Data.Alpha nb ->
-        (* On génère des "types" à la Caml : 'a, 'b, 'c, etc. *)
-          let a_value = Char.code('a') in
-          let z_value = Char.code('z') in
-          let str =
-            if (nb >= 0 && nb <= (z_value - a_value)) then
-              ("'" ^ (Char.escaped (Char.chr(a_value + nb))))
-            else
-              ("'a" ^ (string_of_int nb))
-          in
-          str
-    in
-    str
-
-let (get_ctx_name : Soc.key -> string) =
-  fun (name,tl,_) -> 
-    let l = List.map type_to_short_string tl in
-    (id2s (Printf.sprintf "%s_%s_ctx" (id2s name) (String.concat "" l))) 
-
 let (step_name : Soc.key -> string -> string) =
   fun (soc_name,tl,_) sm -> 
     let l = List.map type_to_short_string tl in
     let str = sprintf "%s_%s_%s" (id2s soc_name)  (String.concat "" l) sm in
     id2s str
 
-
 let (string_of_soc_key : Soc.key -> string) =
   fun (name,_,_) ->  (id2s name)
 
@@ -99,12 +55,13 @@ let (is_memory_less : Soc.t -> bool) =
 let rec (string_of_var_expr: Soc.t -> Soc.var_expr -> string) = 
   fun soc -> function
     | Const(id, _) -> id2s id
-    | Var ("mem_pre",_)   -> (* XXX Clutch! correct? *) "ctx->mem_pre"
-    | Var (id,_)   -> if not (mem_interface soc id) then id2s id else 
-        if is_memory_less soc then
+    | Var ("mem_pre",_)   -> (* Clutch! it's not an interface var... *) "ctx->mem_pre" 
+    | Var (id,_)   -> 
+      if not (mem_interface soc id) then id2s id 
+      else if is_memory_less soc then
           sprintf "%s.%s" (get_ctx_name soc.key) (id2s id)
         else 
-          sprintf "ctx->%s" (id2s id)  (* XXX Clutch! correct? *)
+          sprintf "ctx->%s" (id2s id)
     | Field(f, id,_) -> sprintf "%s.%s" (string_of_var_expr soc f) (id2s id) 
     | Index(f, index,_) -> sprintf "%s[%i]" (string_of_var_expr soc f) index
     | Slice(f,fi,la,st,wi,vt) -> sprintf "%s[%i..%i step %i]; // XXX fixme!\n" 
@@ -200,12 +157,13 @@ let (step2c : Soc.tbl -> 'a soc_pp -> Soc.step_method -> unit) =
     sp.hfmt "void %s(%s);\n" sname ctx_decl;
     sp.cfmt "void %s(%s){\n" sname ctx;
     (match sm.impl with
-      | Predef -> sp.cput "   //xxx predef_finish_me!"
-      | Gaol(vl, gaol) -> 
+      | Predef ->        
+        sp.cput (SocPredef2c.get sp.soc.key)
+      | Gaol(vl, gaol) -> (
         List.iter (fun v -> sp.cput (string_of_flow_decl v)) vl ; 
-         sp.cput "\n"; 
+        sp.cput "\n"; 
         List.iter (gao2c stbl sp) gaol
-(*         of var list * gao list  (* local vars + body *) *)
+      )
       | Iterator(it,it_soc,s) -> assert false
       | Boolred(i,j,k) -> assert false
       | Condact(k,el) -> assert false
@@ -235,8 +193,7 @@ let (soc2c: int -> out_channel -> out_channel -> Soc.tbl -> Soc.t -> unit) =
     let il,ol = soc.profile in
     let sp = { hfmt = hfmt; cfmt=cfmt; hput = hput; cput = cput; soc = soc } in
     let ctx_name = get_ctx_name soc.key in
-    let ctx_name_type = ctx_name^"_type" in
-    
+    let ctx_name_type = ctx_name^"_type" in    
     if pass=1 then (
       hfmt "/* %s */\ntypedef struct {\n   /*INPUTS*/\n" ctx_name;
       List.iter (fun v -> hput (string_of_flow_decl v)) il ;
@@ -257,6 +214,18 @@ let (soc2c: int -> out_channel -> out_channel -> Soc.tbl -> Soc.t -> unit) =
     (* Only for ctx of memoryless nodes + main node *)
        if is_memory_less soc then cfmt "%s %s;\n" ctx_name_type ctx_name;
     ) else (
+      cfmt "// Memory allocation for %s\n" ctx_name;
+      hfmt "%s_type* %s_new_ctx();\n" ctx_name ctx_name;
+      cfmt "%s_type* %s_new_ctx(){" ctx_name ctx_name;
+      cfmt "
+   %s_type* ctx = (%s_type*)calloc(1, sizeof(%s_type));
+   // ctx->client_data = cdata;
+   // %s_reset(ctx);
+   return ctx;
+}
+" ctx_name ctx_name ctx_name ctx_name ;
+        
+
       cfmt "// Step function(s) for %s\n" ctx_name;
       List.iter (step2c stbl sp) soc.step;
       ()
@@ -328,25 +297,174 @@ let (constdef : LicPrg.t -> string) =
     in
     LicPrg.fold_consts (fun k t acc -> acc ^ (to_c k t)) licprg  "\n// Constant definitions \n"
 
+(****************************************************************************)
+
+let (gen_loop_file : Soc.t -> unit) =
+  fun soc -> 
+    let loopfile = "loop.c" in
+    let oc = open_out loopfile in
+    let putc s =  output_string oc s in
+    let ctx = get_ctx_name soc.key in
+    let step = get_step_name soc.key in
+    let (n,_,_) = soc.key in
+    let n = id2s n in
+    Lv6util.entete oc "/*" "*/";
+    putc  ("
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include \"hfile.h\"
+// #include \""^n^".h\"
+/* Print a promt ? ************************/
+static int ISATTY;
+/* MACROS DEFINITIONS ****************/
+#ifndef TT
+#define TT \"true\"
+#endif
+#ifndef FF
+#define FF \"false\"
+#endif
+#ifndef BB
+#define BB \"bottom\"
+#endif
+#ifdef CKCHECK
+/* set this macro for testing output clocks */
+#endif
+
+/* Standard Input procedures **************/
+_boolean _get_bool(char* n){
+   char b[512];
+   _boolean r = 0;
+   int s = 1;
+   char c;
+   do {
+      if(ISATTY) {
+         if((s != 1)||(r == -1)) printf(\"\a\");
+         printf(\"%s (1,t,T/0,f,F) ? \", n);
+      }
+      if(scanf(\"%s\", b)==EOF) exit(0);
+      if (*b == 'q') exit(0);
+      s = sscanf(b, \"%c\", &c);
+      r = -1;
+      if((c == '0') || (c == 'f') || (c == 'F')) r = 0;
+      if((c == '1') || (c == 't') || (c == 'T')) r = 1;
+   } while((s != 1) || (r == -1));
+   return r;
+}
+_integer _get_int(char* n){
+   char b[512];
+   _integer r;
+   int s = 1;
+   do {
+      if(ISATTY) {
+         if(s != 1) printf(\"\a\");
+         printf(\"%s (integer) ? \", n);
+      }
+      if(scanf(\"%s\", b)==EOF) exit(0);
+      if (*b == 'q') exit(0);
+      s = sscanf(b, \"%d\", &r);
+   } while(s != 1);
+   return r;
+}
+#define REALFORMAT ((sizeof(_real)==8)?\"%lf\":\"%f\")
+_real _get_real(char* n){
+   char b[512];
+   _real r;
+   int s = 1;
+   do {
+      if(ISATTY) {
+         if(s != 1) printf(\"\a\");
+         printf(\"%s (real) ? \", n);
+      }
+      if(scanf(\"%s\", b)==EOF) exit(0);
+      if (*b == 'q') exit(0);
+      s = sscanf(b, REALFORMAT, &r);
+   } while(s != 1);
+   return r;
+}
+/* Standard Output procedures **************/
+void _put_bottom(char* n){
+   if(ISATTY) printf(\"%s = \", n);
+   printf(\"%s \", BB);
+   if(ISATTY) printf(\"\\n\");
+}
+void _put_bool(char* n, _boolean _V){
+   if(ISATTY) printf(\"%s = \", n);
+   printf(\"%s \", (_V)? TT : FF);
+   if(ISATTY) printf(\"\\n\");
+}
+void _put_int(char* n, _integer _V){
+   if(ISATTY) printf(\"%s = \", n);
+   printf(\"%d \", _V);
+   if(ISATTY) printf(\"\\n\");
+}
+void _put_real(char* n, _real _V){
+   if(ISATTY) printf(\"%s = \", n);
+   printf(\"%f \", _V);
+   if(ISATTY) printf(\"\\n\");
+}
+/* Output procedures **********************/
+#ifdef CKCHECK
+void %s_BOT_n(void* cdata){
+   _put_bottom(\"n\");
+}
+#endif
+/* Output procedures **********************/
+void "^n^"_O_n(void* cdata, _integer _V) {
+   _put_int(\"n\", _V);
+}/* Main procedure *************************/
+int main(){
+   
+   int s = 0;
+   /* Context allocation */
+   "^ctx^"_type* ctx = "^ctx^"_new_ctx(NULL);
+   // "^ctx^"_reset(ctx);
+   /* Main loop */
+   ISATTY = isatty(0);
+   first_step=_true;
+   while(1){
+      if (ISATTY) printf(\"#step %d \\n\", s+1);
+      else if(s) printf(\"\\n\");
+      fflush(stdout);
+      ++s;
+");
+    List.iter (fun (id,t) -> 
+      let t = Data.type_to_string t in
+      let str = Printf.sprintf "      ctx->%s = _get_%s(\"%s\");\n" id t id in
+      putc str
+    )
+      (fst soc.profile);
+    putc ("      " ^ step^"(ctx);
+       first_step=_false;
+   }
+   return 1;
+   
+}
+") ;
+    flush oc; close_out oc
+    
+
 (****************************************************************************)
 (* The entry point for lus2lic --to-c *)
-let (f : Lv6MainArgs.t -> Soc.tbl -> LicPrg.t -> unit) =
-  fun args stbl licprg -> 
+let (f : Lv6MainArgs.t -> Soc.key -> Soc.tbl -> LicPrg.t -> unit) =
+  fun args msoc stbl licprg -> 
     let socs = Soc.SocMap.bindings stbl in
     let socs = snd (List.split socs) in 
-(* XXX que fait-on pour les soc predef ? *)
-(*     let _, socs = List.partition is_predef socs in *)
+        (* XXX que fait-on pour les soc predef ? *)
+        (*     let _, socs = List.partition is_predef socs in *)
     let hfile = "hfile.h" in
     let cfile = "cfile.c" in
     let occ = open_out cfile in
     let och = open_out hfile in
-    let putc s =  output_string occ s in
-    let puth s =  output_string och s in
+    let putc s =  output_string occ s ; flush occ in
+    let puth s =  output_string och s ; flush och  in
 
     Lv6util.entete occ "/*" "*/" ;
     Lv6util.entete och "/*" "*/";
-    (* clutch  *)
-    output_string occ "
+
+    gen_loop_file (Soc.SocMap.find msoc stbl);
+    
+    output_string och "
 #include <stdlib.h>
 #include <string.h>
 
@@ -371,12 +489,10 @@ typedef float _float;
     putc "/////////////////////////////////////////////////\n";
     putc "// Allocating memoryless ctx\n";
     List.iter (soc2c 1 och occ stbl) socs;
-    putc "/////////////////////////////////////////////////\n";
+    puth "/////////////////////////////////////////////////\n";
+    puth "_boolean first_step;\n";
     putc "// Defining step functions\n";
     List.iter (soc2c 2 och occ stbl) socs;
-    putc "/////////////////////////////////////////////////\n";
-    putc "// main : XXX TODO! (ctx allocation + main function)\n";
-    putc "void main(void) {}";
     flush occ; close_out occ;
     flush och; close_out och;
     Printf.printf "%s and %s have been generated.\n" hfile cfile
diff --git a/src/soc2c.mli b/src/soc2c.mli
index 0d6ca215ac5fdaaee64bd34192d596bb61478cd2..238c2958c73b0c3dfea1965ba6d7c396a27f8eba 100644
--- a/src/soc2c.mli
+++ b/src/soc2c.mli
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 26/05/2014 (at 15:13) by Erwan Jahier> *)
+(* Time-stamp: <modified the 02/06/2014 (at 14:28) by Erwan Jahier> *)
 
 (* The entry point for lus2lic -toC *)
-val f : Lv6MainArgs.t -> Soc.tbl -> LicPrg.t -> unit
+val f : Lv6MainArgs.t -> Soc.key -> Soc.tbl -> LicPrg.t -> unit
diff --git a/src/soc2cIdent.ml b/src/soc2cIdent.ml
new file mode 100644
index 0000000000000000000000000000000000000000..e2c938c9a821871aa1e16e92f51edd7d73a553ca
--- /dev/null
+++ b/src/soc2cIdent.ml
@@ -0,0 +1,51 @@
+(* Time-stamp: <modified the 02/06/2014 (at 14:55) by Erwan Jahier> *)
+
+let colcol = Str.regexp "::"
+let id2s id = (* XXX Refuser les noms de module à la con plutot *)
+  let str =
+	 match Str.split colcol id with
+	   | [s] -> s
+	   | [m;s] -> if Lv6MainArgs.global_opt.Lv6MainArgs.no_prefix then s else m^"_"^s 
+	   | _ -> id
+  in
+  let str = Str.global_replace colcol "_" str in
+  let str = Str.global_replace (Str.regexp "-") "" str in
+  str
+
+let long2s l = id2s (Ident.string_of_long l)
+
+let rec (type_to_short_string : Data.t -> string) = 
+  fun v -> 
+    let str =
+      match v with
+        | Data.Bool -> "b"
+        | Data.Int -> "i"
+        | Data.Real-> "r"
+        | Data.Extern s -> s 
+        | Data.Enum  (s, sl) -> "i" (* s *) 
+        | Data.Struct (sid,_) -> sid
+        | Data.Array (ty, sz) -> Printf.sprintf "%sp%d" (type_to_short_string ty) sz 
+        | Data.Alpha nb ->
+        (* On génère des "types" à la Caml : 'a, 'b, 'c, etc. *)
+          let a_value = Char.code('a') in
+          let z_value = Char.code('z') in
+          let str =
+            if (nb >= 0 && nb <= (z_value - a_value)) then
+              ("'" ^ (Char.escaped (Char.chr(a_value + nb))))
+            else
+              ("'a" ^ (string_of_int nb))
+          in
+          str
+    in
+    str
+
+let (get_base_name : Soc.key -> string) =
+  fun (name,tl,_) -> 
+    let l = List.map type_to_short_string tl in
+    (id2s (Printf.sprintf "%s_%s" (id2s name) (String.concat "" l))) 
+
+let (get_ctx_name : Soc.key -> string) =
+  fun sk -> (get_base_name sk) ^ "_ctx"
+
+let (get_step_name : Soc.key -> string) =
+  fun sk -> (get_base_name sk) ^ "_step"
diff --git a/src/socPredef.ml b/src/socPredef.ml
index 279d28806753a142ea91f03f4d5db6a31b33aa28..b4f3a921983560d1dfc802b00838352cc244efbf 100644
--- a/src/socPredef.ml
+++ b/src/socPredef.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 16/05/2014 (at 14:50) by Erwan Jahier> *)
+(* Time-stamp: <modified the 02/06/2014 (at 09:32) by Erwan Jahier> *)
 
 (** Synchronous Object Code for Predefined operators. *)
 
@@ -195,7 +195,7 @@ let of_soc_key : Soc.key -> Soc.t =
               idx_ins  = [];
               idx_outs = [0];
 (*               impl    = Predef; *)
-               impl    = Gaol([pre_mem],[Call([Var(vout)], Assign, [Var(pre_mem)])]); 
+               impl    = Gaol([],[Call([Var(vout)], Assign, [Var(pre_mem)])]); 
 (*               impl    = Gaol([pre_mem],[Call([Var(vout)], Assign, [Var(pre_mem)])]); *)
             };
             {
@@ -204,7 +204,7 @@ let of_soc_key : Soc.key -> Soc.t =
               idx_ins  = [0];
               idx_outs = [];
 (*               impl    = Predef; *)
-               impl    = Gaol([pre_mem],[Call([Var(pre_mem)], Assign, [Var(v1)])]); 
+               impl    = Gaol([],[Call([Var(pre_mem)], Assign, [Var(v1)])]); 
 (*               impl    = Gaol([pre_mem],[Call([Var(pre_mem)], Assign, [Var(v1)])]); *)
             };
           ];
@@ -369,9 +369,6 @@ let make_array_slice_soc : Lic.slice_info -> int -> Data.t -> Soc.t =
 
 
 
-
-
-
 let (make_merge_soc: Soc.key -> Soc.t) = 
   fun sk -> 
     let (id, tl, _) = sk in
diff --git a/src/socPredef2c.ml b/src/socPredef2c.ml
new file mode 100644
index 0000000000000000000000000000000000000000..9ba30d800e34187bfee3d7e00280cf030ad141ea
--- /dev/null
+++ b/src/socPredef2c.ml
@@ -0,0 +1,127 @@
+(* Time-stamp: <modified the 02/06/2014 (at 09:39) by Erwan Jahier> *)
+
+open Data
+open Soc
+open Soc2cIdent
+
+(* A boring but simple module... *)
+
+let (lustre_binop : Soc.key -> string -> string) =
+  fun sk op  -> 
+    let ctx = get_ctx_name sk in
+    Printf.sprintf "  %s.z = (%s.x %s %s.y);\n" ctx ctx op ctx
+
+let (lustre_unop : Soc.key -> string -> string) =
+  fun sk op  -> 
+    let ctx = get_ctx_name sk in
+    Printf.sprintf"  %s.z = %s %s.x;\n" ctx op ctx
+
+let (lustre_ite : Soc.key -> string) =
+  fun sk -> 
+    let ctx = get_ctx_name sk in
+    Printf.sprintf"  %s.z = (%s.c)? %s.xt : %s.xe;\n" ctx ctx ctx ctx
+
+let (lustre_impl : Soc.key -> string) =
+  fun sk -> 
+    let ctx = get_ctx_name sk in
+    Printf.sprintf"  %s.z = (!%s.x || %s.y);\n" ctx ctx ctx
+
+let (lustre_arrow : Soc.key -> string) =
+  fun sk -> 
+    let ctx = get_ctx_name sk in
+    let x,y,z = ctx^".x", ctx^".y", ctx^".z" in
+    Printf.sprintf"  %s = (first_step)? %s : %s;\n" z x y
+
+let (lustre_merge : Soc.key -> string) =
+  fun sk -> 
+    let ctx = get_ctx_name sk in
+    let (_,tc::tl,_) = sk in
+    match tc with
+      | Bool ->
+        Printf.sprintf"  %s.z = (%s.clk) ? %s.x1 : %s.x2  ;\n" ctx ctx ctx ctx
+      | Enum(en,el) ->
+        let case_list = List.mapi
+          (fun i e -> Printf.sprintf "    case %s: %s.x%i; break;\n" (id2s e) ctx i) el  
+        in
+        let cases = String.concat "" case_list in
+        Printf.sprintf"  %s.z =\n    switch (%s.clk){\n%s}\n" ctx ctx cases
+      | Int ->
+        let case_list = List.mapi
+          (fun i e -> Printf.sprintf "    case %i: %s.z = %s.x%i; break;\n" i ctx ctx i) tl  
+        in
+        let cases = String.concat "" case_list in
+        Printf.sprintf"  switch (%s.clk){\n%s}\n" ctx cases
+      | _ -> assert false
+
+(* exported *)
+let (get: Soc.key -> string) =
+  fun sk -> 
+    let (n,tl,si_opt) = sk in
+    match n with
+      | "Lustre::rplus" 
+      | "Lustre::plus"
+      | "Lustre::iplus"  -> lustre_binop sk "+" 
+      | "Lustre::itimes" 
+      | "Lustre::times"
+      | "Lustre::rtimes" -> lustre_binop sk "*" 
+      | "Lustre::idiv"
+      | "Lustre::div"  
+      | "Lustre::rdiv"   -> lustre_binop sk "/" 
+      | "Lustre::islash" 
+      | "Lustre::slash" 
+      | "Lustre::rslash" -> lustre_binop sk "/"
+      | "Lustre::iminus"
+      | "Lustre::minus"
+      | "Lustre::rminus" -> lustre_binop sk "-" 
+
+      | "Lustre::mod" -> lustre_binop sk "%"
+      | "Lustre::iuminus"
+      | "Lustre::uminus" 
+      | "Lustre::ruminus"-> lustre_unop sk "-" 
+
+      | "Lustre::eq" -> lustre_binop sk "==" 
+
+      | "Lustre::and" -> lustre_binop sk "&&" 
+      | "Lustre::neq" -> lustre_binop sk "<>"  
+      | "Lustre::or"  -> lustre_binop sk "||"  
+
+      | "Lustre::xor" -> lustre_binop sk "^" 
+      | "Lustre::not" -> lustre_unop  sk "!"
+      | "Lustre::real2int" -> lustre_unop sk "(_integer)"
+      | "Lustre::int2real" -> lustre_unop sk "(_real)"
+
+      | "Lustre::lt"
+      | "Lustre::rlt"
+      | "Lustre::ilt" -> lustre_binop sk "<"
+      | "Lustre::gt"
+      | "Lustre::rgt"
+      | "Lustre::igt" -> lustre_binop sk ">"
+      | "Lustre::lte" 
+      | "Lustre::rlte"
+      | "Lustre::ilte" -> lustre_binop sk "<="
+      | "Lustre::gte"
+      | "Lustre::rgte"
+      | "Lustre::igte" -> lustre_binop sk ">="
+      | "Lustre::impl" -> lustre_impl sk
+
+      | "Lustre::if"
+      | "Lustre::rif"
+      | "Lustre::iif" -> lustre_ite sk
+
+      | "Lustre::arrow" -> lustre_arrow sk
+      | "Lustre::merge" -> lustre_merge sk
+
+      (*
+        | "Lustre::hat" -> lustre_hat tl
+        | "Lustre::array" -> lustre_array tl
+        | "Lustre::concat" -> lustre_concat
+
+
+        | "Lustre::array_slice" -> lustre_slice tl si_opt
+      *)
+      | "Lustre::current" -> assert false (* o*)
+      | "Lustre::nor" -> assert false (* ougth to be translated into boolred *)
+      | "Lustre::diese" -> assert false (* ditto *)
+
+      | _ -> raise Not_found
+
diff --git a/test/lus2lic.log.ref b/test/lus2lic.log.ref
index 67366a051b010d0b2a4822d490fa93aac89e7e6e..66d36d8e9da7eb9ba6064014707329911db60ba7 100644
--- a/test/lus2lic.log.ref
+++ b/test/lus2lic.log.ref
@@ -1,4 +1,4 @@
-Test Run By jahier on Wed May 21 16:17:37 2014
+Test Run By jahier on Mon Jun  2 16:02:49 2014
 Native configuration is i686-pc-linux-gnu
 
 		=== lus2lic tests ===
@@ -42,8 +42,7 @@ break signal catched
 lurettetop: bye!
 + echo lurettetop ok
 lurettetop ok
-+ exit 0
-PASS: ../utils/test_lus2lic_no_node should_work/nc6.lus
++ exit 0PASS: ../utils/test_lus2lic_no_node should_work/nc6.lus
 spawn ./lus2lic -o /tmp/argos.lic should_work/argos.lus
 PASS: ./lus2lic {-o /tmp/argos.lic should_work/argos.lus}
 spawn ./lus2lic -ec -o /tmp/argos.ec should_work/argos.lus
@@ -208,7 +207,7 @@ spawn ../utils/test_lus2lic_no_node should_work/ck6.lus
 Extern node not yet supported, sorry
 
 *** oops: lus2lic internal error
-	File "src/lic2soc.ml", line 897, column 14
+	File "src/lic2soc.ml", line 898, column 14
 *** when compiling lustre program should_work/ck6.lus
 
 *** You migth want to sent a bug report to jahier@imag.fr
@@ -728,7 +727,7 @@ spawn ../utils/test_lus2lic_no_node should_work/call06.lus
 Extern node not yet supported, sorry
 
 *** oops: lus2lic internal error
-	File "src/lic2soc.ml", line 897, column 14
+	File "src/lic2soc.ml", line 898, column 14
 *** when compiling lustre program should_work/call06.lus
 
 *** You migth want to sent a bug report to jahier@imag.fr
@@ -1172,7 +1171,7 @@ spawn ../utils/test_lus2lic_no_node should_work/minmax5.lus
 Extern node not yet supported, sorry
 
 *** oops: lus2lic internal error
-	File "src/lic2soc.ml", line 897, column 14
+	File "src/lic2soc.ml", line 898, column 14
 *** when compiling lustre program should_work/minmax5.lus
 
 *** You migth want to sent a bug report to jahier@imag.fr
@@ -1556,7 +1555,7 @@ spawn ../utils/test_lus2lic_no_node should_work/minmax5_random.lus
 Extern node not yet supported, sorry
 
 *** oops: lus2lic internal error
-	File "src/lic2soc.ml", line 897, column 14
+	File "src/lic2soc.ml", line 898, column 14
 *** when compiling lustre program should_work/minmax5_random.lus
 
 *** You migth want to sent a bug report to jahier@imag.fr
@@ -2457,7 +2456,6 @@ break signal catched
 lurettetop: bye!
 + echo lurettetop ok
 lurettetop ok
-+ exit 0
 PASS: ../utils/test_lus2lic_no_node should_work/trivial.lus
 spawn ./lus2lic -o /tmp/packs.lic should_work/packs.lus
 PASS: ./lus2lic {-o /tmp/packs.lic should_work/packs.lus}
@@ -3540,6 +3538,7 @@ break signal catched
 lurettetop: bye!
 + echo lurettetop ok
 lurettetop ok
++ exit 0
 PASS: ../utils/test_lus2lic_no_node should_work/mouse1.lus
 spawn ./lus2lic -o /tmp/lustre_test1_ok.lic should_work/lustre_test1_ok.lus
 PASS: ./lus2lic {-o /tmp/lustre_test1_ok.lic should_work/lustre_test1_ok.lus}
@@ -4080,6 +4079,8 @@ break signal catched
 
 lurettetop: bye!
 + echo lurettetop ok
+lurettetop ok
++ exit 0
 PASS: ../utils/test_lus2lic_no_node should_work/morel.lus
 spawn ./lus2lic -o /tmp/SOURIS.lic should_work/SOURIS.lus
 PASS: ./lus2lic {-o /tmp/SOURIS.lic should_work/SOURIS.lus}
@@ -4530,7 +4531,7 @@ spawn ../utils/test_lus2lic_no_node should_work/import1.lus
 Extern node not yet supported, sorry
 
 *** oops: lus2lic internal error
-	File "src/lic2soc.ml", line 897, column 14
+	File "src/lic2soc.ml", line 898, column 14
 *** when compiling lustre program should_work/import1.lus
 
 *** You migth want to sent a bug report to jahier@imag.fr
@@ -5344,7 +5345,7 @@ spawn ../utils/test_lus2lic_no_node should_work/asservi.lus
 Extern node not yet supported, sorry
 
 *** oops: lus2lic internal error
-	File "src/lic2soc.ml", line 897, column 14
+	File "src/lic2soc.ml", line 898, column 14
 *** when compiling lustre program should_work/asservi.lus
 
 *** You migth want to sent a bug report to jahier@imag.fr
@@ -5460,7 +5461,8 @@ break signal catched
 lurettetop: bye!
 + echo lurettetop ok
 lurettetop ok
-+ exitPASS: ../utils/test_lus2lic_no_node should_work/dependeur_struct.lus
++ exit 0
+PASS: ../utils/test_lus2lic_no_node should_work/dependeur_struct.lus
 spawn ./lus2lic -o /tmp/minmax4_bis.lic should_work/minmax4_bis.lus
 PASS: ./lus2lic {-o /tmp/minmax4_bis.lic should_work/minmax4_bis.lus}
 spawn ./lus2lic -ec -o /tmp/minmax4_bis.ec should_work/minmax4_bis.lus
@@ -6578,6 +6580,14 @@ lurettetop: bye!
 lurettetop ok
 + exit 0
 PASS: ../utils/test_lus2lic_no_node should_work/call03.lus
+spawn ./lus2lic -o /tmp/modes3x2-simu.lic should_work/modes3x2-simu.lus
+PASS: ./lus2lic {-o /tmp/modes3x2-simu.lic should_work/modes3x2-simu.lus}
+spawn ./lus2lic -ec -o /tmp/modes3x2-simu.ec should_work/modes3x2-simu.lus
+PASS: ./lus2lic {-ec -o /tmp/modes3x2-simu.ec should_work/modes3x2-simu.lus}
+spawn ./myec2c -o /tmp/modes3x2-simu.c /tmp/modes3x2-simu.ec
+syntax error     - at line 10
+syntax errors...
+FAIL: Try ec2c on the result: ./myec2c {-o /tmp/modes3x2-simu.c /tmp/modes3x2-simu.ec}
 spawn ./lus2lic -o /tmp/count.lic should_work/count.lus
 PASS: ./lus2lic {-o /tmp/count.lic should_work/count.lus}
 spawn ./lus2lic -ec -o /tmp/count.ec should_work/count.lus
@@ -6783,7 +6793,7 @@ spawn ../utils/test_lus2lic_no_node should_work/decl.lus
 Extern node not yet supported, sorry
 
 *** oops: lus2lic internal error
-	File "src/lic2soc.ml", line 897, column 14
+	File "src/lic2soc.ml", line 898, column 14
 *** when compiling lustre program should_work/decl.lus
 
 *** You migth want to sent a bug report to jahier@imag.fr
@@ -7708,7 +7718,7 @@ lurettetop: bye!
 error
 + exit 2
 XPASS: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/eq1.lus
-testcase ./lus2lic.tests/non-reg.exp completed in 129 seconds
+testcase ./lus2lic.tests/non-reg.exp completed in 172 seconds
 Running ./lus2lic.tests/progression.exp ...
 spawn ./lus2lic -o /tmp/when_not.out should_work/broken/when_not.lus
 PASS: ./lus2lic {    -o /tmp/when_not.out should_work/broken/when_not.lus}
@@ -7745,12 +7755,12 @@ spawn ./lus2lic -o /tmp/activation1.lic should_fail/semantics/broken/activation1
 XPASS: Test bad programs (semantics): lus2lic {-o /tmp/activation1.lic should_fail/semantics/broken/activation1.lus}
 spawn ./lus2lic -o /tmp/bug.lic should_fail/semantics/broken/bug.lus
 XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/semantics/broken/bug.lus}
-testcase ./lus2lic.tests/progression.exp completed in 0 seconds
+testcase ./lus2lic.tests/progression.exp completed in 1 seconds
 
 		=== lus2lic Summary ===
 
-# of expected passes		885
-# of unexpected failures	76
+# of expected passes		887
+# of unexpected failures	77
 # of unexpected successes	21
 # of expected failures		37
-runtest completed at Wed May 21 16:19:46 2014
+runtest completed at Mon Jun  2 16:05:42 2014
diff --git a/test/lus2lic.sum b/test/lus2lic.sum
index dae77e641936faea5c756da027c50f656bfcf4d7..7fe4d02e0d7fbca894053e10d3e0c36a5bccc115 100644
--- a/test/lus2lic.sum
+++ b/test/lus2lic.sum
@@ -1,4 +1,4 @@
-Test Run By jahier on Wed May 28 15:24:38 2014
+Test Run By jahier on Mon Jun  2 16:02:49 2014
 Native configuration is i686-pc-linux-gnu
 
 		=== lus2lic tests ===
@@ -1038,5 +1038,7 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman
 # of unexpected failures	77
 # of unexpected successes	21
 # of expected failures		37
-testcase ./lus2lic.tests/non-reg.exp completed in 139 seconds
+testcase ./lus2lic.tests/non-reg.exp completed in 172 seconds
+testcase ./lus2lic.tests/progression.exp completed in 1 seconds
+testcase ./lus2lic.tests/non-reg.exp completed in 172 seconds
 testcase ./lus2lic.tests/progression.exp completed in 1 seconds
diff --git a/test/lus2lic.time b/test/lus2lic.time
index 07c734aa0fe0c40183c624c2b8734376df02901a..c24fdd2507080187c09f6bd23e864272c53b7de1 100644
--- a/test/lus2lic.time
+++ b/test/lus2lic.time
@@ -1,2 +1,2 @@
-testcase ./lus2lic.tests/non-reg.exp completed in 139 seconds
+testcase ./lus2lic.tests/non-reg.exp completed in 172 seconds
 testcase ./lus2lic.tests/progression.exp completed in 1 seconds