From 20b0af1c6ffbb3a8db0e77eaca539a53a694fd66 Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Mon, 11 Mar 2013 09:24:32 +0100
Subject: [PATCH] Program Identifiers renaming pass in Soc.

---
 src/lic2soc.ml      |  54 ++++-----
 src/soc.ml          |  63 +++--------
 src/socExecValue.ml |   4 +-
 src/socPredef.ml    | 262 ++++++++++++++++++++++----------------------
 src/socUtils.ml     |  51 +++------
 src/socUtils.mli    |   4 +-
 6 files changed, 193 insertions(+), 245 deletions(-)

diff --git a/src/lic2soc.ml b/src/lic2soc.ml
index 4c7de092..b1611586 100644
--- a/src/lic2soc.ml
+++ b/src/lic2soc.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 07/03/2013 (at 18:15) by Erwan Jahier> *)
+(** Time-stamp: <modified the 11/03/2013 (at 09:19) by Erwan Jahier> *)
  
 open Lxm
 open Lic
@@ -230,11 +230,11 @@ let build_meth: Lxm.t -> string -> Lic.node_exp -> Soc.var list ->
       fst (List.fold_left (fun (a, i) _ -> a @ [i], i+1) ([], 0) l)
     in
       {
-        Soc.socm_name    = name;
-        Soc.socm_lxm     = lxm;
-        Soc.socm_inputs  = convert_node_interface node.Lic.inlist_eff;
-        Soc.socm_outputs = convert_node_interface node.Lic.outlist_eff; 
-        Soc.socm_impl    = 
+        Soc.name    = name;
+        Soc.lxm     = lxm;
+        Soc.idx_ins  = convert_node_interface node.Lic.inlist_eff;
+        Soc.idx_outs = convert_node_interface node.Lic.outlist_eff; 
+        Soc.impl    = 
           Some (locals, List.map gao_of_action actions)
       }
 
@@ -327,7 +327,7 @@ type memory = Soc.instance * action list (* m
 let soc_meth_to_operation: 
     Soc.t -> string -> memory option -> Soc.atomic_operation =
   fun comp func_name -> function
-    | None -> Soc.Procedure comp.Soc.socc_key 
+    | None -> Soc.Procedure comp.Soc.key 
     | Some (i,_) -> Soc.Method(i)
 
 (* Créé une action concernant un appel de procédure ou de méthode. *)
@@ -343,9 +343,9 @@ let (action_of_method: Lxm.t -> Soc.t -> Lic.clock -> Soc.var_expr list ->
         flush stdout;
         assert false 
     in
-    let inputs  = List.map (fun i -> nth i il) m.Soc.socm_inputs  in
-    let outputs = List.map (fun i -> nth i ol) m.Soc.socm_outputs in
-    let call_action = soc_meth_to_operation c m.Soc.socm_name mem in
+    let inputs  = List.map (fun i -> nth i il) m.Soc.idx_ins  in
+    let outputs = List.map (fun i -> nth i ol) m.Soc.idx_outs in
+    let call_action = soc_meth_to_operation c m.Soc.name mem in
       (clk, inputs, outputs, call_action, lxm)
 
 (** Créé un nouveau nom pour une instance. *)
@@ -366,16 +366,16 @@ let create_new_instance_name: (ctx -> ctx * string) = fun ctx ->
 let create_instance_from_soc: (ctx -> Soc.t -> ctx * Soc.instance) = 
   fun ctx c ->
     let ctx, mem_name = create_new_instance_name ctx in
-      ctx, (mem_name, c.Soc.socc_key)
+      ctx, (mem_name, c.Soc.key)
 
 let (make_memory : Lxm.t -> Lic.clock -> ctx -> Soc.t -> 
      Soc.var_expr list -> Soc.var_expr list -> ctx * memory option) =
   fun lxm clk ctx soc inputs lpl -> 
-    match soc.Soc.socc_memories with
+    match soc.Soc.instances with
       | [] -> ctx, None
       | _  ->
         let ctx, m = create_instance_from_soc ctx soc in
-        let init_actions = match soc.Soc.socc_init with
+        let init_actions = match soc.Soc.init with
           | Some i -> [action_of_method lxm soc clk inputs lpl (Some (m, [])) i]
           | None -> assert false 
         in
@@ -521,7 +521,7 @@ let rec (actions_of_expression_acc: Lxm.t -> Soc.tbl ->
                 in
                 (* Use that soc to build the corresponding
                    - actions
-                   - memories
+                   - instances
                    - action dependances
                 *)
                 let inputs : Soc.var_expr list =
@@ -529,14 +529,14 @@ let rec (actions_of_expression_acc: Lxm.t -> Soc.tbl ->
                 let ctx, mem_opt = make_memory lxm clk ctx soc inputs lpl in
                 let actions =
                   let m2act = action_of_method lxm soc clk inputs lpl mem_opt in
-                  List.map m2act soc.Soc.socc_step
+                  List.map m2act soc.Soc.step
                 in
                 let dependances : ActionsDeps.t =
                   let (prefixed_actions : (Soc.ident * action) list) = List.map2
-                    (fun s a -> s.Soc.socm_name,a) soc.Soc.socc_step actions
+                    (fun s a -> s.Soc.name,a) soc.Soc.step actions
                   in
                   ActionsDeps.generate_deps_from_step_policy
-                    soc.Soc.socc_precedences prefixed_actions
+                    soc.Soc.precedences prefixed_actions
                 in
                 let ml = match mem_opt with Some m -> m::ml | None -> ml in
                 (ctx, actions, lpl, ml, dependances)
@@ -573,12 +573,12 @@ let (actions_of_equation: Lxm.t -> Soc.tbl -> ctx -> Lic.eq_info ->
     let clk = match clk with [clk] -> clk | _ -> assert false in
     let left_loc = List.map (filter_of_left_part ctx.prg) left_part in
     let left_loc = List.flatten left_loc in
-    let ctx, actions, _, memories, deps =
+    let ctx, actions, _, instances, deps =
       actions_of_expression lxm soc_tbl ctx clk left_loc right_part
     in
 (*     let final_action = clk_l, inputs, left_loc, Soc.Identity in *)
 (*     let deps = add deps final_action actions in *)
-      ctx, actions, memories, deps
+      ctx, actions, instances, deps
  
 
 
@@ -622,7 +622,7 @@ let rec (soc_of_node: LicPrg.t -> Lic.node_exp -> Soc.tbl -> (ctx * Soc.t) optio
         in
         let meth = build_meth lxm "step" node (locals @ ctx.locals) actions in
         let profile = soc_profile_of_node node in
-        let memories, init_actions = List.split mems in
+        let instances, init_actions = List.split mems in
         let init_meth = match init_actions with
           | []      -> None
           | actions -> Some (build_meth lxm "init" node [] (List.flatten actions))
@@ -630,12 +630,12 @@ let rec (soc_of_node: LicPrg.t -> Lic.node_exp -> Soc.tbl -> (ctx * Soc.t) optio
         let io_list = node.Lic.inlist_eff @ node.Lic.outlist_eff in 
         let io_type = List.map (fun vi -> lic_to_soc_type vi.var_type_eff) io_list in
         let comp = {
-          Soc.socc_key         = Ident.string_of_long2 (fst node.Lic.node_key_eff), io_type, None;
-          Soc.socc_profile     = profile;
-          Soc.socc_memories    = memories;
-          Soc.socc_init        = init_meth;
-          Soc.socc_step        = [meth];
-          Soc.socc_precedences = []; (* TODO pour l'instant, on ne gère qu'une 
+          Soc.key         = Ident.string_of_long2 (fst node.Lic.node_key_eff), io_type, None;
+          Soc.profile     = profile;
+          Soc.instances    = instances ;
+          Soc.init        = init_meth;
+          Soc.step        = [meth];
+          Soc.precedences = []; (* TODO pour l'instant, on ne gère qu'une 
                                         seule méthode *)
         } 
         in
@@ -679,7 +679,7 @@ let f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) =
 
               | Undef_soc (sk,lxm,pos_op, types) ->
                 let soc = SocPredef.soc_interface_of_pos_op lxm pos_op types in
-                let acc_comp = SocMap.add soc.socc_key soc acc_comp in
+                let acc_comp = SocMap.add soc.key soc acc_comp in
                 snd (process_node nk acc_comp)
         in
         sk, acc_comp
diff --git a/src/soc.ml b/src/soc.ml
index f6218f72..9c1b43a8 100644
--- a/src/soc.ml
+++ b/src/soc.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 07/03/2013 (at 10:47) by Erwan Jahier> *)
+(* Time-stamp: <modified the 11/03/2013 (at 09:23) by Erwan Jahier> *)
 
 (** Synchronous Object Component *)
 
@@ -46,62 +46,31 @@ type gao =
 
 
 type step_method = {
-  socm_name    : ident;
-  socm_lxm     : Lxm.t;
-  socm_inputs  : int list; (* input  index in the socc_profile *)
-  socm_outputs : int list; (* output index in the socc_profile *)
-  socm_impl    : (var list * gao list) option; (* local vars + body ; None for predef op *)
+  name    : ident;
+  lxm     : Lxm.t;
+  idx_ins  : int list; (* input  index in the profile *)
+  idx_outs : int list; (* output index in the profile *)
+  impl    : (var list * gao list) option; (* local vars + body ; None for predef op *)
 }
 
 type precedence = ident * ident list   
-(* Partial order over socc_step members. Maps a step method name with
+(* Partial order over step members. Maps a step method name with
    the list of step methods that should be called _before_.
    
-   nb : steps in socc_step are already ordered ; this partial order
+   nb : steps in step are already ordered ; this partial order
    can be useful to find another (better) total order w.r.t. test
    opening.
 *)
 
-
-(* type t = string (* unique *) * key *)
-
-type memory =
-  | CompMem of ident * key (* Memory name * instanciated component key *)
-  | VarMem of var
-(* for pre and fby. Is it a good idea to make this distinction ? 
-
-I should rather use the following def to make thing morehomogeneous :
-
-type memory = ident * key
-
-Actually, such a memory is a soc instance!
-
-I could therefore call it 'instance' (as Pascal in licc BTW)
-
-
-*)
-
-
 type t = { 
-(*  
-les memoires de l'objet sont calculées par l'interpreteur (ou l'objet C)
-
-    key
-    ins
-    outs
-    locs
-    init
-    steps
-    precedences
-*)
-  socc_key      : key;
-  socc_profile  : var list * var list;
-  socc_memories : instance list;
-  socc_init     : step_method option;
-  socc_step     : step_method list; (* the order in the list is a valid w.r.t. 
-                                       the partial order defined in 
-                                       socc_precedences *)
-  socc_precedences : precedence list; (* partial order over socc_step methods *)
+  (* les memoires de l'objet sont calculées par l'interpreteur (ou l'objet C)  *)
+  key      : key;
+  profile  : var list * var list;
+  instances : instance list;
+  init     : step_method option;
+  step     : step_method list; (* the order in the list is a valid w.r.t. 
+                                  the partial order defined in precedences *)
+  precedences : precedence list; (* partial order over step methods *)
 }
 
 (* SocKeyMap ? *)
diff --git a/src/socExecValue.ml b/src/socExecValue.ml
index 67913536..3bb73c73 100644
--- a/src/socExecValue.ml
+++ b/src/socExecValue.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 07/03/2013 (at 18:16) by Erwan Jahier> *)
+(* Time-stamp: <modified the 11/03/2013 (at 09:13) by Erwan Jahier> *)
 
 open Soc
 
@@ -33,7 +33,7 @@ let (read_value : var -> t) =
 
 let (read_soc_input : Soc.t -> substs) =
   fun soc -> 
-    List.map (fun var -> Lic2soc.user_var_prefix^(fst var), read_value var) (fst soc.socc_profile)
+    List.map (fun var -> Lic2soc.user_var_prefix^(fst var), read_value var) (fst soc.profile)
 
 let (string_of_substs :substs -> string) = 
   fun s -> 
diff --git a/src/socPredef.ml b/src/socPredef.ml
index 773fb6c7..f3075412 100644
--- a/src/socPredef.ml
+++ b/src/socPredef.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 07/03/2013 (at 17:58) by Erwan Jahier> *)
+(* Time-stamp: <modified the 11/03/2013 (at 09:20) by Erwan Jahier> *)
 
 (** Synchronous Object Code for Predefined operators. *)
 
@@ -54,28 +54,28 @@ let (soc_profile_of_types : Soc.var_type list -> var list * var list) =
   
 
 let step11 = { (* a useful alias again *)
-  socm_name    = "step";
-  socm_lxm     = Lxm.dummy "predef soc";
-  socm_inputs  = [0];
-  socm_outputs = [0];
-  socm_impl    = None;
+  name    = "step";
+  lxm     = Lxm.dummy "predef soc";
+  idx_ins  = [0];
+  idx_outs = [0];
+  impl    = None;
 }
 let step21 impl = { (* a useful alias again *)
-  socm_name    = "step";
-  socm_lxm     = Lxm.dummy "predef soc";
-  socm_inputs  = [0;1];
-  socm_outputs = [0];
-  socm_impl    = impl;
+  name    = "step";
+  lxm     = Lxm.dummy "predef soc";
+  idx_ins  = [0;1];
+  idx_outs = [0];
+  impl    = impl;
 }
 
 (* used to build predef soc with no memory *)
 let make_soc key profile steps =  {
-      socc_key      = key;
-      socc_profile  = profile;
-      socc_memories = [];
-      socc_init     = None;
-      socc_precedences  = [];
-      socc_step     = steps;
+      key      = key;
+      profile  = profile;
+      instances = [];
+      init     = None;
+      precedences  = [];
+      step     = steps;
     }
 
 
@@ -121,64 +121,64 @@ let of_soc_key : Soc.key -> Soc.t =
         
       | "Lustre::current" -> (make_soc sk (sp tl) [step11])
 
-      (* Those have memories *)
+      (* Those have instances *)
       | "Lustre::fby"  ->  {
-        socc_key      = sk;
-        socc_profile  = (sp tl);
-        socc_memories = [("fby_mem", sk)];
-        socc_step  = [
+        key      = sk;
+        profile  = (sp tl);
+        instances = [("fby_mem", sk)];
+        step  = [
           {
-            socm_name    = "get";
-            socm_lxm     = Lxm.dummy "predef soc";
-            socm_inputs  = [];
-            socm_outputs = [0];
-            socm_impl    = None;
+            name    = "get";
+            lxm     = Lxm.dummy "predef soc";
+            idx_ins  = [];
+            idx_outs = [0];
+            impl    = None;
           };
           {
-            socm_name    = "set";
-            socm_lxm     = Lxm.dummy "predef soc";
-            socm_inputs  = [1];
-            socm_outputs = [];
-            socm_impl    = None
+            name    = "set";
+            lxm     = Lxm.dummy "predef soc";
+            idx_ins  = [1];
+            idx_outs = [];
+            impl    = None
           };
         ];
-        socc_precedences   = ["set", ["get"]];
-        socc_init      = Some {
-          socm_name    = "init";
-          socm_lxm     = Lxm.dummy "predef soc";
-          socm_inputs  = [0] ;
-          socm_outputs = [];
-          socm_impl    = None;
+        precedences   = ["set", ["get"]];
+        init      = Some {
+          name    = "init";
+          lxm     = Lxm.dummy "predef soc";
+          idx_ins  = [0] ;
+          idx_outs = [];
+          impl    = None;
         };
       } 
         
       | "Lustre::pre" ->  {
-        socc_key      = sk;
-        socc_profile  = (sp tl);
-        socc_memories = [("pre_mem", sk)];
-        socc_step  = [
+        key      = sk;
+        profile  = (sp tl);
+        instances = [("pre_mem", sk)];
+        step  = [
           {
-            socm_name    = "get";
-            socm_lxm     = Lxm.dummy "predef soc";
-            socm_inputs  = [];
-            socm_outputs = [0];
-            socm_impl    = None;
+            name    = "get";
+            lxm     = Lxm.dummy "predef soc";
+            idx_ins  = [];
+            idx_outs = [0];
+            impl    = None;
           };
           {
-            socm_name    = "set";  
-            socm_lxm     = Lxm.dummy "predef soc";
-            socm_inputs  = [0];
-            socm_outputs = [];
-            socm_impl    = None
+            name    = "set";  
+            lxm     = Lxm.dummy "predef soc";
+            idx_ins  = [0];
+            idx_outs = [];
+            impl    = None
           };
         ];
-        socc_precedences = ["set", ["get"]];
-        socc_init      = Some {
-          socm_name    = "init";
-          socm_lxm     = Lxm.dummy "predef soc";
-          socm_inputs  = [] ; (* XXX ??? *)
-          socm_outputs = [];
-          socm_impl    = None;
+        precedences = ["set", ["get"]];
+        init      = Some {
+          name    = "init";
+          lxm     = Lxm.dummy "predef soc";
+          idx_ins  = [] ; (* XXX ??? *)
+          idx_outs = [];
+          impl    = None;
         };
       }
       | "Lustre::arrow"  ->  
@@ -188,43 +188,43 @@ let of_soc_key : Soc.key -> Soc.t =
         let t = List.hd tl in
         let init = Var("arrow_init", Bool) in
         {
-        socc_key      = sk;
-        socc_profile  = prof;
-        socc_memories = [("arrow_init",sk)];
-        socc_step  = [
+        key      = sk;
+        profile  = prof;
+        instances = [("arrow_init",sk)];
+        step  = [
           {
-            socm_name    = "step";
-            socm_lxm     = Lxm.dummy "predef soc";
-            socm_inputs  = [0;1];
-            socm_outputs = [0];
-            socm_impl    = Some([],[Call([Var(vout)], 
+            name    = "step";
+            lxm     = Lxm.dummy "predef soc";
+            idx_ins  = [0;1];
+            idx_outs = [0];
+            impl    = Some([],[Call([Var(vout)], 
                                          Procedure ("Lustre::if", [Bool;t;t;t],None),
                                          [init;Var(v1);Var(v2)])]);
           };
         ];
-        socc_precedences   = [];
-        socc_init      = Some {
-          socm_name    = "init";
-          socm_lxm     = Lxm.dummy "predef soc";
-          socm_inputs  = [0];
-          socm_outputs = [0];
-          socm_impl    = Some([],[Call([init], Assign, [Const("false",Bool)])]);
+        precedences   = [];
+        init      = Some {
+          name    = "init";
+          lxm     = Lxm.dummy "predef soc";
+          idx_ins  = [0];
+          idx_outs = [0];
+          impl    = Some([],[Call([init], Assign, [Const("false",Bool)])]);
         };
       }
 
       | "Lustre::if"  ->  {
-        socc_key      = sk;
-        socc_profile  = (sp tl);
-        socc_memories = [];
-        socc_init     = None;
-        socc_precedences  = [];
-        socc_step     = [
+        key      = sk;
+        profile  = (sp tl);
+        instances = [];
+        init     = None;
+        precedences  = [];
+        step     = [
           {
-            socm_name    = "step";
-            socm_lxm     = Lxm.dummy "predef soc";
-            socm_inputs  = [0; 1; 2];
-            socm_outputs = [0];
-            socm_impl    = None;
+            name    = "step";
+            lxm     = Lxm.dummy "predef soc";
+            idx_ins  = [0; 1; 2];
+            idx_outs = [0];
+            impl    = None;
           }
         ];
       }
@@ -254,23 +254,23 @@ let instanciate_soc: Soc.t -> Soc.var_type -> Soc.t =
         | vt -> vt
     in
     let new_profile =
-      List.map (fun (vn,vt) -> vn, instanciate_type vt) (fst c.socc_profile),
-      List.map (fun (vn,vt) -> vn, instanciate_type vt) (snd c.socc_profile)
+      List.map (fun (vn,vt) -> vn, instanciate_type vt) (fst c.profile),
+      List.map (fun (vn,vt) -> vn, instanciate_type vt) (snd c.profile)
     in
     let instanciate_key  (key1, key2, key3) = 
       (instanciate_name key1 concrete_type, 
        List.map instanciate_type key2, 
        key3) 
     in
-    let new_key = instanciate_key c.socc_key in 
-    let new_memories = 
-      List.map (fun (id,sk) -> (id,instanciate_key sk)) c.socc_memories
+    let new_key = instanciate_key c.key in 
+    let new_instances = 
+      List.map (fun (id,sk) -> (id,instanciate_key sk)) c.instances
     in
       { 
         c with 
-          socc_key = new_key;
-          socc_profile = new_profile;
-          socc_memories = new_memories;
+          key = new_key;
+          profile = new_profile;
+          instances = new_instances;
       }
 
 
@@ -306,20 +306,20 @@ let make_slice_soc: Lic.slice_info -> Soc.var_type -> Soc.t =
         | _ -> assert false
     in
       {
-        socc_key = ("array_slice", [t], Some (f, l, step));
-        socc_profile  = (["t", t], ["st", sub_array_type ]);
-        socc_memories = [];
-        socc_step  = [
+        key = ("array_slice", [t], Some (f, l, step));
+        profile  = (["t", t], ["st", sub_array_type ]);
+        instances = [];
+        step  = [
           {
-            socm_name    = "step";
-            socm_lxm     = Lxm.dummy "predef soc";
-            socm_inputs  = [0];
-            socm_outputs = [0];
-            socm_impl    = None;
+            name    = "step";
+            lxm     = Lxm.dummy "predef soc";
+            idx_ins  = [0];
+            idx_outs = [0];
+            impl    = None;
           };
         ];
-        socc_precedences   = [];
-        socc_init      = None;
+        precedences   = [];
+        init      = None;
       } 
 
 
@@ -331,20 +331,20 @@ let make_array_soc: int -> Soc.var_type -> Soc.t =
         | t -> Soc.Array(t,i)
     in
       {
-        socc_key = ("hat", [array_type], None);
-        socc_profile  = (["t", t], ["st", array_type]);
-        socc_memories = [];
-        socc_step  = [
+        key = ("hat", [array_type], None);
+        profile  = (["t", t], ["st", array_type]);
+        instances = [];
+        step  = [
           {
-            socm_name    = "step";
-            socm_lxm     = Lxm.dummy "predef soc";
-            socm_inputs  = [0];
-            socm_outputs = [0];
-            socm_impl    = None;
+            name    = "step";
+            lxm     = Lxm.dummy "predef soc";
+            idx_ins  = [0];
+            idx_outs = [0];
+            impl    = None;
           };
         ];
-        socc_precedences   = [];
-        socc_init      = None;
+        precedences   = [];
+        init      = None;
       } 
 
 
@@ -528,18 +528,18 @@ dans des noeuds ? bon, je garde quelque temps en commentaire au cas ou...
 		                  analyses et de la vérification
 
 	                  *)
-              socc_key = ("fillred" ^ node ^ (string_of_int size), [], None);
-              socc_profile  = 
-                (arrayse (fst c.socc_profile), arrayse (snd c.socc_profile));
-              socc_memories = c.socc_memories;
-              socc_step  = c.socc_step; 
+              key = ("fillred" ^ node ^ (string_of_int size), [], None);
+              profile  = 
+                (arrayse (fst c.profile), arrayse (snd c.profile));
+              instances = c.instances;
+              step  = c.step; 
                      (* XXX non ! le probleme, c'est que cette methode step 
 		                  doit être fabriquée à partir de la methode step 
 		                  du noeud itéré, et que je n'ai rien pour exprimer 
 		                  ce genre de truc pour l'instant.
 	                  *)
-              socc_precedences  = [];
-              socc_init = c.socc_init; (* XXX non ! *)
+              precedences  = [];
+              init = c.init; (* XXX non ! *)
             } 
         )
       | Lic.Map(node,size), _ -> 
@@ -562,13 +562,13 @@ dans des noeuds ? bon, je garde quelque temps en commentaire au cas ou...
               (List.map exp l)
             in
             Some  { 
-              socc_key = ("map" ^ node ^ (string_of_int size), [], None);
-              socc_profile  = 
-                (arrayse (fst c.socc_profile), arrayse (snd c.socc_profile));
-              socc_memories = c.socc_memories;
-              socc_step  = c.socc_step; (* XXX non ! *)
-              socc_precedences   = [];
-              socc_init      = c.socc_init;
+              key = ("map" ^ node ^ (string_of_int size), [], None);
+              profile  = 
+                (arrayse (fst c.profile), arrayse (snd c.profile));
+              instances = c.instances;
+              step  = c.step; (* XXX non ! *)
+              precedences   = [];
+              init      = c.init;
             } 
         )
       | Lic.BoolRed(i,j,k), _  -> Errors.finish_me lxm ; assert false
diff --git a/src/socUtils.ml b/src/socUtils.ml
index 330e68d6..0882f765 100644
--- a/src/socUtils.ml
+++ b/src/socUtils.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 07/03/2013 (at 11:12) by Erwan Jahier> *)
+(** Time-stamp: <modified the 11/03/2013 (at 09:24) by Erwan Jahier> *)
 
 
 open Soc
@@ -9,9 +9,9 @@ open Soc
     C'est la liste des méthodes du composant, et la méthode d'initialisation le
     cas échéant. *)
 let get_all_methods: Soc.t -> step_method list = fun c ->
-  match c.socc_init with
-    | None   -> c.socc_step
-    | Some m -> m :: c.socc_step
+  match c.init with
+    | None   -> c.step
+    | Some m -> m :: c.step
 
 (** Fonctions de représentation des objets LOC. *)
 
@@ -82,31 +82,12 @@ let string_of_var: (Soc.var -> string) = fun v ->
   call_fun_ff (string_of_var_ff v)
 
 
-(* Mémoire *)
-let string_of_memory_ff: (memory -> Format.formatter -> unit) = fun v ff ->
-  let name =  match v with
-    | CompMem(id, _) -> id
-    | VarMem v       -> string_of_var v
-  in
-    fprintf ff "%s" name
-
-let string_of_memory: (memory -> string) = fun v ->
-  call_fun_ff (string_of_memory_ff v)
-
 let string_of_instance_ff: (instance -> Format.formatter -> unit) = 
   fun (name,sk) ff ->
     fprintf ff "%s" name
 
 let string_of_instance: (instance -> string) = fun (name,sk) -> name
   
-(* Déclaration d'une mémoire *)
-let string_of_memory_decl_ff: (memory -> Format.formatter -> unit) = fun v ff -> match v with
-  | CompMem(id, key) -> fprintf ff "%s : %s" id (string_of_soc_key key)
-  | VarMem v         -> fprintf ff "%s" (string_of_var v)
-
-let string_of_memory_decl: (memory -> string) = fun v ->
-  call_fun_ff (string_of_memory_decl_ff v)
-
 
 (* Opération *)
 let string_of_operation_ff: (atomic_operation -> Format.formatter -> unit) = fun v ff -> match v with
@@ -174,9 +155,9 @@ let string_interface_of_method_ff: (Soc.t -> step_method -> Format.formatter ->
     string_of_var (List.nth vl i)
   in
     fprintf ff "%s(%s) -> (%s)"
-      m.socm_name
-      (String.concat "; " (List.map (string_var_from_index (fst c.socc_profile)) m.socm_inputs))
-      (String.concat "; " (List.map (string_var_from_index (snd c.socc_profile)) m.socm_outputs))
+      m.name
+      (String.concat "; " (List.map (string_var_from_index (fst c.profile)) m.idx_ins))
+      (String.concat "; " (List.map (string_var_from_index (snd c.profile)) m.idx_outs))
 
 
 let string_interface_of_method: (Soc.t -> step_method -> string) = fun c m ->
@@ -189,7 +170,7 @@ let string_of_method_ff: (Soc.t -> step_method -> Format.formatter -> unit) = fu
   fprintf ff "@[<v>@[<v 2>";
   string_interface_of_method_ff c m ff;
 
-  match m.socm_impl with
+  match m.impl with
     | None -> fprintf ff "@]@]"
     | Some i ->
         let locals, gaos = i in
@@ -229,7 +210,7 @@ let string_of_profile: Soc.var list * Soc.var list -> string = fun profile ->
 (* Convertion des éléments d'un composant *)
 (* Convertion du profil ... *)
 let string_of_soc_profile_ff: (Soc.t -> Format.formatter -> unit) = fun comp ff ->
-  string_of_profile_ff comp.socc_profile ff
+  string_of_profile_ff comp.profile ff
 
 let string_of_soc_profile: (Soc.t -> string) = fun comp ->
   call_fun_ff (string_of_soc_profile_ff comp)
@@ -237,11 +218,11 @@ let string_of_soc_profile: (Soc.t -> string) = fun comp ->
 (* ... des contraintes *)
 let string_of_comp_constraints_ff: (Soc.t -> Format.formatter -> unit) = fun comp ff ->
   fprintf ff "constraints: @[";
-  match comp.socc_precedences with
+  match comp.precedences with
     | [] -> fprintf ff "[]@]"
     | _ ->
         fprintf ff "%s@]"
-          (String.concat "; " (List.map string_of_precedence comp.socc_precedences))
+          (String.concat "; " (List.map string_of_precedence comp.precedences))
 
 let string_of_soc_factory_ff: (
   Soc.t -> Format.formatter ->
@@ -253,16 +234,16 @@ let string_of_soc_factory_ff: (
     match format_mem with
       | None -> ()
       | Some f -> (
-        fprintf ff "@[<v 2>memories:@,";
+        fprintf ff "@[<v 2>instances:@,";
         List.iter (
           fun m ->
             f m ff;
             fprintf ff ";@,"
-        ) comp.socc_memories
+        ) comp.instances
       )
   in
   let display_init () =
-    match comp.socc_init with
+    match comp.init with
       | None -> fprintf ff "@[<v 2>init: -@]"
       | Some m -> (
         fprintf ff "@[<v 2>init:@,";
@@ -272,7 +253,7 @@ let string_of_soc_factory_ff: (
   in
 
   fprintf ff "@[<v>@[<v 2>soc ";
-  string_of_soc_key_ff comp.socc_key ff;
+  string_of_soc_key_ff comp.key ff;
   fprintf ff ":@,@[<v>";
 
   string_of_soc_profile_ff comp ff;
@@ -293,7 +274,7 @@ let string_of_soc_factory_ff: (
       fprintf ff "@[";
       format_meth comp s ff;
       fprintf ff "@]@,"
-  ) comp.socc_step;
+  ) comp.step;
 
   fprintf ff "@]@]@]@]@."
 
diff --git a/src/socUtils.mli b/src/socUtils.mli
index 3ba38cf2..d71239c0 100644
--- a/src/socUtils.mli
+++ b/src/socUtils.mli
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 07/03/2013 (at 11:12) by Erwan Jahier> *)
+(** Time-stamp: <modified the 11/03/2013 (at 09:24) by Erwan Jahier> *)
 
 
 (** Donne toute les méthodes d'un composant. *)
@@ -9,7 +9,6 @@ val get_all_methods: Soc.t -> Soc.step_method list
 val string_of_type_ref            : Soc.var_type -> string
 val string_of_soc_key             : Soc.key -> string
 val string_of_var                 : Soc.var -> string
-val string_of_memory              : Soc.memory -> string
 val string_of_operation           : Soc.atomic_operation -> string
 val string_of_gao                 : Soc.gao -> string
 val string_of_gaos_list           : Soc.gao list -> string
@@ -24,7 +23,6 @@ val string_of_soc                 : Soc.t -> string
 val string_of_type_ref_ff         : Soc.var_type       -> Format.formatter -> unit
 val string_of_soc_key_ff          : Soc.key  -> Format.formatter -> unit
 val string_of_var_ff              : Soc.var            -> Format.formatter -> unit
-val string_of_memory_ff           : Soc.memory         -> Format.formatter -> unit
 val string_of_operation_ff        : Soc.atomic_operation      -> Format.formatter -> unit
 val string_of_filter_ff           : Soc.var_expr         -> Format.formatter -> unit
 val string_of_gao_ff              : Soc.gao           -> Format.formatter -> unit
-- 
GitLab