From 89035b8b2f7e691fbff7e73e33ef0a507d5a6c49 Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Tue, 22 Jul 2008 11:01:13 +0200
Subject: [PATCH] rename CompiledDataDump into LicDump.

---
 Makefile                                   |  2 +-
 src/Makefile                               |  2 +-
 src/TODO                                   | 32 +++++++++----------
 src/compile.ml                             |  4 +--
 src/evalClock.ml                           |  6 ++--
 src/evalConst.ml                           | 26 ++++++++--------
 src/evalType.ml                            |  4 +--
 src/getEff.ml                              | 12 ++++----
 src/lazyCompiler.ml                        | 36 +++++++++++-----------
 src/{compiledDataDump.ml => licDump.ml}    |  4 +--
 src/main.ml                                |  4 +--
 src/predefEvalType.ml                      | 16 +++++-----
 src/predefSemantics.ml                     | 16 +++++-----
 src/test/should_work/NONREG/test_clash.lus | 25 +++++++++++++++
 src/test/test.res.exp                      | 33 ++++++++++++++++++++
 src/unifyClock.ml                          |  6 ++--
 src/unifyType.ml                           |  8 ++---
 17 files changed, 144 insertions(+), 92 deletions(-)
 rename src/{compiledDataDump.ml => licDump.ml} (99%)
 create mode 100644 src/test/should_work/NONREG/test_clash.lus

diff --git a/Makefile b/Makefile
index 93ed2c68..fa7ec4f4 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ all:
 .PHONY: diff test log
 
 diff:
-	rm -f diff_lv6.diff; git diff --ignore-all-space > diff_lv6.diff
+	rm -f diff_lv6.diff; git diff --ignore-all-space > diff_lv6.diff ; ls -l diff_lv6.diff
 
 log:
 	rm -f lv6.log; git log > lv6.log
diff --git a/src/Makefile b/src/Makefile
index 126a878e..b72271e1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -33,7 +33,7 @@ SOURCES =  \
 	./symbolTab.mli \
 	./symbolTab.ml \
 	./compiledData.ml \
-	./compiledDataDump.ml \
+	./licDump.ml \
 	./unifyType.mli \
 	./unifyType.ml \
 	./unifyClock.mli \
diff --git a/src/TODO b/src/TODO
index 97b617b5..60ba183f 100644
--- a/src/TODO
+++ b/src/TODO
@@ -39,12 +39,10 @@ par exemple, dans test/should_work/NONREG/simple.lus,
 
 est evalué (+ warning) alors qu'on ne devrait pas je trouve.
 
- -> à discuter
-
-par exemple, pour les comparaisons, c'est ok à la limite. mais pour
-les operateurs aritmetiques, bof.
+ -> à discuter (n'accepter qu'avec une option spécifique passée au compilo?)
 
 * pour l'evaluation statique de l'egalité, j'ai pas fait pareil...
+
 -> à discuter (cf predefInfo.ml)
 
 * Evaluer  statiquement  les  iterateurs  quand  c'est  possible  (cf
@@ -76,14 +74,11 @@ les operateurs aritmetiques, bof.
 
 * au sujet des pragma:
  ex : %ASSUME:assumeSelectElementOfRank_inArray_%
- je les ai rajouté (un peu) dans le parseurs
+ je les ai rajouté (un peu) dans le parseur
   -> 3 shift/reduce conflicts !
   et puis  il faut  que je  les mettre partout  -> changer  une autre
  regle ? sxIdent ?
 
-* Dans les messages d'erreurs, le  numero de colonne est faux à cause
-  des tabulations : y'at'il quelque chose a faire ? 
-
 
 * autoriser les noeuds (ou fonction) sans corps sans avoir a préciser
 "extern" ?
@@ -128,7 +123,7 @@ lazycompiler.ml:
 
 * Ident.idref : a remettre dans SyntaxTree ? en tout cas, je devrais
 m'en etre completement debarassé au niveau du compiledData, et ca
-n'est pas le cas pour l'instant...
+n'est pas le cas pour l'instant... cf  [solve_ident]
 
 * traiter les types int, real, bool dans Predef ?
 
@@ -138,7 +133,7 @@ n'est pas le cas pour l'instant...
 * un noeud  sans memoire  pourra etre déclaré  comme "node"  ou comme
 "function" que si l'option -v4-compat est donnée ?
 
-* rejeter les expressions su style "a when a" ?
+* rejeter les expressions du style "a when a" ?
 
 *********************************************************************
 *********************************************************************
@@ -154,9 +149,10 @@ n'est pas le cas pour l'instant...
 
 * ../lus2lic should_work/NONREG/Int.lus 
 
-  "zero" versus "Int::zero". Ce probleme est une consequence d'un 
-  mauvaix  choix  de  représentation   pour  les  ident  dans  l'abre
-  syntaxique. cf le laius a propos de solveIdent.ml plus bas.
+  "zero"  versus "Int::zero".  Ce probleme  est une  consequence d'un
+  mauvaix  choix  de  représentation  pour  les  ident  dans  l'arbre
+  syntaxique. cf le  laius a propos de solveIdent.ml  plus bas (i.e.,
+  [solve_ident])
 
 * verifier que chacun des exemples du repertoire "should_fail" échoue
 avec un bon message d'erreur. 
@@ -166,12 +162,10 @@ A ce propose, pourquoi
      should_fail/semantics/activation2.lus
 sont-ils sensés échouer ?
 
-* mettre les operateurs temporels dans Predef ???
-
 * Verifier que les fonctions sont des fonctions etc. 
 
-* verifier  qu'il n'est  pas nécessaire  de verifier  que le  gens ne
-  nomme pas leur package Lustre...
+* verifier  qu'il n'est  pas nécessaire  de verifier  que les  gens ne
+  nomment pas leur package Lustre...
 
 * Encapsuler le module Global.
 
@@ -193,7 +187,9 @@ cf
    test/should_fail/semantics/piege.lus
 
 ---------------------------------------------------------------------
-* finir solveIdent.ml 
+* [solve_ident]
+
+finir solveIdent.ml 
 
 ca devrait corriger  le pb dans test/should_work/NONREG/alarme.lus ou
 la constant "delai_reprise"  est defini comme "alarme__delai_reprise"
diff --git a/src/compile.ml b/src/compile.ml
index 078147d7..e398361b 100644
--- a/src/compile.ml
+++ b/src/compile.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 01/07/2008 (at 14:55) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:55) by Erwan Jahier> *)
 
 
 open Lxm
@@ -40,7 +40,7 @@ let (doit : SyntaxTree.pack_or_model list -> Ident.idref option -> unit) =
 	  in
 	    Verbose.printf 
 	      "-- MAIN NODE: \"%s\"\n" 
-	      (CompiledDataDump.string_of_node_key_rec main_node_key);
+	      (LicDump.string_of_node_key_rec main_node_key);
 	    
 	    if !Global.compile_all_items then
 	      LazyCompiler.compile_all lzcomp
diff --git a/src/evalClock.ml b/src/evalClock.ml
index 11ab8a83..6968aaa7 100644
--- a/src/evalClock.ml
+++ b/src/evalClock.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 03/07/2008 (at 09:52) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:58) by Erwan Jahier> *)
  
   
 open Predef
@@ -6,7 +6,7 @@ open PredefEvalConst
 open SyntaxTree
 open SyntaxTreeCore
 open CompiledData
-open CompiledDataDump
+open LicDump
 open Printf
 open Lxm
 open Errors
@@ -166,7 +166,7 @@ let (get_clock_profile : node_exp_eff -> clock_profile) =
       (List.map var_info_eff_to_clock_eff n.inlist_eff, 
        List.map var_info_eff_to_clock_eff n.outlist_eff)
 
-let ci2str = CompiledDataDump.string_of_clock2
+let ci2str = LicDump.string_of_clock2
 
 
 let cpt_var_name = ref 0
diff --git a/src/evalConst.ml b/src/evalConst.ml
index 1d138169..188203a7 100644
--- a/src/evalConst.ml
+++ b/src/evalConst.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 01/07/2008 (at 14:00) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:55) by Erwan Jahier> *)
 
 
 open Printf 
@@ -61,8 +61,8 @@ let (make_array_const : const_eff list array -> const_eff) =
 		    if (t = xtyp) then x else 
 		      raise (EvalConst_error(
 			       "type error in array, "^
-				 (CompiledDataDump.string_of_type_eff xtyp)^
-				 " mixed with " ^ CompiledDataDump.string_of_type_eff t
+				 (LicDump.string_of_type_eff xtyp)^
+				 " mixed with " ^ LicDump.string_of_type_eff t
 			     ))
 		  )
 	  )
@@ -102,8 +102,8 @@ let make_struct_const
 				    sprintf
 				      "\n*** type error in struct %s, %s instead of %s"
 				      (Ident.string_of_long tnm)
-				      (CompiledDataDump.string_of_type_eff vt)
-				      (CompiledDataDump.string_of_type_eff ft) 
+				      (LicDump.string_of_type_eff vt)
+				      (LicDump.string_of_type_eff ft) 
 				  )) 
 		  )
 	    ) with Not_found -> (
@@ -127,7 +127,7 @@ let make_struct_const
 			sprintf
 			  "\n*** %s is not a field of struct %s" 
 			  (Ident.to_string id) 
-			  (CompiledDataDump.string_of_type_eff(teff))
+			  (LicDump.string_of_type_eff(teff))
 		      )) 
 	  in 
 	    Hashtbl.iter raise_error arg_tab ;
@@ -137,7 +137,7 @@ let make_struct_const
       | _ -> raise (EvalConst_error(
 			  sprintf
 			    "struct type expected instead of %s" 
-			    (CompiledDataDump.string_of_type_eff teff)
+			    (LicDump.string_of_type_eff teff)
 			))
   )
 
@@ -243,8 +243,8 @@ let rec f
 			    raise(EvalConst_error(
 				    sprintf 
 				      "\n*** type combination error, can't concat %s with %s"
-				      (CompiledDataDump.string_of_type_eff(t0)) 
-				      (CompiledDataDump.string_of_type_eff(t1)) 
+				      (LicDump.string_of_type_eff(t0)) 
+				      (LicDump.string_of_type_eff(t1)) 
 				  ))
 			)
 		      | [_;_] -> 
@@ -295,7 +295,7 @@ let rec f
 			     raise (EvalConst_error
 				      (Printf.sprintf "%s is not a field of struct %s" 
 					 (Ident.to_string fid) 
-					 (CompiledDataDump.string_of_type_eff(typ))))
+					 (LicDump.string_of_type_eff(typ))))
 			 )
 		       | [x] -> type_error_const [x] "struct type"
 		       | x -> arity_error_const x "1"
@@ -400,7 +400,7 @@ and (eval_array_size: id_solver -> val_exp -> int) =
 	    raise(EvalArray_error(sprintf "bad array size %d" sz))
       | [x] -> 
 	  raise(EvalArray_error(sprintf  "bad array size, int expected but get %s"
-			(CompiledDataDump.string_of_type_eff(type_of_const_eff x)))) 
+			(LicDump.string_of_type_eff(type_of_const_eff x)))) 
       | _ -> 
 	  raise(EvalArray_error(sprintf "bad array size, int expected, not a tuple"))
 	    
@@ -435,7 +435,7 @@ and eval_array_index
 	| [Extern_const_eff(_,_, Some x)] 
 	| [x] -> raise(EvalArray_error(sprintf 
 			"bad array index, int expected but get %s"
-			(CompiledDataDump.string_of_type_eff(type_of_const_eff x)))
+			(LicDump.string_of_type_eff(type_of_const_eff x)))
 		      ) 
 	| _ -> raise(EvalArray_error(
 		       sprintf "bad array index, int expected but get a tuple"))
@@ -478,7 +478,7 @@ and eval_array_slice (env : id_solver) (sl : slice_info) (sz : int) (lxm : Lxm.t
 	      | [Int_const_eff s] ->  s (* ok *)		    
 	      | [x] -> raise(EvalArray_error(
 		      sprintf  "bad array step, int expected but get %s"
-			(CompiledDataDump.string_of_type_eff (type_of_const_eff x)))) 
+			(LicDump.string_of_type_eff (type_of_const_eff x)))) 
 	      | _ -> raise(EvalArray_error(
 			     sprintf "bad array step, int expected but get a tuple"))
 	  )
diff --git a/src/evalType.ml b/src/evalType.ml
index 6d03e877..e4e7738d 100644
--- a/src/evalType.ml
+++ b/src/evalType.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 01/07/2008 (at 14:14) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:58) by Erwan Jahier> *)
  
   
 open Predef
@@ -81,7 +81,7 @@ and (eval_by_pos_type :
 		     raise (EvalType_error
 	              (Printf.sprintf "%s is not a field of struct %s" 
 			 (Ident.to_string fid) 
-			 (CompiledDataDump.string_of_type_eff(List.hd type_args_eff))))
+			 (LicDump.string_of_type_eff(List.hd type_args_eff))))
 		 )
 	       | [x] -> type_error [x] "struct type"
 	       | x -> arity_error x "1"
diff --git a/src/getEff.ml b/src/getEff.ml
index 722e5d14..528ec8a0 100644
--- a/src/getEff.ml
+++ b/src/getEff.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 01/07/2008 (at 14:51) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:56) by Erwan Jahier> *)
 
 
 open Lxm
@@ -61,9 +61,9 @@ and (type_check_equation: id_solver -> eq_info srcflagged -> left_eff list ->
 	  (fun le re -> 
 	     if le <> re then
 	       let msg = "type mismatch: \n***\t'" 
-		 ^ (CompiledDataDump.string_of_type_eff le) ^ 
+		 ^ (LicDump.string_of_type_eff le) ^ 
 		 "' (left-hand-side) \n*** is not compatible with \n***\t'" 
-		 ^ (CompiledDataDump.string_of_type_eff re) ^ "' (right-hand-side)"
+		 ^ (LicDump.string_of_type_eff re) ^ "' (right-hand-side)"
 	       in
 		 raise (Compile_error(eq_info.src, msg))
 	  )
@@ -365,7 +365,7 @@ and (translate_by_pos_op : id_solver -> by_pos_op srcflagged -> val_exp list ->
 	      | _ ->
 		  raise (Compile_error(
 			   lxm, "\n*** Type error: '" ^ 
-			     (CompiledDataDump.string_of_type_eff_list teff) ^ 
+			     (LicDump.string_of_type_eff_list teff) ^ 
 			     "' was expected to be an array"))
 	  in
 	    ARRAY_ACCES_eff(
@@ -384,7 +384,7 @@ and (translate_by_pos_op : id_solver -> by_pos_op srcflagged -> val_exp list ->
 	      | _ ->
 		  raise (Compile_error(
 			   lxm, "\n*** Type error: '" ^ 
-			     (CompiledDataDump.string_of_type_eff_list teff) ^ 
+			     (LicDump.string_of_type_eff_list teff) ^ 
 			     "' was expected to be an array"))
 	  in
 	    ARRAY_SLICE_eff(EvalConst.eval_array_slice id_solver si size lxm, 
@@ -422,7 +422,7 @@ let (assertion : CompiledData.id_solver -> SyntaxTreeCore.val_exp  Lxm.srcflagge
 	(fun ve -> 
 	   if ve <> Bool_type_eff then
 	     let msg = "type mismatch: \n\tthe content of the assertion is of type " 
-	       ^ (CompiledDataDump.string_of_type_eff ve) 
+	       ^ (LicDump.string_of_type_eff ve) 
 	       ^ " whereas it shoud be a Boolean\n"
 	     in
 	       raise (Compile_error(vef.src, msg))
diff --git a/src/lazyCompiler.ml b/src/lazyCompiler.ml
index c9ceac2f..64893d3a 100644
--- a/src/lazyCompiler.ml
+++ b/src/lazyCompiler.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 04/07/2008 (at 15:52) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:56) by Erwan Jahier> *)
 
 
 open Lxm
@@ -304,9 +304,9 @@ and (type_check_interface_do: t -> Ident.long -> Lxm.t -> SymbolTab.t ->
 	raise(Compile_error (
 		type_def.src,
 		("provided type \n\t" ^ 
-		   (CompiledDataDump.string_of_type_eff prov_type_eff) ^
+		   (LicDump.string_of_type_eff prov_type_eff) ^
 		   "\n is not compatible with its implementation \n\t" ^ 
-		   (CompiledDataDump.string_of_type_eff body_type_eff))))
+		   (LicDump.string_of_type_eff body_type_eff))))
 
 
 and (const_check_interface_do: t -> Ident.long -> Lxm.t -> SymbolTab.t -> 
@@ -328,9 +328,9 @@ and (const_check_interface_do: t -> Ident.long -> Lxm.t -> SymbolTab.t ->
 	      raise(Compile_error (
 		      const_def.src,
 		      ("provided constant type \n***\t" ^ 
-			 (CompiledDataDump.string_of_type_eff teff_prov)  ^ 
+			 (LicDump.string_of_type_eff teff_prov)  ^ 
 			 "   is not compatible with its implementation \n***\t" ^ 
-			 (CompiledDataDump.string_of_type_eff teff_body) ^ "")
+			 (LicDump.string_of_type_eff teff_body) ^ "")
 		      ))
 	| Enum_const_eff (_, _)
 	| Bool_const_eff _
@@ -386,8 +386,8 @@ and (type_check_do: t -> Ident.long -> Lxm.t -> SymbolTab.t -> bool ->
 				    raise 
 				      (Compile_error(field_def.src, Printf.sprintf
 						       " this field is declared as '%s' but evaluated as '%s'"
-						       (CompiledDataDump.string_of_type_eff teff)
-						       (CompiledDataDump.string_of_type_eff tv)))
+						       (LicDump.string_of_type_eff teff)
+						       (LicDump.string_of_type_eff tv)))
 			      )
 			    | [] -> assert false (* should not occur *)
 			    | _::_ -> 
@@ -401,7 +401,7 @@ and (type_check_do: t -> Ident.long -> Lxm.t -> SymbolTab.t -> bool ->
 	    )
       in
 	if not provide_flag then
- 	  output_string !Global.oc (CompiledDataDump.type_decl type_name type_eff);
+ 	  output_string !Global.oc (LicDump.type_decl type_name type_eff);
 	type_eff
     )
     with
@@ -456,8 +456,8 @@ and (const_check_do : t -> Ident.long -> Lxm.t -> SymbolTab.t -> bool ->
 			      raise 
 				(Compile_error (const_def.src, Printf.sprintf
 				" this constant is declared as '%s' but evaluated as '%s'"
-				(CompiledDataDump.string_of_type_eff tdecl)
-				(CompiledDataDump.string_of_type_eff teff)
+				(LicDump.string_of_type_eff tdecl)
+				(LicDump.string_of_type_eff teff)
 					       )))
 		  )
 		| [] -> assert false (* should not occur *)
@@ -466,7 +466,7 @@ and (const_check_do : t -> Ident.long -> Lxm.t -> SymbolTab.t -> bool ->
 	    )
       in
 	if not provide_flag then
-	  output_string !Global.oc (CompiledDataDump.const_decl cn const_eff);
+	  output_string !Global.oc (LicDump.const_decl cn const_eff);
 	const_eff
     ) with Recursion_error (root, stack) -> (
       (* capte et complete/stoppe les recursions *)
@@ -505,9 +505,9 @@ and (node_check_interface_do: t -> CompiledData.node_key -> Lxm.t ->
 	  Compile_error (
 	    node_def.src,
 	    ("provided node \n\t" ^ 
-	       (CompiledDataDump.profile_of_node_exp_eff prov_node_exp_eff) ^
+	       (LicDump.profile_of_node_exp_eff prov_node_exp_eff) ^
 	       "\n is not compatible with its implementation \n\t" ^
-	       (CompiledDataDump.profile_of_node_exp_eff body_node_exp_eff))))
+	       (LicDump.profile_of_node_exp_eff body_node_exp_eff))))
 
 
 and (node_check_do: t -> CompiledData.node_key -> Lxm.t -> SymbolTab.t -> 
@@ -530,7 +530,7 @@ and (node_check_do: t -> CompiledData.node_key -> Lxm.t -> SymbolTab.t ->
 		    (Hashtbl.fold
 		      (fun id vi_eff acc ->
 			 acc ^ (Format.sprintf 
-			   "\n\t%s" (CompiledDataDump.string_of_var_info_eff vi_eff))
+			   "\n\t%s" (LicDump.string_of_var_info_eff vi_eff))
 		      )
 		      local_env.lenv_vars
 		      ""
@@ -753,7 +753,7 @@ and (node_check_do: t -> CompiledData.node_key -> Lxm.t -> SymbolTab.t ->
 	  )
     in
       if not provide_flag then 
-	output_string !Global.oc (CompiledDataDump.node_of_node_exp_eff res);
+	output_string !Global.oc (LicDump.node_of_node_exp_eff res);
       UniqueOutput.check res node_def.src;
       res
 
@@ -811,11 +811,11 @@ let compile_all_item this label  x_check_interface string_of_x_key
 
 let compile_all_types pack_name this =
   compile_all_item this "type" type_check_interface Ident.string_of_long 
-    CompiledDataDump.string_of_type_eff (fun id -> Ident.make_long pack_name id)
+    LicDump.string_of_type_eff (fun id -> Ident.make_long pack_name id)
 
 let compile_all_constants pack_name this = 
   compile_all_item this "const" const_check_interface  Ident.string_of_long
-    CompiledDataDump.string_of_const_eff  (fun id -> Ident.make_long pack_name id)
+    LicDump.string_of_const_eff  (fun id -> Ident.make_long pack_name id)
 
 
 let (get_static_params : (node_info Lxm.srcflagged) SymbolTab.elt -> 
@@ -830,7 +830,7 @@ let compile_all_nodes pack_name this id ni_f =
     if sp <> [] then () (* we need static arg to compile such kind of things *)
     else
       compile_all_item this "node" node_check_interface 
-	(CompiledDataDump.string_of_node_key_rec)
+	(LicDump.string_of_node_key_rec)
 	CompiledData.profile_of_node_exp_eff 
 	(fun id -> (Ident.make_long pack_name id, [])) id ni_f
 
diff --git a/src/compiledDataDump.ml b/src/licDump.ml
similarity index 99%
rename from src/compiledDataDump.ml
rename to src/licDump.ml
index f3900249..cb0708d8 100644
--- a/src/compiledDataDump.ml
+++ b/src/licDump.ml
@@ -1,6 +1,4 @@
-(** Time-stamp: <modified the 08/07/2008 (at 17:36) by Erwan Jahier> *)
-
-(* Call it LicDump? *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:54) by Erwan Jahier> *)
 
 open CompiledData
 open Printf
diff --git a/src/main.ml b/src/main.ml
index 405283e3..8eefbd01 100644
--- a/src/main.ml
+++ b/src/main.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 04/07/2008 (at 16:31) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:56) by Erwan Jahier> *)
 
 (** Here follows a description of the different modules used by this lus2lic compiler.
 
@@ -235,7 +235,7 @@ let main = (
     in
       if !Global.outfile <> "" then Global.oc := open_out !Global.outfile;
       Compile.doit nsl main_node;
-      CompiledDataDump.dump_type_alias !Global.oc;
+      LicDump.dump_type_alias !Global.oc;
       close_out !Global.oc
   ) with
       Sys_error(s) ->
diff --git a/src/predefEvalType.ml b/src/predefEvalType.ml
index ac9a9665..8fa4d462 100644
--- a/src/predefEvalType.ml
+++ b/src/predefEvalType.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 08/07/2008 (at 11:10) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:56) by Erwan Jahier> *)
 
 open Predef
 open SyntaxTreeCore
@@ -18,7 +18,7 @@ exception EvalType_error of string
 (* exported *)
 let (type_error : type_eff list -> string -> 'a) =
   fun tel expect -> 
-    let str_l = List.map CompiledDataDump.string_of_type_eff tel in
+    let str_l = List.map LicDump.string_of_type_eff tel in
     let str_provided = String.concat "*" str_l in 
       raise (EvalType_error(
 	       ("\n*** type '" ^ str_provided ^ "' was provided" ^
@@ -274,19 +274,19 @@ let (f : op -> Lxm.t -> CompiledData.static_arg_eff list -> typer) =
 		  | Equal  -> lto
 		  | Unif Any -> 
 		      type_error2 
-			(CompiledDataDump.type_eff_list_to_string l) 
-			(CompiledDataDump.type_eff_list_to_string lti) 
+			(LicDump.type_eff_list_to_string l) 
+			(LicDump.type_eff_list_to_string lti) 
 			"could not instanciate polymorphic type"
 		  | Unif Overload -> 
 		      type_error2 
-			(CompiledDataDump.type_eff_list_to_string l) 
-			(CompiledDataDump.type_eff_list_to_string lti) 
+			(LicDump.type_eff_list_to_string l) 
+			(LicDump.type_eff_list_to_string lti) 
 			"could not instanciate overloaded type"
 
 		  | Unif t -> 
 		      List.map (subst_type t) lto
 
 		  | Ko(str) -> 
-		      type_error2 (CompiledDataDump.type_eff_list_to_string l) 
-			(CompiledDataDump.type_eff_list_to_string lti) str
+		      type_error2 (LicDump.type_eff_list_to_string l) 
+			(LicDump.type_eff_list_to_string lti) str
 
diff --git a/src/predefSemantics.ml b/src/predefSemantics.ml
index 8660a096..47932651 100644
--- a/src/predefSemantics.ml
+++ b/src/predefSemantics.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 26/06/2008 (at 14:49) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:56) by Erwan Jahier> *)
 
 
 open Predef
@@ -21,7 +21,7 @@ exception EvalType_error of string
 
 let (type_error : type_eff list -> string -> 'a) =
   fun tel expect -> 
-    let str_l = List.map CompiledDataDump.string_of_type_eff tel in
+    let str_l = List.map LicDump.string_of_type_eff tel in
     let str_provided = String.concat "*" str_l in 
       raise (EvalType_error(
 	       ("\n*** type '" ^ str_provided ^ "' was provided" ^
@@ -285,21 +285,21 @@ let (type_eval : op -> Lxm.t -> CompiledData.static_arg_eff list -> typer) =
 		  | Equal  -> List.map type_eff_to_type_eff lto
 		  | Unif Any -> 
 		      type_error2 
-			(CompiledDataDump.type_eff_list_to_string l) 
-			(CompiledDataDump.type_eff_list_to_string lti) 
+			(LicDump.type_eff_list_to_string l) 
+			(LicDump.type_eff_list_to_string lti) 
 			"could not instanciate polymorphic type"
 		  | Unif Overload -> 
 		      type_error2 
-			(CompiledDataDump.type_eff_list_to_string l) 
-			(CompiledDataDump.type_eff_list_to_string lti) 
+			(LicDump.type_eff_list_to_string l) 
+			(LicDump.type_eff_list_to_string lti) 
 			"could not instanciate overloaded type"
 
 		  | Unif t -> 
 		      List.map (subst_type (type_eff_to_type_eff t)) lto
 
 		  | Ko(str) -> 
-		      type_error2 (CompiledDataDump.type_eff_list_to_string l) 
-			(CompiledDataDump.type_eff_list_to_string lti) str
+		      type_error2 (LicDump.type_eff_list_to_string l) 
+			(LicDump.type_eff_list_to_string lti) str
 
 
 (*********************************************************************************)
diff --git a/src/test/should_work/NONREG/test_clash.lus b/src/test/should_work/NONREG/test_clash.lus
new file mode 100644
index 00000000..e66094af
--- /dev/null
+++ b/src/test/should_work/NONREG/test_clash.lus
@@ -0,0 +1,25 @@
+-- 
+
+
+package test
+provides 
+  const c : bool;
+  type t ;
+  node toto(x: bool) returns (y: bool);
+body
+
+const c = true;
+type t = bool;
+
+  node toto(x: bool) returns (y: bool);
+  let
+  y = tutu(x) and c;
+  tel 
+
+  node tutu(x: t) returns (y: t);
+  let
+  y = x;
+  tel 
+
+
+end
\ No newline at end of file
diff --git a/src/test/test.res.exp b/src/test/test.res.exp
index 1b01f115..dcd765ab 100644
--- a/src/test/test.res.exp
+++ b/src/test/test.res.exp
@@ -2586,6 +2586,23 @@ let
 tel
 -- end of node o2l_feux_compl::o2l_feux_compl
 
+----------------------------------------------------------------------
+====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/packed_cst.lus
+Opening file should_work/NONREG/packed_cst.lus
+const cst::i = 1;
+const cst::j = 1;
+const cst::k = 1;
+node cst::cst(x:int) returns (y:int);
+var
+   z:int;
+   t:int;
+let
+   z = (i + j);
+   t = (j - k);
+   y = ((x + (2 * z)) + (3 * t));
+tel
+-- end of node cst::cst
+
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/patrick.lus
 Opening file should_work/NONREG/patrick.lus
@@ -2737,6 +2754,22 @@ let
 tel
 -- end of node testCA::testCA
 
+----------------------------------------------------------------------
+====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/test_clash.lus
+Opening file should_work/NONREG/test_clash.lus
+type _test::t = bool;
+const test::c = true;
+node test::tutu(x:bool) returns (y:bool);
+let
+   y = x;
+tel
+-- end of node test::tutu
+node test::toto(x:bool) returns (y:bool);
+let
+   y = ((test::tutu(x)) and c);
+tel
+-- end of node test::toto
+
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/trivial.lus
 Opening file should_work/NONREG/trivial.lus
diff --git a/src/unifyClock.ml b/src/unifyClock.ml
index e62009f3..339d60c5 100644
--- a/src/unifyClock.ml
+++ b/src/unifyClock.ml
@@ -1,16 +1,16 @@
-(** Time-stamp: <modified the 30/06/2008 (at 09:39) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:58) by Erwan Jahier> *)
 
 
 open SyntaxTree
 open SyntaxTreeCore
 open CompiledData
-open CompiledDataDump
+open LicDump
 open Printf
 open Lxm
 open Errors
 
 
-let ci2str = CompiledDataDump.string_of_clock2
+let ci2str = LicDump.string_of_clock2
 
 (* exported *)
 type subst = (Ident.t * Ident.t) list  * (int * clock_eff) list
diff --git a/src/unifyType.ml b/src/unifyType.ml
index aa8708b2..9fac3b4e 100644
--- a/src/unifyType.ml
+++ b/src/unifyType.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 26/06/2008 (at 14:50) by Erwan Jahier> *)
+(** Time-stamp: <modified the 22/07/2008 (at 10:57) by Erwan Jahier> *)
 
 open CompiledData
 
@@ -9,7 +9,7 @@ type t =
   | Unif of type_eff
   | Ko of string (* a msg explaining why the unification failed *)
 
-let teff2str = CompiledDataDump.string_of_type_eff
+let teff2str = LicDump.string_of_type_eff
 
 let (is_overloadable : type_eff -> bool) = function
   | Int_type_eff -> true
@@ -177,7 +177,7 @@ let unit_test () =
     let (tl1, tl2) = gen_unifiable_typeff_of_size (1+ Random.int 10) in
       print_string (
 	" ==> try UnifyType.proposition1 with lists " ^ 
-	  (CompiledDataDump.type_eff_list_to_string tl1) ^ " and " ^ 
-	  (CompiledDataDump.type_eff_list_to_string tl2) ^ "\n");
+	  (LicDump.type_eff_list_to_string tl1) ^ " and " ^ 
+	  (LicDump.type_eff_list_to_string tl2) ^ "\n");
       assert (proposition1 tl1 tl2)
   done
-- 
GitLab