From b3051f50f5c4314e1bada958f1f17ddcd8509e77 Mon Sep 17 00:00:00 2001 From: Erwan Jahier <jahier@imag.fr> Date: Mon, 26 May 2008 15:19:37 +0200 Subject: [PATCH] * mapred -> fillred --- src/TODO | 2 -- src/getEff.ml | 4 +-- src/predef.ml | 8 +++--- src/predefSemantics.ml | 12 ++++---- src/test/should_work/NONREG/Int.lus | 6 ++-- src/test/should_work/demo/Gyroscope2.lus | 10 +++---- src/test/should_work/demo/map_red_iter.lus | 2 +- src/test/should_work/fab_test/iter.lus | 2 +- src/test/should_work/fab_test/iterate.lus | 10 +++---- src/test/should_work/lionel/arrays.lus | 10 +++---- src/test/should_work/lionel/deSimone.lus | 2 +- src/test/should_work/lionel/normal.lus | 2 +- src/test/should_work/lionel/pipeline.lus | 4 +-- src/test/should_work/lionel/testSilus.lus | 2 +- src/test/should_work/lionel/triSel.lus | 2 +- .../tri.lus | 2 +- src/test/test.res.exp | 28 +++++++++---------- 17 files changed, 53 insertions(+), 55 deletions(-) diff --git a/src/TODO b/src/TODO index 53e6ece2..082dc741 100644 --- a/src/TODO +++ b/src/TODO @@ -109,8 +109,6 @@ lazycompiler.ml: *** facile -* mapred -> fillred - * les function type_error des predefSemantics devraient être definies ailleurs * essayer de faire qque chose pour les 2 verrues dans predefSemantics diff --git a/src/getEff.ml b/src/getEff.ml index dc1c1b16..f4089829 100644 --- a/src/getEff.ml +++ b/src/getEff.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 26/05/2008 (at 11:37) by Erwan Jahier> *) +(** Time-stamp: <modified the 26/05/2008 (at 15:09) by Erwan Jahier> *) open Lxm @@ -280,7 +280,7 @@ and (translate_by_pos_op : id_solver -> by_pos_op -> Lxm.t -> val_exp list -> | Predef(Map, _) | Predef(Fill, _) | Predef(Red, _) - | Predef(MapRed, _) + | Predef(FillRed, _) | Predef(BoolRed, _) -> translate_iteror id_solver by_pos_op lxm (* other predef operators *) diff --git a/src/predef.ml b/src/predef.ml index a67e4afe..8e5a6c62 100644 --- a/src/predef.ml +++ b/src/predef.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 26/05/2008 (at 11:32) by Erwan Jahier> *) +(** Time-stamp: <modified the 26/05/2008 (at 15:09) by Erwan Jahier> *) @@ -55,7 +55,7 @@ type op = | Map | Fill | Red - | MapRed + | FillRed | BoolRed let op2string = function @@ -99,7 +99,7 @@ let op2string = function | Map -> "map" | Fill -> "fill" | Red -> "red" - | MapRed -> "mapred" + | FillRed -> "fillred" | BoolRed -> "boolred" let is_infix = function @@ -163,7 +163,7 @@ let (string_to_op : string -> op) = | "map" -> Map | "fill" -> Fill | "red" -> Red - | "mapred" -> MapRed + | "fillred" -> FillRed | "boolred" -> BoolRed | _ -> raise Not_found diff --git a/src/predefSemantics.ml b/src/predefSemantics.ml index 4a8aa868..5c90a2ec 100644 --- a/src/predefSemantics.ml +++ b/src/predefSemantics.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 26/05/2008 (at 14:56) by Erwan Jahier> *) +(** Time-stamp: <modified the 26/05/2008 (at 15:09) by Erwan Jahier> *) open Predef @@ -204,7 +204,7 @@ let map_profile = (lti, lto) -let mapred_profile = (* vraiment, il devrait s'appeler fillred cet operateur... *) +let fillred_profile = (* Given - a node n of type tau * tau_1 * ... * tau_n -> tau * teta_1 * ... * teta_l - a constant c (nb : sargs = [n,c]) @@ -229,14 +229,14 @@ let mapred_profile = (* vraiment, il devrait s'appeler fillred cet operateur... (CompiledDataDump.string_of_var_type t1) ^ " should be equal to " ^ (CompiledDataDump.string_of_var_type t2) ^ "\n")) -(* let fill_profile = mapred_profile (* la preuve que mapred -> fillred !! *) *) +(* let fill_profile = fillred_profile *) (* Given - a node N of type tau -> tau * teta_1 * ... * teta_l - a constant c (nb : sargs = [N,c]) returns the profile: [tau -> tau * teta_1^c * ... * teta_l^c] *) -(* let red_profile = mapred_profile *) +(* let red_profile = fillpred_profile *) (* Given - a node N of type tau * tau_1 * ... * tau_n -> tau - a constant c (nb : sargs = [N,c]) @@ -283,7 +283,7 @@ let (op2profile : Predef.op -> Lxm.t -> static_arg_eff list -> node_profile) = | MINUS_n | PLUS_n | TIMES_n | SLASH_n -> ooo_profile | RMINUS_n | RPLUS_n | RTIMES_n | RSLASH_n -> rrr_profile | DIV_n | MOD_n | IMINUS_n | IPLUS_n | ISLASH_n | ITIMES_n -> iii_profile - | Red | Fill | MapRed -> mapred_profile lxm sargs + | Red | Fill | FillRed -> fillred_profile lxm sargs | Map -> map_profile lxm sargs | BoolRed -> boolred_profile lxm sargs @@ -492,7 +492,7 @@ let (const_eval: op -> Lxm.t -> static_arg_eff list -> const_evaluator) = | Map -> assert false | Fill -> assert false | Red -> assert false - | MapRed -> assert false + | FillRed -> assert false | BoolRed -> boolred_evaluator 1 ll (*********************************************************************************) diff --git a/src/test/should_work/NONREG/Int.lus b/src/test/should_work/NONREG/Int.lus index b287dd42..40de251a 100644 --- a/src/test/should_work/NONREG/Int.lus +++ b/src/test/should_work/NONREG/Int.lus @@ -12,9 +12,9 @@ model Int type Int = bool^n; const zero = false^n; function incr (x: Int) returns (incr: Int); - var co: bool; + var co: bool; let - (co, incr) = mapred<<fulladd,n>>(true,x,zero); + (co, incr) = fillred<<fulladd,n>>(true,x,zero); tel function fulladd(ci, x, y: bool) returns (s, co: bool); @@ -26,7 +26,7 @@ model Int function add (x,y: Int) returns (sum: Int); var co: bool; let - (co, sum) = mapred<<fulladd,n>>(false,x,y); + (co, sum) = fillred<<fulladd,n>>(false,x,y); tel end diff --git a/src/test/should_work/demo/Gyroscope2.lus b/src/test/should_work/demo/Gyroscope2.lus index aa168175..93dbe37b 100644 --- a/src/test/should_work/demo/Gyroscope2.lus +++ b/src/test/should_work/demo/Gyroscope2.lus @@ -141,7 +141,7 @@ node addOneChannel(indx_toChange : int; channeltToAdd : Valid_ChannelT; tabToFil -- Body : var acc_out : CFF_Eltstruct; let - acc_out,tabToFillAfter = mapred<<addOneChannelIter;3>>({ indx = 0, indx_toChange = indx_toChange, + acc_out,tabToFillAfter = fillred<<addOneChannelIter;3>>({ indx = 0, indx_toChange = indx_toChange, value = channeltToAdd }, tabToFill); tel @@ -207,7 +207,7 @@ node values_nok(localChannel : Valid_ChannelT; foreign_Channels : Valid_ChannelT -- Body : var diff : bool^3; lc : Valid_ChannelT; let - lc,diff = mapred<<compare_rolls;3>>(localChannel, + lc,diff = fillred<<compare_rolls;3>>(localChannel, foreign_Channels); cross_failure = if(selectFailure(foreign_Channels[0])) then if(selectFailure(foreign_Channels[1])) @@ -313,13 +313,13 @@ node EvaluateAxis(channels : Faulty_ChannelT^4; delta : real; god : real; delta_ -- Guarantees : -- (abs((AxisValue - god)) < delta_to_god); -- Body : - var resChannels : Valid_ChannelT^4; dumbChannel : Valid_ChannelT^4; initChannels : Valid_ChannelT^4; mapredInit : Valid_ChannelT^4; + var resChannels : Valid_ChannelT^4; dumbChannel : Valid_ChannelT^4; initChannels : Valid_ChannelT^4; fillredInit : Valid_ChannelT^4; let initChannels = {local_failure = false, local_value = 0.0}^4; - dumbChannel,resChannels = mapred<<Channel;4>>(mapredInit,[0,1,2,3],channels,delta^4,god^4,delta_to_god^4); + dumbChannel,resChannels = fillred<<Channel;4>>(fillredInit,[0,1,2,3],channels,delta^4,god^4,delta_to_god^4); AxisValue = Voter(resChannels, god, delta_to_god); - mapredInit = (initChannels -> pre(resChannels)); + fillredInit = (initChannels -> pre(resChannels)); tel diff --git a/src/test/should_work/demo/map_red_iter.lus b/src/test/should_work/demo/map_red_iter.lus index 91dd3428..4a78e2fb 100644 --- a/src/test/should_work/demo/map_red_iter.lus +++ b/src/test/should_work/demo/map_red_iter.lus @@ -61,5 +61,5 @@ node map_red_iter (indice_gen : int ; returns (TabComChg : T_ComChg^NBC); var bidon : int; let - bidon, TabComChg = mapred<<traite_genCore_itere, NBC>>(indice_gen, TabComVal, InfoGenGlob.chg2gen); + bidon, TabComChg = fillred<<traite_genCore_itere, NBC>>(indice_gen, TabComVal, InfoGenGlob.chg2gen); tel diff --git a/src/test/should_work/fab_test/iter.lus b/src/test/should_work/fab_test/iter.lus index d4aab6bd..c1412fde 100644 --- a/src/test/should_work/fab_test/iter.lus +++ b/src/test/should_work/fab_test/iter.lus @@ -9,7 +9,7 @@ let Tab_out = map<<mapped,n>>(T_inter); Red_plus = red<<plus,n>>(-100, Tab_out); - zorroAcc, zorroTab = mapred<<garcia,5>>(0,[0,0,0,0,0]); + zorroAcc, zorroTab = fillred<<garcia,5>>(0,[0,0,0,0,0]); tel node filled(accu_in : int) returns (accu_out : int ; elt : int); diff --git a/src/test/should_work/fab_test/iterate.lus b/src/test/should_work/fab_test/iterate.lus index 0611fece..d10c90f7 100644 --- a/src/test/should_work/fab_test/iterate.lus +++ b/src/test/should_work/fab_test/iterate.lus @@ -5,16 +5,16 @@ returns ( out_map2 : int^10; out_red1 : int; out_fill1, out_fill2 : int^10; - out_mapred1 : int; - out_mapred2, out_mapred3 : int^10); + out_fillred1 : int; + out_fillred2, out_fillred3 : int^10); var bidon : int; let out_map1, out_map2 = map<<mapped;10>>(IN1, IN2); -- Copie a l'identique les entrees dans les sorties out_red1 = red<<redduced;10>>(0, IN1, IN2); -- permet de calculer la somme des elements des 2 tableaux d'entree bidon, out_fill1, out_fill2 = fill<<filled;10>>(0); -- construit [0, 1, 2, ... , 9] et [0, 2, 4, ... , 18] - out_mapred1, out_mapred2, out_mapred3, OUT = - mapred<<map_redduced;10>>(0, IN1, IN2); + out_fillred1, out_fillred2, out_fillred3, OUT = + fillred<<fill_redduced;10>>(0, IN1, IN2); tel @@ -40,7 +40,7 @@ let elt_out2 = accu_in * 2; tel -node map_redduced(accu_in : int ; elt_in1, elt_in2 : int) returns (accu_out : int; elt_out1, elt_out2, elt_out3 : int); +node fill_redduced(accu_in : int ; elt_in1, elt_in2 : int) returns (accu_out : int; elt_out1, elt_out2, elt_out3 : int); let accu_out = accu_in + 1; elt_out1 = elt_in1; diff --git a/src/test/should_work/lionel/arrays.lus b/src/test/should_work/lionel/arrays.lus index a0269f8f..dcbe0f7c 100644 --- a/src/test/should_work/lionel/arrays.lus +++ b/src/test/should_work/lionel/arrays.lus @@ -61,26 +61,26 @@ tel node add_byte(x, y : byte) returns (s : byte); var co : bool; let - co, s = mapred<<full_adder; n>>(false, x, y); + co, s = fillred<<full_adder; n>>(false, x, y); tel node add_long (x, y : long) returns ( s : long); var co : bool; let - co, s = mapred<<mapred<<mapred<<full_adder; n>>; m>>; p>>(false, x, y); + co, s = fillred<<fillred<<fillred<<full_adder; n>>; m>>; p>>(false, x, y); tel ----------- un noeud principale pour tester le tout ---------------------- type tab3d = int^n^m^p; node arrays( init_incr: int; init_long: long ) - returns ( ok: bool; red_res : int; mapred_res : long ); + returns ( ok: bool; red_res : int; fillred_res : long ); var fill_res : tab3d; let red_res = big_sum(fill_res); fill_res = big_incr(init_incr); - mapred_res = init_long -> add_long(init_long, pre mapred_res); - ok = false -> big_xor( mapred_res ); + fillred_res = init_long -> add_long(init_long, pre fillred_res); + ok = false -> big_xor( fillred_res ); tel diff --git a/src/test/should_work/lionel/deSimone.lus b/src/test/should_work/lionel/deSimone.lus index 54fc3308..f677b55d 100644 --- a/src/test/should_work/lionel/deSimone.lus +++ b/src/test/should_work/lionel/deSimone.lus @@ -35,7 +35,7 @@ node deSimone(new_token : bool ; request : tabType) returns (acknowledge : tabType); var accu_out : cell_accu; let - accu_out, acknowledge = mapred<<oneCell, size>>({token = new_token; + accu_out, acknowledge = fillred<<oneCell, size>>({token = new_token; grant = true}, request); tel diff --git a/src/test/should_work/lionel/normal.lus b/src/test/should_work/lionel/normal.lus index a3d5a6f1..caf37e27 100644 --- a/src/test/should_work/lionel/normal.lus +++ b/src/test/should_work/lionel/normal.lus @@ -271,7 +271,7 @@ node traite_gen_core (indice_gen : int ; returns (TabComChg : T_ComChg^NBC); var bidon : int; let - bidon, TabComChg = mapred<<traite_genCore_itere;NBC>>(indice_gen, TabComVal, InfoGenGlob.chg2gen); + bidon, TabComChg = fillred<<traite_genCore_itere;NBC>>(indice_gen, TabComVal, InfoGenGlob.chg2gen); tel diff --git a/src/test/should_work/lionel/pipeline.lus b/src/test/should_work/lionel/pipeline.lus index 9c2e88b8..1c7f116f 100644 --- a/src/test/should_work/lionel/pipeline.lus +++ b/src/test/should_work/lionel/pipeline.lus @@ -27,8 +27,8 @@ node pipeline(in : bool^size) var accu_out : bool; --var_inter : bool; let - accu_out, out = mapred<<oneStep_pipe;size>>(true->pre(accu_out), in); + accu_out, out = fillred<<oneStep_pipe;size>>(true->pre(accu_out), in); -- var_inter = true -> pre(accu_out); --- accu_out, out = mapred<<oneStep_pipe;size>>(var_inter, in); +-- accu_out, out = fillred<<oneStep_pipe;size>>(var_inter, in); tel ---- diff --git a/src/test/should_work/lionel/testSilus.lus b/src/test/should_work/lionel/testSilus.lus index 1da03b49..ae7cad1f 100644 --- a/src/test/should_work/lionel/testSilus.lus +++ b/src/test/should_work/lionel/testSilus.lus @@ -256,7 +256,7 @@ node traite_gen_core (indice_gen : int ; -- OK returns (TabComChg : T_ComChg^NBC); var bidon : int; let - bidon, TabComChg = mapred<<traite_genCore_itere;NBC>>(indice_gen, TabComVal, InfoGenGlob.chg2gen); + bidon, TabComChg = fillred<<traite_genCore_itere;NBC>>(indice_gen, TabComVal, InfoGenGlob.chg2gen); tel diff --git a/src/test/should_work/lionel/triSel.lus b/src/test/should_work/lionel/triSel.lus index 55d309bd..2ad271f2 100644 --- a/src/test/should_work/lionel/triSel.lus +++ b/src/test/should_work/lionel/triSel.lus @@ -110,7 +110,7 @@ let ------------------------------------------------------------------------ -- Exchange the two elements 'current' and 'minimum from current rank' - accu_out_exchange, localTab = mapred<<Exchange_i_j;size>>( + accu_out_exchange, localTab = fillred<<Exchange_i_j;size>>( { MinVal = accu_out_min.MinVal; MinRank = accu_out_min.MinRank; RankFrom = accu_out_select.RankToFind; diff --git a/src/test/should_work/packEnvTest/contractForElementSelectionInArray/tri.lus b/src/test/should_work/packEnvTest/contractForElementSelectionInArray/tri.lus index c9bb4ed1..60985893 100644 --- a/src/test/should_work/packEnvTest/contractForElementSelectionInArray/tri.lus +++ b/src/test/should_work/packEnvTest/contractForElementSelectionInArray/tri.lus @@ -88,7 +88,7 @@ let -- puis j'échange le minimum trouvé et l'élement de rang courant -- (courant dans l'itération de UnarySort) - accu_out_exchange, localTab = mapred<<Exchange_i_j, size>>( + accu_out_exchange, localTab = fillred<<Exchange_i_j, size>>( Exchange_accu{MinVal = accu_out_min.MinVal; MinRank = accu_out_min.MinRank; RankFrom = accu_out_select.RankToFind; diff --git a/src/test/test.res.exp b/src/test/test.res.exp index 58d8d85b..2e87ab39 100644 --- a/src/test/test.res.exp +++ b/src/test/test.res.exp @@ -83,14 +83,14 @@ function Int8__incr(x:bool^8) returns (incr:bool^8); var co:bool; let - (co, incr) = mapred<<node Int8__fulladd, const 8>>(true, x, zero); + (co, incr) = fillred<<node Int8__fulladd, const 8>>(true, x, zero); tel -- end of node Int8__incr function Int8__add(x:bool^8; y:bool^8) returns (sum:bool^8); var co:bool; let - (co, sum) = mapred<<node Int8__fulladd, const 8>>(false, x, y); + (co, sum) = fillred<<node Int8__fulladd, const 8>>(false, x, y); tel -- end of node Int8__add * package mainPack @@ -7105,7 +7105,7 @@ returns ( var bidon:int; let - (bidon, TabComChg) = mapred<<node map_red_iter__traite_genCore_itere, + (bidon, TabComChg) = fillred<<node map_red_iter__traite_genCore_itere, const 20>>(indice_gen, TabComVal, InfoGenGlob.chg2gen); tel -- end of node map_red_iter__map_red_iter @@ -7602,7 +7602,7 @@ let (bidon, T_inter) = fill<<node iter__filled, const 5>>(init); Tab_out = map<<node iter__mapped, const 5>>(T_inter); Red_plus = red(-(100), Tab_out); - (zorroAcc, zorroTab) = mapred(0, [0, 0, 0, 0, 0]); + (zorroAcc, zorroTab) = fillred(0, [0, 0, 0, 0, 0]); tel -- end of node iter__iter @@ -7616,7 +7616,7 @@ Opening file should_work/fab_test/iterate.lus export node iterate export node filled export node mapped - export node map_redduced + export node fill_redduced *** SyntaxTab.create pass 3 init symbol tables for pack iterate *** SyntaxTab.create done @@ -7671,7 +7671,7 @@ let tel -- end of node iterate__filled -node iterate__map_redduced( +node iterate__fill_redduced( accu_in:int; elt_in1:int; elt_in2:int) @@ -7686,7 +7686,7 @@ let elt_out2 = elt_in2; elt_out3 = (elt_in1 + elt_in2); tel --- end of node iterate__map_redduced +-- end of node iterate__fill_redduced node iterate__iterate( IN1:int^10; @@ -7698,17 +7698,17 @@ returns ( out_red1:int; out_fill1:int^10; out_fill2:int^10; - out_mapred1:int; - out_mapred2:int^10; - out_mapred3:int^10); + out_fillred1:int; + out_fillred2:int^10; + out_fillred3:int^10); var bidon:int; let (out_map1, out_map2) = map(IN1, IN2); out_red1 = red<<node iterate__redduced, const 10>>(0, IN1, IN2); (bidon, out_fill1, out_fill2) = fill<<node iterate__filled, const 10>>(0); - (out_mapred1, out_mapred2, out_mapred3, OUT) = mapred<<node - iterate__map_redduced, const 10>>(0, IN1, IN2); + (out_fillred1, out_fillred2, out_fillred3, OUT) = fillred<<node + iterate__fill_redduced, const 10>>(0, IN1, IN2); tel -- end of node iterate__iterate @@ -10285,7 +10285,7 @@ node pipeline__pipeline(in:bool^10) returns (out:bool^10); var accu_out:bool; let - (accu_out, out) = mapred(true -> pre(accu_out), in); + (accu_out, out) = fillred(true -> pre(accu_out), in); tel -- end of node pipeline__pipeline @@ -10654,7 +10654,7 @@ var let accu_out_min = red(xxx todo , accu_in.Tab); accu_out_select = red(xxx todo , accu_in.Tab); - (accu_out_exchange, localTab) = mapred(xxx todo , accu_in.Tab); + (accu_out_exchange, localTab) = fillred(xxx todo , accu_in.Tab); accu_out = xxx todo ; tel -- end of node tri__UnarySort -- GitLab