From cb7d354c7009209a0101d8ad0fa07fa43a655e47 Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Thu, 26 Jun 2008 16:25:00 +0200
Subject: [PATCH] Add support for clock checking structure.

---
 src/evalClock.ml      |  17 +-
 src/test/test.res.exp | 395 ++++++++++++++++++++++++++++++++++++++----
 2 files changed, 374 insertions(+), 38 deletions(-)

diff --git a/src/evalClock.ml b/src/evalClock.ml
index 05120596..e611f6fe 100644
--- a/src/evalClock.ml
+++ b/src/evalClock.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 26/06/2008 (at 16:00) by Erwan Jahier> *)
+(** Time-stamp: <modified the 26/06/2008 (at 16:24) by Erwan Jahier> *)
  
   
 open Predef
@@ -352,9 +352,16 @@ and (eval_by_pos_clock : id_solver -> by_pos_op_eff -> Lxm.t -> val_exp_eff list
 and (eval_by_name_clock : id_solver -> by_name_op_eff -> Lxm.t -> 
       (Ident.t Lxm.srcflagged * val_exp_eff) list -> subst -> 
       clock_info list * subst) =
-  fun id_solver namop lxm namargs -> 
+  fun id_solver namop lxm namargs s -> 
     match namop with
-      | STRUCT_anonymous_eff -> assert false (* cf EvalClock.f *)
-      | STRUCT_eff opid -> assert false
-(* 	  [id_solver.id2clock  opid lxm] *)
+      | STRUCT_anonymous_eff -> assert false (* cf EvalType.f *)
+      | STRUCT_eff opid ->
+	  let args = List.map (fun (id,ve) -> ve) namargs in
+	  (* XXX The 3 following lines duplicates the code of TUPLE_eff and co *)
+	  let clk_args, s =  f_list id_solver s args in
+	  let flat_clk_args = List.flatten clk_args in (* => mono-clock! *)
+	  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/test/test.res.exp b/src/test/test.res.exp
index 71417b0c..579b081f 100644
--- a/src/test/test.res.exp
+++ b/src/test/test.res.exp
@@ -2924,9 +2924,17 @@ tel
 ====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/left.lus
 Opening file /home/jahier/lus2lic/src/test/should_work/Pascal/left.lus
 type left::truc = left::truc {a : bool^100; b : int};
-
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
-*** when compiling lustre program should_work/Pascal/left.lus
+node left::toto(x:bool) returns (t:left::truc^3);
+let
+   t[0].a[0..98 step 2][48..0 step -2] = true^25;
+   t[0].a[0..98 step 2][1..49 step 2] = false^25;
+   t[0].a[1..99 step 2][0] = true;
+   t[0].a[1..99 step 2][1] = true;
+   t[0].a[5..99 step 2] = false^48;
+   t[0].b = 42;
+   t[1..2] = truc{a=true^100;b=0}^2;
+tel
+-- end of node left::toto
 
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/newpacks.lus
@@ -2951,8 +2959,26 @@ tel
 -- end of node pint::fby1
 type inter::selType = inter::selType {i : int; b : bool; r : real};
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
-*** when compiling lustre program should_work/Pascal/newpacks.lus
+node inter::preced(
+	in:inter::selType) 
+returns (
+	out:inter::selType;
+	out2:inter::selType);
+let
+   out2 = selType{i=0;b=true;r=.0};
+   out.i = pint::fby1(out2.i, in.i);
+   out.b = pbool::fby1(out2.b, in.b);
+   out.r = preal::fby1(out2.r, in.r);
+tel
+-- end of node inter::preced
+node mainPack::preced(in:inter::selType) returns (out:inter::selType);
+var
+   out2:inter::selType;
+let
+   (out, out2) = inter::preced(in);
+tel
+-- end of node mainPack::preced
+const inter::n = -4;
 
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/onlyroll.lus
@@ -3462,8 +3488,26 @@ tel
 -- end of node pint::fby1
 type inter::selType = inter::selType {i : int; b : bool; r : real};
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
-*** when compiling lustre program should_work/Pascal/p.lus
+node inter::preced(
+	in:inter::selType) 
+returns (
+	out:inter::selType;
+	out2:inter::selType);
+let
+   out2 = selType{i=0;b=true;r=.0};
+   out.i = pint::fby1(out2.i, in.i);
+   out.b = pbool::fby1(out2.b, in.b);
+   out.r = preal::fby1(out2.r, in.r);
+tel
+-- end of node inter::preced
+node mainPack::preced(in:inter::selType) returns (out:inter::selType);
+var
+   out2:inter::selType;
+let
+   (out, out2) = inter::preced(in);
+tel
+-- end of node mainPack::preced
+const inter::n = -4;
 
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/packs.lus
@@ -3496,8 +3540,28 @@ const mainPack::rose;
 const mainPack::X = 8;
 type inter::selType = inter::selType {i : int; b : bool; r : real};
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
-*** when compiling lustre program should_work/Pascal/packs.lus
+node inter::preced(
+	in:inter::selType) 
+returns (
+	out:inter::selType;
+	out2:inter::selType);
+let
+   out2 = selType{i=0;b=true;r=0.0};
+   out.i = pint::fby1(out2.i, in.i);
+   out.b = pbool::fby1(out2.b, in.b);
+   out.r = preal::fby1(out2.r, in.r);
+tel
+-- end of node inter::preced
+node mainPack::preced(in:inter::selType) returns (out:inter::selType);
+var
+   out2:inter::selType;
+let
+   (out, out2) = inter::preced(in);
+tel
+-- end of node mainPack::preced
+type inter::toto = enum {inter::X, inter::Y};
+const inter::X;
+const inter::Y;
 
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/pfs.lus
@@ -3509,9 +3573,11 @@ Opening file /home/jahier/lus2lic/src/test/should_work/Pascal/pfs.lus
 ====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/struct0.lus
 Opening file /home/jahier/lus2lic/src/test/should_work/Pascal/struct0.lus
 type struct0::Toto = struct0::Toto {x : int (1); y : int (2)};
-
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
-*** when compiling lustre program should_work/Pascal/struct0.lus
+node struct0::bibi(dummy:int) returns (z:struct0::Toto);
+let
+   z = Toto{x=3};
+tel
+-- end of node struct0::bibi
 
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/t.lus
@@ -4661,9 +4727,54 @@ type morel4::tube = morel4::tube {in : int; out : int};
 type morel4::toto = morel4::toto {titi : morel4::tube; tutu : bool};
 type morel4::arrayb = bool^3;
 type morel4::arrayi = int^2^3;
+node morel4::mcmorel(i:int) returns (t:int^2);
+var
+   yo:morel4::toto;
+let
+   yo.titi = tube{in=i;out=(i + 1)};
+   yo.tutu = true;
+   t = [yo.titi.in, yo.titi.out] -> [(pre(t[0]) + 1), pre(t[1])];
+tel
+-- end of node morel4::mcmorel
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
-*** when compiling lustre program should_work/fab_test/morel4.lus
+node morel4::tab(
+	b:bool;
+	i:int) 
+returns (
+	b1:bool;
+	b2:bool;
+	b3:bool;
+	i1:int;
+	i2:int;
+	i3:int);
+var
+   tabb:bool^3;
+   tabi:int^2^3;
+let
+   (b1, b2, b3) = (tabb[0], tabb[1], tabb[2]);
+    (i1, i2, i3) = ((tabi[0][0] + tabi[0][1]), (tabi[1][0] + tabi[1][1]),
+	 (tabi[2][0] + tabi[2][1]));
+   tabb[0] = b;
+   tabb[1..2] = [true, false];
+   tabi[2] = morel4::mcmorel(i);
+   tabi[0..1] = [[10, 100], [1000, 10000]];
+tel
+-- end of node morel4::tab
+
+node morel4::morel4(
+	b:bool;
+	i:int) 
+returns (
+	b1:bool;
+	b2:bool;
+	b3:bool;
+	i1:int;
+	i2:int;
+	i3:int);
+let
+   (b1, b2, b3, i1, i2, i3) = morel4::tab(b, i);
+tel
+-- end of node morel4::morel4
 
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --compile-all-items should_work/fab_test/morel5.lus
@@ -4706,9 +4817,16 @@ let
    (b1, b2, b3, i1, i2, i3) = morel5::tab(t, b, i);
 tel
 -- end of node morel5::morel5
-
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
-*** when compiling lustre program should_work/fab_test/morel5.lus
+node morel5::mcmorel(i:int) returns (t:int^2; u:int^2^2);
+var
+   yo:morel5::toto;
+let
+   yo.titi = tube{in=i;out=(i + 1)};
+   yo.tutu = true;
+   t = [yo.titi.in, yo.titi.out] -> [(pre(t[0]) + 1), pre(t[1])];
+   u = [[10, 100], [1000, 10000]];
+tel
+-- end of node morel5::mcmorel
 
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --compile-all-items should_work/fab_test/noAlarm.lus
@@ -5922,7 +6040,19 @@ type produitBool::iteratedStruct = produitBool::iteratedStruct {currentRank : in
 type produitBool::Tacc_inShift2 = produitBool::Tacc_inShift2 {multiplieur : bool^10; rank : int; actual_rank : int};
 type produitBool::Tacc_inShift = produitBool::Tacc_inShift {acc_in_PLC : produitBool::Tacc_in; actual_rank : int};
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node produitBool::iterated_isElementOf_(
+	acc_in:produitBool::T_isElementOf_;
+	elt_in:bool) 
+returns (
+	acc_out:produitBool::T_isElementOf_);
+let
+    acc_out =
+	T_isElementOf_{eltToSearch=acc_in.eltToSearch;iselementof=(acc_in.iselementof
+	 or (acc_in.eltToSearch = elt_in))};
+tel
+-- end of node produitBool::iterated_isElementOf_
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/lionel/ProduitBool/produitBool.lus
 
 ----------------------------------------------------------------------
@@ -5941,7 +6071,20 @@ type shiftFill_ludic::T3_STRUCT = shiftFill_ludic::T3_STRUCT {currentRank : int;
 type shiftFill_ludic::t_iteratedStruct = shiftFill_ludic::T3_STRUCT {currentRank : int; rankToSelect : int; elementSelected : bool};
 const shiftFill_ludic::c_size = 10;
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node shiftFill_ludic::n_selectOneStage(
+	i_acc_in:shiftFill_ludic::T3_STRUCT;
+	i_currentElt:bool) 
+returns (
+	o_acc_out:shiftFill_ludic::T3_STRUCT);
+let
+    o_acc_out = T3_STRUCT{currentRank=(i_acc_in.currentRank +
+	1);rankToSelect=i_acc_in.rankToSelect;elementSelected= if
+	((i_acc_in.currentRank = i_acc_in.rankToSelect)) then (i_currentElt) else
+	 (i_acc_in.elementSelected)};
+tel
+-- end of node shiftFill_ludic::n_selectOneStage
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/lionel/ProduitBool/shiftFill_ludic.lus
 
 ----------------------------------------------------------------------
@@ -5961,7 +6104,20 @@ type shift_ludic::t_Tacc_inShift2 = shift_ludic::T2_STRUCT {multiplieur : bool^1
 type shift_ludic::t_iteratedStruct = shift_ludic::T4_STRUCT {currentRank : int; rankToSelect : int; elementSelected : bool};
 const shift_ludic::c_size = 10;
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node shift_ludic::n_selectOneStage(
+	i_acc_in:shift_ludic::T4_STRUCT;
+	i_currentElt:bool) 
+returns (
+	o_acc_out:shift_ludic::T4_STRUCT);
+let
+    o_acc_out = T4_STRUCT{currentRank=(i_acc_in.currentRank +
+	1);rankToSelect=i_acc_in.rankToSelect;elementSelected= if
+	((i_acc_in.currentRank = i_acc_in.rankToSelect)) then (i_currentElt) else
+	 (i_acc_in.elementSelected)};
+tel
+-- end of node shift_ludic::n_selectOneStage
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/lionel/ProduitBool/shift_ludic.lus
 
 ----------------------------------------------------------------------
@@ -5993,7 +6149,37 @@ type calculs_max::int_arrays = int^10;
 type calculs_max::struct_fill_bool = calculs_max::struct_fill_bool {imax1 : int; imax2 : int; icourant : int};
 type calculs_max::struct_max = calculs_max::struct_max {max1 : int; max2 : int; imax1 : int; imax2 : int; icourant : int};
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node calculs_max::max(
+	strin:calculs_max::struct_max;
+	ecourant:int) 
+returns (
+	strout:calculs_max::struct_max);
+let
+    strout =  if ((ecourant <= strin.max2)) then
+	(struct_max{max1=strin.max1;max2=strin.max2;imax1=strin.imax1;imax2=strin.imax2;icourant=(strin.icourant
+	+ 1)}) else ( if (((ecourant > strin.max2) and (ecourant <= strin.max1)))
+	then
+	(struct_max{max1=strin.max1;max2=ecourant;imax1=strin.imax1;imax2=strin.icourant;icourant=(strin.icourant
+	+ 1)}) else
+	(struct_max{max1=ecourant;max2=strin.max1;imax1=strin.icourant;imax2=strin.imax1;icourant=(strin.icourant
+	 + 1)}));
+tel
+-- end of node calculs_max::max
+
+node calculs_max::fill_bool(
+	s_in:calculs_max::struct_fill_bool) 
+returns (
+	s_out:calculs_max::struct_fill_bool;
+	elt:bool);
+let
+    s_out =
+	struct_fill_bool{imax1=s_in.imax1;imax2=s_in.imax2;icourant=(s_in.icourant
+	 + 1)};
+   elt = ((s_in.icourant = s_in.imax1) or (s_in.icourant = s_in.imax2));
+tel
+-- end of node calculs_max::fill_bool
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/lionel/calculs_max.lus
 
 ----------------------------------------------------------------------
@@ -6003,7 +6189,31 @@ const deSimone::size = 10;
 type deSimone::tabType = bool^10;
 type deSimone::cell_accu = deSimone::cell_accu {token : bool; grant : bool};
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node deSimone::oneCell(
+	accu_in:deSimone::cell_accu;
+	req:bool) 
+returns (
+	accu_out:deSimone::cell_accu;
+	ackout:bool);
+let
+    ackout = (((req and accu_in.token) and accu_in.grant) and not(false ->
+	 pre(ackout)));
+    accu_out = cell_accu{token=accu_in.token;grant=(not(req) and
+	 accu_in.grant)};
+tel
+-- end of node deSimone::oneCell
+
+node deSimone::prop1_iter(
+	accu_in:int;
+	elt_in:bool) 
+returns (
+	accu_out:int);
+let
+   accu_out = (accu_in +  if (elt_in) then (1) else (0));
+tel
+-- end of node deSimone::prop1_iter
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/lionel/deSimone.lus
 
 ----------------------------------------------------------------------
@@ -6092,7 +6302,18 @@ Opening file /home/jahier/lus2lic/src/test/should_work/lionel/moyenne.lus
 type moyenne::moyenne_accu = moyenne::moyenne_accu {sum : real; moyenne : real; rank : real};
 const moyenne::size = 10;
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node moyenne::moyenne_step(
+	accu_in:moyenne::moyenne_accu;
+	elt_in:real) 
+returns (
+	accu_out:moyenne::moyenne_accu);
+let
+    accu_out = moyenne_accu{sum=(accu_in.sum + elt_in);moyenne=((accu_in.sum +
+	 elt_in) / (accu_in.rank + 1.0));rank=(accu_in.rank + 1.0)};
+tel
+-- end of node moyenne::moyenne_step
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/lionel/moyenne.lus
 
 ----------------------------------------------------------------------
@@ -6118,7 +6339,16 @@ const normal::EC_DELESTAGE = 4;
 const normal::EC_ON = 0;
 const normal::COM_ERR = 0;
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node normal::int2InfoChgIndiv(
+	m:int) 
+returns (
+	InfoChgIndiv:normal::T_InfoChgIndiv);
+let
+   InfoChgIndiv = T_InfoChgIndiv{mesure_chg=m};
+tel
+-- end of node normal::int2InfoChgIndiv
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/lionel/normal.lus
 
 ----------------------------------------------------------------------
@@ -6211,7 +6441,16 @@ const testSilus::EC_DELESTAGE = 4;
 const testSilus::EC_ON = 0;
 const testSilus::COM_ERR = 0;
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node testSilus::int2InfoChgIndiv(
+	m:int) 
+returns (
+	InfoChgIndiv:testSilus::T_InfoChgIndiv);
+let
+   InfoChgIndiv = T_InfoChgIndiv{mesure_chg=m};
+tel
+-- end of node testSilus::int2InfoChgIndiv
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/lionel/testSilus.lus
 
 ----------------------------------------------------------------------
@@ -6225,7 +6464,24 @@ type triSel::MinFR_accu = triSel::MinFR_accu {MinVal : int; MinRank : int; RankF
 type triSel::sorted_iter_accu = triSel::sorted_iter_accu {prev_elt : int; prop_is_tt : bool};
 type triSel::Exchange_accu = triSel::Exchange_accu {MinVal : int; MinRank : int; RankFrom : int; CurrentVal : int; Rank : int};
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node triSel::minFromRank(
+	accu_in:triSel::MinFR_accu;
+	TabEltIn:int) 
+returns (
+	accu_out:triSel::MinFR_accu);
+let
+    accu_out = MinFR_accu{MinVal= if (((accu_in.Rank = 0) or (accu_in.Rank =
+	accu_in.RankFrom))) then (TabEltIn) else ( if ((accu_in.Rank >=
+	accu_in.RankFrom)) then ( if ((TabEltIn < accu_in.MinVal)) then (TabEltIn)
+	else (accu_in.MinVal)) else (accu_in.MinVal));MinRank= if (((accu_in.Rank =
+	0) or (accu_in.Rank = accu_in.RankFrom))) then (accu_in.Rank) else ( if
+	((accu_in.Rank >= accu_in.RankFrom)) then ( if ((TabEltIn <
+	accu_in.MinVal)) then (accu_in.Rank) else (accu_in.MinRank)) else
+	 (accu_in.MinRank));RankFrom=accu_in.RankFrom;Rank=(accu_in.Rank + 1)};
+tel
+-- end of node triSel::minFromRank
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/lionel/triSel.lus
 
 ----------------------------------------------------------------------
@@ -6261,7 +6517,20 @@ type contractForElementSelectionInArray::elementType = int;
 type contractForElementSelectionInArray::iteratedStruct = contractForElementSelectionInArray::iteratedStruct {currentRank : int; rankToSelect : int; elementSelected : int};
 const contractForElementSelectionInArray::size = 10;
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node contractForElementSelectionInArray::selectOneStage(
+	acc_in:contractForElementSelectionInArray::iteratedStruct;
+	currentElt:int) 
+returns (
+	acc_out:contractForElementSelectionInArray::iteratedStruct);
+let
+    acc_out = iteratedStruct{currentRank=(acc_in.currentRank +
+	1);rankToSelect=acc_in.rankToSelect;elementSelected= if
+	((acc_in.currentRank = acc_in.rankToSelect)) then (currentElt) else
+	 (acc_in.elementSelected)};
+tel
+-- end of node contractForElementSelectionInArray::selectOneStage
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/packEnvTest/contractForElementSelectionInArray/contractForElementSelectionInArray.lus
 
 ----------------------------------------------------------------------
@@ -6288,7 +6557,19 @@ tel
 -- end of node intArray::_isEqualTo_
 type intArray::T_isElementOf_ = intArray::T_isElementOf_ {eltToSearch : int; iselementof : bool};
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node intArray::iterated_isElementOf_(
+	acc_in:intArray::T_isElementOf_;
+	elt_in:int) 
+returns (
+	acc_out:intArray::T_isElementOf_);
+let
+    acc_out =
+	T_isElementOf_{eltToSearch=acc_in.eltToSearch;iselementof=(acc_in or
+	 intArray::_isEqualTo_(acc_in.eltToSearch, elt_in))};
+tel
+-- end of node intArray::iterated_isElementOf_
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/packEnvTest/contractForElementSelectionInArray/main.lus
 
 ----------------------------------------------------------------------
@@ -6321,7 +6602,22 @@ type tri::MinFR_accu = tri::MinFR_accu {MinVal : int; MinRank : int; RankFrom :
 type tri::sorted_iter_accu = tri::sorted_iter_accu {prev_elt : int; prop_is_tt : bool};
 type tri::Exchange_accu = tri::Exchange_accu {MinVal : int; MinRank : int; RankFrom : int; CurrentVal : int; Rank : int};
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
+node tri::minFromRank(
+	accu_in:tri::MinFR_accu;
+	TabEltIn:int) 
+returns (
+	accu_out:tri::MinFR_accu);
+let
+    accu_out = MinFR_accu{MinVal= if ((accu_in.Rank <= accu_in.RankFrom)) then
+	(TabEltIn) else ( if ((accu_in.Rank >= accu_in.RankFrom)) then ( if
+	((TabEltIn < accu_in.MinVal)) then (TabEltIn) else (accu_in.MinVal)) else
+	(accu_in.MinVal));MinRank= if ((accu_in.Rank > accu_in.RankFrom)) then ( if
+	((TabEltIn < accu_in.MinVal)) then (accu_in.Rank) else (accu_in.MinRank))
+	 else (accu_in.MinRank);RankFrom=accu_in.RankFrom;Rank=(accu_in.Rank + 1)};
+tel
+-- end of node tri::minFromRank
+
+*** oops: an internal error occurred in file evalClock.ml, line 344, column 4
 *** when compiling lustre program should_work/packEnvTest/contractForElementSelectionInArray/tri.lus
 
 ----------------------------------------------------------------------
@@ -6384,8 +6680,26 @@ tel
 -- end of node pint::fby1
 type inter::selType = inter::selType {i : int; b : bool; r : real};
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
-*** when compiling lustre program should_work/packEnvTest/packages.lus
+node inter::preced(
+	in:inter::selType) 
+returns (
+	out:inter::selType;
+	out2:inter::selType);
+let
+   out2 = selType{i=0;b=true;r=0.};
+   out.i = pint::fby1(out2.i, in.i);
+   out.b = pbool::fby1(out2.b, in.b);
+   out.r = preal::fby1(out2.r, in.r);
+tel
+-- end of node inter::preced
+node mainPack::preced(in:inter::selType) returns (out:inter::selType);
+var
+   out2:inter::selType;
+let
+   (out, out2) = inter::preced(in);
+tel
+-- end of node mainPack::preced
+const inter::n = -4;
 
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --compile-all-items should_work/packEnvTest/packages2.lus
@@ -6411,8 +6725,23 @@ tel
 type inter::selType = inter::selType {i : int; b : bool; r : real};
 const inter::n = -4;
 
-*** oops: an internal error occurred in file evalClock.ml, line 358, column 27
-*** when compiling lustre program should_work/packEnvTest/packages2.lus
+node inter::preced(
+	in:inter::selType) 
+returns (
+	out:inter::selType;
+	out2:inter::selType);
+let
+   out2 = selType{i=0;b=true;r=0.};
+   out.i = pint::fby1(out2.i, in.i);
+   out.b = pbool::fby1(out2.b, in.b);
+   out.r = preal::fby1(out2.r, in.r);
+tel
+-- end of node inter::preced
+node main::foo(in:int) returns (out:int);
+let
+   out = in;
+tel
+-- end of node main::foo
 
 ----------------------------------------------------------------------
 ====> ../lus2lic -vl 2 --compile-all-items should_work/to_sort_out/asservi.lus
-- 
GitLab