diff --git a/src/astRecognizePredef.ml b/src/astRecognizePredef.ml index 9f2700a7c9edcb2f90c15659343750e0da998673..320ce70b41a25e3ad7a494cc642eae09077b921f 100644 --- a/src/astRecognizePredef.ml +++ b/src/astRecognizePredef.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 06/02/2013 (at 17:00) by Erwan Jahier> *) +(* Time-stamp: <modified the 16/05/2013 (at 17:39) by Erwan Jahier> *) let (get_predef : Ident.idref -> AstPredef.op option) = @@ -8,7 +8,8 @@ let (get_predef : Ident.idref -> AstPredef.op option) = with Not_found -> None in match Ident.pack_of_idref idref with - | None -> get_op () (* The Lustre package is «use»d by default *) + | None -> None +(* get_op () (* The Lustre package is «use»d by default *) *) | Some p -> if (Ident.pack_name_to_string p) = "Lustre" then get_op () else None open AstV6 diff --git a/src/l2lRmPoly.ml b/src/l2lRmPoly.ml index b0bcb09fa379ab37d92d6bf7cdc1ed87c2c97538..5ef09e223dfa20c0cbbf5e9ec3aca2d9969184f7 100644 --- a/src/l2lRmPoly.ml +++ b/src/l2lRmPoly.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 11/04/2013 (at 17:33) by Erwan Jahier> *) +(* Time-stamp: <modified the 16/05/2013 (at 10:27) by Erwan Jahier> *) (* Source 2 source transformation : @@ -48,7 +48,7 @@ let rec doit (inprg : LicPrg.t) : LicPrg.t = let rec do_node k (ne:Lic.node_exp) = ( if node_is_poly ne then (* pour les noeuds polymorphes/surchagés, on fait rien du tout *) - Verbose.exe (fun() -> Printf.printf + Verbose.exe ~flag:dbg (fun() -> Printf.printf "### Warning: no code generated for polymorphic/overloaded node '%s'\n" (Lic.string_of_node_key ne.node_key_eff)) else diff --git a/src/lic2soc.ml b/src/lic2soc.ml index c0f48d4a23cfbfcb6be902ab119c3223250f60d4..9e33e499efefab92450552d1b059918e36932f13 100644 --- a/src/lic2soc.ml +++ b/src/lic2soc.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 07/05/2013 (at 17:08) by Erwan Jahier> *) +(** Time-stamp: <modified the 16/05/2013 (at 09:15) by Erwan Jahier> *) open Lxm open Lic @@ -639,7 +639,7 @@ let rec f: (LicPrg.t -> Lic.node_key -> Soc.key * Soc.tbl) = match LicPrg.find_node prog nk with | None -> prerr_string ( - "*** "^ (LicDump.string_of_node_key_rec false nk) ^" not defined.\n" ^ + "*** "^ (LicDump.string_of_node_key_rec false nk) ^" not defined (as lic).\n" ^ "*** Defined nodes are:"^ (String.concat ",\n" (List.map (fun (nk,_) -> "\""^LicDump.string_of_node_key_rec false nk^"\"") diff --git a/src/licTab.ml b/src/licTab.ml index d85298febe1605f19b6e7c58d6e3a15890a8eed2..4756e527f1467fb1a83bcb66ffdb79773e14a842 100644 --- a/src/licTab.ml +++ b/src/licTab.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 24/04/2013 (at 17:43) by Erwan Jahier> *) +(* Time-stamp: <modified the 16/05/2013 (at 11:05) by Erwan Jahier> *) open Lxm @@ -56,24 +56,24 @@ let (create : AstTab.t -> t) = (* Iterated operators need to be in this table. Ideally, the lazy compiler should be able to pull such strings though... *) - List.iter - (fun op -> - let op_str = AstPredef.op2string op in - let op_eff = LicEvalType.make_simple_node_exp_eff None op (Lxm.dummy op_str) in - let op_key = AstPredef.op_to_long op, [] in - Hashtbl.add nodes_tbl op_key (Lic.Checked op_eff); - Hashtbl.add prov_nodes_tbl op_key (Lic.Checked op_eff) - ) - AstPredef.iterable_op; - { - src_tab = tbl; - types = Hashtbl.create 0; - consts = Hashtbl.create 0; - nodes = nodes_tbl; - prov_types = Hashtbl.create 0; - prov_consts = Hashtbl.create 0; - prov_nodes = prov_nodes_tbl; - } + List.iter + (fun op -> + let op_str = AstPredef.op2string op in + let op_eff = LicEvalType.make_simple_node_exp_eff None op (Lxm.dummy op_str) in + let op_key = AstPredef.op_to_long op, [] in + Hashtbl.add nodes_tbl op_key (Lic.Checked op_eff); + Hashtbl.add prov_nodes_tbl op_key (Lic.Checked op_eff) + ) + AstPredef.iterable_op; + { + src_tab = tbl; + types = Hashtbl.create 0; + consts = Hashtbl.create 0; + nodes = nodes_tbl; + prov_types = Hashtbl.create 0; + prov_consts = Hashtbl.create 0; + prov_nodes = prov_nodes_tbl; + } (******************************************************************************) @@ -270,11 +270,7 @@ let lookup_node_exp_eff raise Not_found ) -let node_builtin - (this: t) - (key: Lic.node_key) - (lxm: Lxm.t) -: Lic.node_exp = +let node_builtin (this: t) (key: Lic.node_key) (lxm: Lxm.t) : Lic.node_exp = (* 12/07 *) (* ICI => courtcircuite les macros built-in *) let nk2nd = fun nk -> diff --git a/src/unifyType.ml b/src/unifyType.ml index e041e77335a237f28b5e1d1f75224828b439c66f..53bca868be3b60b140a854d7b00bf879ea7c7be5 100644 --- a/src/unifyType.ml +++ b/src/unifyType.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 11/04/2013 (at 17:31) by Erwan Jahier> *) +(* Time-stamp: <modified the 17/05/2013 (at 10:56) by Erwan Jahier> *) (* 12/07. Premier pas vers une méthode un peu plus standard : @@ -103,14 +103,17 @@ let f (l1: Lic.type_ list) (l2: Lic.type_ list): t = Ko("\n*** " ^ (teff2str t1) ^ " and " ^ (teff2str t2) ^ " are not unifiable") in + Verbose.printf ~flag:dbg + "#DBG: UnifyType.f (%s) with (%s) \n" + (Lic.string_of_type_list l1) + (Lic.string_of_type_list l2); assert (List.length l1 = List.length l2); let res = List.fold_left2 unify_do_acc Equal l1 l2 in Verbose.printf ~flag:dbg "#DBG: UnifyType.f (%s) with (%s) gives %s\n" (Lic.string_of_type_list l1) (Lic.string_of_type_list l2) - (string_of_t res) - ; + (string_of_t res); res (****** MATCH ASSYMETRIQUE diff --git a/test/lus2lic.sum b/test/lus2lic.sum index 745893f591ef179e02a526ed669f4701b49ac237..4719f6d5406b11bee3e7050d2f8d9ad8eb684830 100644 --- a/test/lus2lic.sum +++ b/test/lus2lic.sum @@ -1,4 +1,4 @@ -Test Run By jahier on Wed May 15 16:55:23 2013 +Test Run By jahier on Fri May 17 11:06:34 2013 Native configuration is i686-pc-linux-gnu === lus2lic tests === @@ -147,7 +147,6 @@ PASS: ./ec2c {-o /tmp/predefOp.c /tmp/predefOp.ec} FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/predefOp.lus FAIL: without any option: ./lus2lic {-o /tmp/t1.lic should_work/t1.lus} FAIL: Generate ec code : ./lus2lic {-ec -o /tmp/t1.ec should_work/t1.lus} -FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/t1.lus PASS: ./lus2lic {-o /tmp/nc9.lic should_work/nc9.lus} PASS: ./lus2lic {-ec -o /tmp/nc9.ec should_work/nc9.lus} PASS: ./ec2c {-o /tmp/nc9.c /tmp/nc9.ec} @@ -412,7 +411,7 @@ PASS: ../utils/test_lus2lic_no_node should_work/produitBool.lus PASS: ./lus2lic {-o /tmp/noeudsIndependants.lic should_work/noeudsIndependants.lus} PASS: ./lus2lic {-ec -o /tmp/noeudsIndependants.ec should_work/noeudsIndependants.lus} PASS: ./ec2c {-o /tmp/noeudsIndependants.c /tmp/noeudsIndependants.ec} -FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/noeudsIndependants.lus +PASS: ../utils/test_lus2lic_no_node should_work/noeudsIndependants.lus PASS: ./lus2lic {-o /tmp/mouse.lic should_work/mouse.lus} PASS: ./lus2lic {-ec -o /tmp/mouse.ec should_work/mouse.lus} PASS: ./ec2c {-o /tmp/mouse.c /tmp/mouse.ec} @@ -513,7 +512,6 @@ PASS: ../utils/test_lus2lic_no_node should_work/carV2.lus PASS: ./lus2lic {-o /tmp/test_merge.lic should_work/test_merge.lus} PASS: ./lus2lic {-ec -o /tmp/test_merge.ec should_work/test_merge.lus} FAIL: Try ec2c on the result: ./ec2c {-o /tmp/test_merge.c /tmp/test_merge.ec} -FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/test_merge.lus PASS: ./lus2lic {-o /tmp/FillFollowedByRed.lic should_work/FillFollowedByRed.lus} PASS: ./lus2lic {-ec -o /tmp/FillFollowedByRed.ec should_work/FillFollowedByRed.lus} PASS: ./ec2c {-o /tmp/FillFollowedByRed.c /tmp/FillFollowedByRed.ec} @@ -607,7 +605,7 @@ FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node shou PASS: ./lus2lic {-o /tmp/ply01.lic should_work/ply01.lus} PASS: ./lus2lic {-ec -o /tmp/ply01.ec should_work/ply01.lus} PASS: ./ec2c {-o /tmp/ply01.c /tmp/ply01.ec} -FAIL: Try to compare lus2lic -exec and ecexe: ../utils/test_lus2lic_no_node should_work/ply01.lus +PASS: ../utils/test_lus2lic_no_node should_work/ply01.lus PASS: ./lus2lic {-o /tmp/consensus.lic should_work/consensus.lus} PASS: ./lus2lic {-ec -o /tmp/consensus.ec should_work/consensus.lus} PASS: ./ec2c {-o /tmp/consensus.c /tmp/consensus.ec} @@ -1041,8 +1039,8 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman === lus2lic Summary === -# of expected passes 871 -# of unexpected failures 88 +# of expected passes 873 +# of unexpected failures 84 # of unexpected successes 12 # of expected failures 37 # of unresolved testcases 21 diff --git a/test/should_work/mapinf.lus b/test/should_work/mapinf.lus index 0ce249e0bb73340ff9cf5e90c2ba6e8d6971465a..13c78e35f33fad2c7ad84ee2b64b9459f9ca1412 100644 --- a/test/should_work/mapinf.lus +++ b/test/should_work/mapinf.lus @@ -1,4 +1,4 @@ node mapinf (t1, t2: int^10) returns (res : bool^10); let - res = map<< lt, 10>>(t1, t2); + res = map<< Lustre::lt, 10>>(t1, t2); tel diff --git a/test/should_work/matrice.lus b/test/should_work/matrice.lus index 691f609620ec0c25b41eac6ad417003dc2e99ebb..5f077c5a02d67612d47d0c89d583123e43d73816 100644 --- a/test/should_work/matrice.lus +++ b/test/should_work/matrice.lus @@ -12,7 +12,7 @@ tel node matrice ( a : int ) returns ( sum: int; bid: T_fibo; T: int^m^n); let bid, T = fill << fill << fibo ; m >> ; n >> ([a, a]); - sum = red << red <<node plus ; m >> ; n >> (0, T); + sum = red << red <<node Lustre::plus ; m >> ; n >> (0, T); tel diff --git a/test/should_work/ply01.lus b/test/should_work/ply01.lus index 5457351bff2353f1d7d8f26c2d9ac41a3723ed58..6a2f11cf885b44c5ceb1e83a9bcdcd30b88eef4f 100644 --- a/test/should_work/ply01.lus +++ b/test/should_work/ply01.lus @@ -1,9 +1,9 @@ -(* ne passe pas DoNotPoly ... *) +(* ne passe pas DoNotPoly... Normal. *) node truc = map<<+,42>>; (* PASSE DoNotPoly ... *) node trac = map<<Lustre::iplus,42>>; (* ne passe pas DoNotPoly ... *) -node ply01 = truc; +node ply01 = trac; diff --git a/test/should_work/yyy.lus b/test/should_work/yyy.lus index da36177c8f769ec34b78539c0d8f5def9455c876..fde12bb0bb16c51897da1cb8a54c7ef1c2c5fa54 100644 --- a/test/should_work/yyy.lus +++ b/test/should_work/yyy.lus @@ -1,2 +1,3 @@ -node yyy = red<< iplus, 2>> + +node yyy = red<< Lustre::iplus, 2>> diff --git a/todo.org b/todo.org index af56ec6d7614cda0c1d0d9c144956f9da57c9b9e..1ff8abc729b140e68023566189a0e75fa612d668 100644 --- a/todo.org +++ b/todo.org @@ -3,14 +3,6 @@ * lus2lic -exec - -** TODO oops: lus2lic internal error - - State "TODO" from "" [2013-05-14 Tue 14:35] - File "objlinux/lic2soc.ml", line 648, column 14 - -./lus2lic should_work/noeudsIndependants.lus -n noeudsIndependants --gen-autotest -np -../utils/test_lus2lic_no_node should_work/ply01.lus - ** TODO oops: lus2lic internal error - State "TODO" from "" [2013-05-10 Fri 17:46] File "objlinux/lic2soc.ml", line 680, column 18 diff --git a/todo.org_archive b/todo.org_archive index 599aea97e6e17968671570a028933f4d103a6041..b369cf7ff72272cb83fa6178cdf41c64b59c20cb 100644 --- a/todo.org_archive +++ b/todo.org_archive @@ -717,6 +717,30 @@ Reste à l'integrer dans file:test/lus2lic.tests/non-reg.exp :END: ../utils/test_lus2lic_no_node should_work/is_stable.lus +* TODO oops: lus2lic internal error + - State "TODO" from "" [2013-05-14 Tue 14:35] + :PROPERTIES: + :ARCHIVE_TIME: 2013-05-16 Thu 13:50 + :ARCHIVE_FILE: ~/lus2lic/todo.org + :ARCHIVE_OLPATH: lus2lic -exec + :ARCHIVE_CATEGORY: lv6 + :ARCHIVE_TODO: TODO + :END: + File "objlinux/lic2soc.ml", line 648, column 14 + +./lus2lic should_work/noeudsIndependants.lus -n noeudsIndependants --gen-autotest -np + +C'est parce que il y a un clash avec Lustre::gt qui est polymorphe, +et donc l'alias vers gt ne genere pas de code... + +Il faudrait vraiment que je trouve un moyen de ne pas remplir les tables avec +le contenu du module Lustre de facon strict (ie, le faire lazy !!) + +cf file:src/licTab.ml::68 + +Bon, finalement, j'oblige les gens a ecrire Lustre::gt et puis ca marre. + +