diff --git a/lv6-ref-man/lv6-ref-man.tex b/lv6-ref-man/lv6-ref-man.tex index 4eeef6609d4deb1fe5fef259a07facd27fa9a8d6..e403fd9c9ad39f653f090dff4b6c892b1212428a 100644 --- a/lv6-ref-man/lv6-ref-man.tex +++ b/lv6-ref-man/lv6-ref-man.tex @@ -1710,7 +1710,7 @@ functions. \kwd{package} pack \kwd{uses} pack1, pack2; \kwd{provides} - \kwd{type} pi,e:real; + \kwd{const} pi,e:real; \kwd{type} t1,t2; \kwd{function} cos(x:real) returns (y:real); \kwd{node} rising\_edge(x:bool) returns (re:bool); diff --git a/src/Makefile b/src/Makefile index 5b37005edb03873edb257ce7e1c32c0c50eaef7f..327b55f316ac8543215ae0532854814c0facc5e0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -62,18 +62,27 @@ SOURCES = \ ./main.ml endif +# Be sure to build those files before doing something else +# since they are needed by $(RESULT) +PRE_TARGETS=./version.ml + MLONLY_SOURCES=$(filter %.ml %.mll %.mly, $(SOURCES)) +all: + make bc + ##############################################################################" # searching for untested code -test/ocamlprof.dump: pbc test +test/ocamlprof.dump: pbc prof: test/ocamlprof.dump + make test || true mkdir prof || rm prof/* for d in ${SOURCES}; do \ ocamlprof -F "ocamlprof: " -f test/ocamlprof.dump $$d > prof/$$d ;\ done -grep: +# Upsate the test coverage rate +coverage: rm test/ocamlprof.dump || true make clean make prof @@ -83,14 +92,13 @@ grep: ALL_HITS=`wc -l all.grep | cut -f 1 -d " "`;\ SOL=`echo "scale=2 ; $$DEAD_HITS * 100 / $$ALL_HITS " | bc ` ;\ echo "$$DEAD_HITS / $$ALL_HITS = $$SOL %" > untested_line_counter + make clean cat untested_line_counter ##############################################################################" -all: version.ml - make bc # for using the debugger -debug: version.ml +debug: mkdir -p mli mv *.mli mli/ make MLONLY=yes SOURCES="$(MLONLY_SOURCES)" dc || true diff --git a/src/TODO b/src/TODO index dcf91dff703381809e1ffdd434d983966431d5c6..9a3011f7e46a8f7150cf4aa70d40b08f70ea7a11 100644 --- a/src/TODO +++ b/src/TODO @@ -1,12 +1,7 @@ *** questions externes +====================== -* quid de la syntaxe des horloges enumérées ? la syntaxe de Marc a un - pb : quand j'ecris "type bla = enum {Titi,Toto}" puis "c when - Toto(x)", il rale car il ne connait pas le noeud Toto... - - -> faire comme dans lic : ne pas accepter toutes les expressions - apres un when. * dans le generateur de lic, comment imprimer le nom des packages ? - Pack::toto -> pas du vieux lustre (donc pas reentrant) @@ -14,13 +9,51 @@ - _Pack__toto -> pas beau, rend lus2lic pas idempotent -* instanciation de package <<locaux>> à d'autre package interdite -pour l'instant, alors que ca marchait chez Youssef. +* Les noeuds en parametres de noeuds, ca n'a pas l'air de marcher terrible, +terrible... -* apropos d'intanciation, j'autorise "is" et "=" +* instanciation de modele + +*** pour etre coherent, on devrait plutot ecrire + mypack = mymodel<<mytype, mynode, myconst>> + +*** instanciation de modele <<locaux>> à d'autre package interdite +pour l'instant, alors que ca marchait chez Youssef. Ce serait pratique +tout de meme. + +Car si je veux utiliser definir un package parametré par un noeud n, +je suis obligé de définir n dans un package à part. + + +*** par ailleur j'autorise "is" et "=" package Pint = m1( int ); mais j'ai bien envie de virer "is". +*** quand on a defini un model iter, qui exporte un noeud map2, +en necessissant un type, une constant, et un noued, ce serait bien +de pouvoir ecrire directement un truc du genre + + t12 = iter<<3, int, +>>::map2(t1, t2); + +voire même + + t12 = iter::map2<<3, int, +>>(t1, t2); + +au lieu de : + + package p = iter(3, int, +); + t12 = p::map2(t1, t2); + +Autre solution : utiliser un passage par nom des parametres de models + +Remarque : a t'on vraiment besoin du mot clef "model" ? +un package avec un champ needs fait office naturellement de +package paramétré. + +En fait, je trouve le terme de "model" tres surchargé. + + +« * j'ai defini ">" et consort comme étant polymorphes (et pas seulement surchargées), parce que c'est facile en caml (via Pervasive.compare). Mais est-ce une bonne idée ? @@ -86,6 +119,10 @@ J'ai associ moment où on accepte les noeuds multi-horloges. De même, la " -> " devrait être multi-horloge également. Et peut-etre d'autres encore... +* soc = synchronous object component, c'est pas mieux comme nom ? + +* Avec Marc, on pourrait aussi se synchroniser au niveau du lic. +Mais du coup de travail de JB part à la poubelle... ********************************************************************* ********************************************************************* @@ -135,6 +172,10 @@ n'est pas le cas pour l'instant... cf [solve_ident] ********************************************************************* *** a faire +* Ne pas générer de "current", "->", "pre" (i.e., les traduire en + termes de "merge" et "fby"). + + *** facile ---------- diff --git a/src/dead.grep b/src/dead.grep deleted file mode 100644 index 01b8363e4ea4eb06ddbbfb6cb4b85c74227348b4..0000000000000000000000000000000000000000 --- a/src/dead.grep +++ /dev/null @@ -1,402 +0,0 @@ -prof/compile.ml:31: if Verbose.get_level () > 2 then (* ocamlprof: 0 *) SyntaxTab.dump syntax_tab; -prof/compile.ml:38: (* ocamlprof: 0 *) let main_node_key = -prof/compile.ml:46: (* ocamlprof: 0 *) LazyCompiler.compile_all lzcomp -prof/compile.ml:48: (* ocamlprof: 0 *) ignore(LazyCompiler.node_check lzcomp main_node_key -prof/compile.ml:50: | None -> (* ocamlprof: 0 *) Lxm.dummy "" -prof/compile.ml:51: | Some pn -> (* ocamlprof: 0 *) Lxm.dummy (Ident.pack_name_to_string pn))) -prof/eff.ml:424: | On(cid1,_), On(cid2,_) -> (* ocamlprof: 0 *) cid1 = cid2 -prof/eff.ml:437: fun nkey -> (* ocamlprof: 0 *) (nkey, []) -prof/eff.ml:446: | Enum_type_eff(l,el) -> (* ocamlprof: 0 *) Enum_type_eff(l,el) -prof/eff.ml:463: | Struct_const_eff (fl, teff) -> (* ocamlprof: 0 *) teff -prof/errors.ml:123:let warning lxm msg = (* ocamlprof: 0 *) ( -prof/errors.ml:138:let print_internal_error fnme msg = (* ocamlprof: 0 *) ( -prof/evalClock.ml:139: | On(_,_), BaseEff -> (* ocamlprof: 0 *) None -prof/evalClock.ml:144: with _ -> (* ocamlprof: 0 *) is_a_sub_clock lxm s (id_sc,sc) (id_c,clk2) -prof/evalClock.ml:150: (* ocamlprof: 0 *) let s1,s2 = s in -prof/evalClock.ml:154: (* ocamlprof: 0 *) let s1,s2 = s in -prof/evalClock.ml:196: | id, On(v, ClockVar _) -> (* ocamlprof: 0 *) id, On(v, BaseEff) -prof/evalClock.ml:206: (* ocamlprof: 0 *) print_string "*** No entry for '"; -prof/evalClock.ml:243: (* ocamlprof: 0 *) raise (Compile_error(lxm, "\n*** can't eval constant: "^msg)) -prof/evalClock.ml:266: | [id, BaseEff] -> (* ocamlprof: 0 *) [id, BaseEff],s -prof/evalClock.ml:273: | Base -> (* ocamlprof: 0 *) BaseEff, BaseEff -prof/evalClock.ml:293: (* ocamlprof: 0 *) let msg = "\n*** clock error: '" ^ (ci2str (snd exp_clk)) ^ -prof/evalClock.ml:364: | ClockVar i -> (* ocamlprof: 0 *) ci -prof/evalConst.ml:26:let finish_me msg = (* ocamlprof: 0 *) print_string ("\n\tXXX evalConst.ml:"^msg^" -> finish me!\n") -prof/evalConst.ml:29: (* ocamlprof: 0 *) raise (EvalConst_error( -prof/evalConst.ml:45: (* ocamlprof: 0 *) let get_res (ix : int) = (* ocamlprof: 0 *) Array.get ctab (slice.se_first + ix*slice.se_step) in -prof/evalConst.ml:52: (* ocamlprof: 0 *) let expected_type = ref None in -prof/evalConst.ml:54: (* ocamlprof: 0 *) match op with -prof/evalConst.ml:55: | [x] -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:59: | None -> (* ocamlprof: 0 *) expected_type := Some xtyp; x -prof/evalConst.ml:60: | Some t -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:61: if (t = xtyp) then (* ocamlprof: 0 *) x else -prof/evalConst.ml:62: (* ocamlprof: 0 *) raise (EvalConst_error( -prof/evalConst.ml:70: (* ocamlprof: 0 *) raise (EvalConst_error("array of tuple not allowed")) -prof/evalConst.ml:74: | None -> (* ocamlprof: 0 *) raise (EvalConst_error("empty array")) -prof/evalConst.ml:75: | Some t -> (* ocamlprof: 0 *) Array_const_eff(res, t) -prof/evalConst.ml:86: (* ocamlprof: 0 *) ( -prof/evalConst.ml:89: Struct_type_eff (tnm, flst) -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:91: let make_eff_field ((fn: Ident.t),((ft:Eff.type_),(fv:Eff.const option))) = (* ocamlprof: 0 *) ( -prof/evalConst.ml:95: (lxm, v) -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:99: if (vt = ft) then (* ocamlprof: 0 *) (fn, v) (*ok*) -prof/evalConst.ml:100: else (* ocamlprof: 0 *) raise (Compile_error( -prof/evalConst.ml:109: ) with Not_found -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:112: Some v -> (* ocamlprof: 0 *) (fn, v) (* ok : v correcte par construction *) -prof/evalConst.ml:114: (* ocamlprof: 0 *) raise (EvalConst_error( -prof/evalConst.ml:125: = (* ocamlprof: 0 *) raise(Compile_error( -prof/evalConst.ml:137: | _ -> (* ocamlprof: 0 *) raise (EvalConst_error( -prof/evalConst.ml:175: | SyntaxTreeCore.CallByName ({it=nmop; src=lxm}, nmargs ) -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:178: (* ocamlprof: 0 *) raise (Compile_error(lxm, "\n*** can't eval constant: "^msg)) -prof/evalConst.ml:206: | WITH_n(a0,a1,a2) -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:208: [ Bool_const_eff true] -> (* ocamlprof: 0 *) rec_eval_const a1 -prof/evalConst.ml:209: | [ Bool_const_eff false] -> (* ocamlprof: 0 *) rec_eval_const a2 -prof/evalConst.ml:210: | x -> (* ocamlprof: 0 *) type_error_const x "bool" -prof/evalConst.ml:213: | TUPLE_n -> (* ocamlprof: 0 *) ( List.flatten (List.map rec_eval_const args)) -prof/evalConst.ml:225: (* ocamlprof: 0 *) raise (EvalConst_error("array of tuple not allowed")) -prof/evalConst.ml:227: EvalArray_error msg -> (* ocamlprof: 0 *) raise(EvalConst_error msg) -prof/evalConst.ml:229: | _ -> (* ocamlprof: 0 *) raise(EvalConst_error -prof/evalConst.ml:233: | CONCAT_n -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:237: [Array_const_eff (v1, t1)]] -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:239: (* ocamlprof: 0 *) [Array_const_eff (Array.append v0 v1, t0)] -prof/evalConst.ml:241: (* ocamlprof: 0 *) raise(EvalConst_error( -prof/evalConst.ml:249: (* ocamlprof: 0 *) raise(EvalConst_error( -prof/evalConst.ml:251: | _ -> (* ocamlprof: 0 *) raise(EvalConst_error -prof/evalConst.ml:255: | ARRAY_n -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:262: | [Array_const_eff (elts, typelts)] -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:267: with EvalArray_error msg -> (* ocamlprof: 0 *) raise(EvalConst_error msg) -prof/evalConst.ml:269: | _ -> (* ocamlprof: 0 *) type_error_const effargs "some array" -prof/evalConst.ml:271: | ARRAY_SLICE_n sl -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:274: | [Array_const_eff (l, t)] -> (* ocamlprof: 0 *) (l, t) -prof/evalConst.ml:275: | x -> (* ocamlprof: 0 *) type_error_const x "some array" -prof/evalConst.ml:284: EvalArray_error msg -> (* ocamlprof: 0 *) raise(EvalConst_error msg) -prof/evalConst.ml:288: (* ocamlprof: 0 *) let ceff_list = List.flatten (List.map rec_eval_const args) in -prof/evalConst.ml:290: | [Struct_const_eff (flst, typ)] -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:293: (* ocamlprof: 0 *) raise (EvalConst_error -prof/evalConst.ml:298: | [x] -> (* ocamlprof: 0 *) type_error_const [x] "struct type" -prof/evalConst.ml:299: | x -> (* ocamlprof: 0 *) arity_error_const x "1" -prof/evalConst.ml:302: | CALL_n _ -> (* ocamlprof: 0 *) not_evaluable_construct "node call" -prof/evalConst.ml:303: | MERGE_n _ -> (* ocamlprof: 0 *) not_evaluable_construct "merge" -prof/evalConst.ml:304: | WHEN_n _ -> (* ocamlprof: 0 *) not_evaluable_construct "when" -prof/evalConst.ml:305: | FBY_n -> (* ocamlprof: 0 *) not_evaluable_construct "fby" -prof/evalConst.ml:306: | ARROW_n -> (* ocamlprof: 0 *) not_evaluable_construct "->" -prof/evalConst.ml:307: | CURRENT_n -> (* ocamlprof: 0 *) not_evaluable_construct "current" -prof/evalConst.ml:308: | PRE_n -> (* ocamlprof: 0 *) not_evaluable_construct "pre" -prof/evalConst.ml:317: (* ocamlprof: 0 *) not_evaluable_construct (op2string op) -prof/evalConst.ml:331: = (* ocamlprof: 0 *) ( -prof/evalConst.ml:334: (* ocamlprof: 0 *) finish_me "anonymous struct"; -prof/evalConst.ml:337: | STRUCT_n opid -> (* ocamlprof: 0 *) ( -prof/evalConst.ml:341: (* ocamlprof: 0 *) if -prof/evalConst.ml:344: (* ocamlprof: 0 *) raise(EvalConst_error( -prof/evalConst.ml:350: (* ocamlprof: 0 *) let v = rec_eval_const pexp in -prof/evalConst.ml:352: | [x] -> (* ocamlprof: 0 *) Hashtbl.add arg_tab pid.it (pid.src, x) -prof/evalConst.ml:354: (* ocamlprof: 0 *) raise( -prof/evalConst.ml:367: (* ocamlprof: 0 *) raise(EvalConst_error( -prof/evalConst.ml:398: (* ocamlprof: 0 *) raise(EvalArray_error(sprintf "bad array size %d" sz)) -prof/evalConst.ml:400: (* ocamlprof: 0 *) raise(EvalArray_error(sprintf "bad array size, int expected but get %s" -prof/evalConst.ml:403: (* ocamlprof: 0 *) raise(EvalArray_error(sprintf "bad array size, int expected, not a tuple")) -prof/evalConst.ml:431: (* ocamlprof: 0 *) raise(EvalArray_error("The extern const " ^ (Ident.string_of_long id) ^ -prof/evalConst.ml:434: | [x] -> (* ocamlprof: 0 *) raise(EvalArray_error(sprintf -prof/evalConst.ml:438: | _ -> (* ocamlprof: 0 *) raise(EvalArray_error( -prof/evalConst.ml:444: (* ocamlprof: 0 *) raise (Compile_error(lxm, "\n*** can't eval constant: "^msg)) -prof/evalConst.ml:448: else (* ocamlprof: 0 *) raise(EvalArray_error( -prof/evalConst.ml:477: | [x] -> (* ocamlprof: 0 *) raise(EvalArray_error( -prof/evalConst.ml:480: | _ -> (* ocamlprof: 0 *) raise(EvalArray_error( -prof/evalConst.ml:483: | None -> (* ocamlprof: 25 *) if (first_ix <= last_ix) then (* ocamlprof: 25 *) 1 else (* ocamlprof: 0 *) -1 -prof/evalConst.ml:490: (* ocamlprof: 0 *) let msg = sprintf "bad array slice [%d..%d] step %d" first_ix last_ix step in -prof/evalConst.ml:498: (* ocamlprof: 0 *) warning lxm (sprintf "last index out of slice [%d..%d step %d]" -prof/evalConst.ml:512: (* ocamlprof: 0 *) raise (Compile_error(lxm, "\n*** can't eval constant: "^msg)) -prof/evalType.ml:32:let finish_me msg = (* ocamlprof: 0 *) print_string ("\n\tXXX evalType.ml:"^msg^" -> finish me!\n") -prof/evalType.ml:40: (* ocamlprof: 0 *) raise (Compile_error(lxm, "type error: "^msg)) -prof/evalType.ml:45: (* ocamlprof: 0 *) raise (Compile_error(lxm, "\n*** can't eval constant: "^msg)) -prof/evalType.ml:79: (* ocamlprof: 0 *) raise (EvalType_error( -prof/evalType.ml:87: | UnifyType.Ko msg -> (* ocamlprof: 0 *) raise (Compile_error(lxm, msg)) -prof/evalType.ml:100: | Eff.CONCAT -> (* ocamlprof: 0 *) ( -prof/evalType.ml:103: (* ocamlprof: 0 *) let teff = -prof/evalType.ml:105: | UnifyType.Equal -> (* ocamlprof: 0 *) teff1 -prof/evalType.ml:106: | UnifyType.Unif subst -> (* ocamlprof: 0 *) subst_type subst teff1 -prof/evalType.ml:107: | UnifyType.Ko msg -> (* ocamlprof: 0 *) raise (Compile_error(lxm, msg)) -prof/evalType.ml:111: (* ocamlprof: 0 *) raise(EvalType_error(sprintf "arity error: 2 expected instead of %d" -prof/evalType.ml:120: (* ocamlprof: 0 *) raise (EvalType_error -prof/evalType.ml:125: | [x] -> (* ocamlprof: 0 *) type_error [x] "struct type" -prof/evalType.ml:126: | x -> (* ocamlprof: 0 *) arity_error x "1" -prof/evalType.ml:146: (* ocamlprof: 0 *) raise(EvalType_error( -prof/evalType.ml:160: | Base -> (* ocamlprof: 0 *) () -prof/evalType.ml:175: | _ -> (* ocamlprof: 0 *) raise(EvalType_error("arity error (1 arg expected)")) -prof/evalType.ml:182: (* ocamlprof: 0 *) raise(EvalType_error("type mismatch. ")) -prof/evalType.ml:183: | _ -> (* ocamlprof: 0 *) raise(EvalType_error("arity error (2 args expected)")) -prof/evalType.ml:190: | _ -> (* ocamlprof: 0 *) raise(EvalType_error("arity error (1 arg expected)")) -prof/evalType.ml:209: (* ocamlprof: 0 *) finish_me "anonymous struct not yet supported"; -prof/expandPack.ml:22: (* ocamlprof: 0 *) let msg = Printf.sprintf "bad pack instance: model %s undeclared" -prof/expandPack.ml:46: (* ocamlprof: 0 *) let msg = Printf.sprintf -prof/expandPack.ml:57: (* ocamlprof: 0 *) Lxm.flagit (Named_type_exp idr) arg.src -prof/expandPack.ml:59: | _ -> (* ocamlprof: 0 *) instance_error () -prof/expandPack.ml:71: (* ocamlprof: 0 *) ParserUtils.leafexp arg.src (IDENT_n idr) -prof/expandPack.ml:73: | _ -> (* ocamlprof: 0 *) instance_error () -prof/expandPack.ml:87: | _ -> (* ocamlprof: 0 *) instance_error () -prof/expandPack.ml:113: | None -> (* ocamlprof: 0 *) acc -prof/expandPack.ml:116: if List.mem p_flagged acc then (* ocamlprof: 0 *) acc else (* ocamlprof: 3 *) p_flagged::acc -prof/expandPack.ml:129: (* ocamlprof: 0 *) raise(Compile_error -prof/expandPack.ml:152: | None -> (* ocamlprof: 0 *) None -prof/expandPack.ml:161: ) with Invalid_argument _ -> (* ocamlprof: 0 *) ( -prof/getEff.ml:29: with EvalConst.EvalArray_error msg -> (* ocamlprof: 0 *) raise(GetEffType_error msg) -prof/getEff.ml:32: (* ocamlprof: 0 *) raise (Compile_error(texp.src, "can't eval type: "^msg)) -prof/getEff.ml:53: (* ocamlprof: 0 *) raise (Compile_error(lxm, -prof/getEff.ml:63: (* ocamlprof: 0 *) let msg = "type mismatch: \n***\t'" -prof/getEff.ml:115: (* ocamlprof: 0 *) let ceff = node_id_solver.id2const idref sa.src in -prof/getEff.ml:119: (* ocamlprof: 0 *) let teff = node_id_solver.id2type idref sa.src in -prof/getEff.ml:123: (* ocamlprof: 0 *) let sargs = [] in -prof/getEff.ml:141: (* ocamlprof: 0 *) let neff = node node_id_solver ne in -prof/getEff.ml:202: (* ocamlprof: 0 *) raise (Compile_error(id.src, "bad field name in structure")) -prof/getEff.ml:204: | _ -> (* ocamlprof: 0 *) raise (Compile_error(id.src, "a structure was expected")) -prof/getEff.ml:215: | _ -> (* ocamlprof: 0 *) raise (Compile_error(vef.src, "an array was expected")) -prof/getEff.ml:226: | _ -> (* ocamlprof: 0 *) raise (Compile_error(sif.src, "an array was expected")) -prof/getEff.ml:246: | STRUCT_anonymous_n -> (* ocamlprof: 0 *) STRUCT_anonymous -prof/getEff.ml:254: | Some pn -> (* ocamlprof: 0 *) STRUCT (pn, idref) -prof/getEff.ml:267: | StaticArgNode _ -> (* ocamlprof: 0 *) raise (Compile_error(lxm, "a constant was expected")) -prof/getEff.ml:276: | StaticArgNode(CALL_n ne) -> (* ocamlprof: 0 *) node id_solver ne -prof/getEff.ml:283: | StaticArgConst _ -> (* ocamlprof: 0 *) raise (Compile_error(lxm, "a node was expected")) -prof/getEff.ml:304: (* ocamlprof: 0 *) raise (Compile_error(lxm, "bad arguments number for array iterator")) -prof/getEff.ml:357: | CONCAT_n -> (* ocamlprof: 0 *) Eff.CONCAT -prof/getEff.ml:368: | WHEN_n Base -> (* ocamlprof: 0 *) Eff.WHEN Base -prof/getEff.ml:373: | Some _ -> (* ocamlprof: 0 *) cc -prof/getEff.ml:391: (* ocamlprof: 0 *) raise (Compile_error( -prof/getEff.ml:410: (* ocamlprof: 0 *) raise (Compile_error( -prof/getEff.ml:429: | MERGE_n(id, idl) -> (* ocamlprof: 0 *) Eff.MERGE(id, idl) -prof/getEff.ml:449: (* ocamlprof: 0 *) let msg = "type mismatch: \n\tthe content of the assertion is of type " -prof/getEff.ml:467: (* ocamlprof: 0 *) let msg = "clock error: assert should be on the base clock, "^ -prof/ident.ml:105: | _ -> (* ocamlprof: 0 *) raise (Failure ("idref_of_string: \""^s^"\" not a proper ident")) -prof/ident.ml:111: [i] -> (* ocamlprof: 0 *) !dft_pack_name, i -prof/ident.ml:113: | _ -> (* ocamlprof: 0 *) raise (Failure ("idref_of_string: \""^s^"\" not a proper ident")) -prof/ident.ml:130: (* ocamlprof: 0 *) match pack_of_idref idr with -prof/ident.ml:131: Some p -> (* ocamlprof: 0 *) (p, name_of_idref idr) -prof/ident.ml:132: | None -> (* ocamlprof: 0 *) (!dft_pack_name, name_of_idref idr) -prof/lazyCompiler.ml:10:let finish_me msg = (* ocamlprof: 0 *) print_string ("\n\tXXX LazyCompiler:"^msg^" -> finish me!\n") -prof/lazyCompiler.ml:22: | [] -> (* ocamlprof: 0 *) "nostack" -prof/lazyCompiler.ml:158: (* ocamlprof: 0 *) print_string ("*** " ^ (Ident.string_of_long lid) ^ "???\n" ^ -prof/lazyCompiler.ml:196: | Eff.Incorrect -> (* ocamlprof: 0 *) raise (BadCheckRef_error) -prof/lazyCompiler.ml:200: lookup_x_eff "type ref " (fun k -> (* ocamlprof: 0 *) k) -prof/lazyCompiler.ml:240: (* ocamlprof: 0 *) (raise (Compile_error(lxm,"unbounded " ^ x_label ^ " ident"))) -prof/lazyCompiler.ml:304: (* ocamlprof: 0 *) raise(Compile_error ( -prof/lazyCompiler.ml:324: (* ocamlprof: 0 *) raise(Compile_error (const_def.src, " constant values mismatch")) -prof/lazyCompiler.ml:328: (* ocamlprof: 0 *) raise(Compile_error ( -prof/lazyCompiler.ml:345: (* ocamlprof: 0 *) raise(Compile_error ( -prof/lazyCompiler.ml:386: (* ocamlprof: 0 *) raise -prof/lazyCompiler.ml:394: (* ocamlprof: 0 *) raise (Compile_error(field_def.src, -prof/lazyCompiler.ml:410: (* ocamlprof: 0 *) if (root = type_name) then (* ocamlprof: 0 *) recursion_error type_def.src stack else -prof/lazyCompiler.ml:411: (* ocamlprof: 0 *) raise ( Recursion_error (root, ("type ref "^(Lxm.details lxm))::stack)) -prof/lazyCompiler.ml:456: (* ocamlprof: 0 *) raise -prof/lazyCompiler.ml:464: | _::_ -> (* ocamlprof: 0 *) raise (Compile_error(const_def.src, -prof/lazyCompiler.ml:498: (* ocamlprof: 0 *) raise(Compile_error (node_def.src, msg_prefix ^ " ??? ")) -prof/lazyCompiler.ml:503: (* ocamlprof: 0 *) let msg = msg_prefix ^ "bad input profile. \n*** " ^ -prof/lazyCompiler.ml:513: (* ocamlprof: 0 *) let msg = msg_prefix ^ "bad output profile. \n*** " ^ -prof/lazyCompiler.ml:522: (* ocamlprof: 0 *) raise(Compile_error (node_def.src, msg_prefix ^ " node or function?")) -prof/lazyCompiler.ml:526: (* ocamlprof: 0 *) raise(Compile_error (node_def.src, msg_prefix ^ "safe or unsafe?")) -prof/lazyCompiler.ml:532: (* ocamlprof: 0 *) raise(Compile_error (node_def.src, msg_prefix ^ "abstract or not?")) -prof/lazyCompiler.ml:623: (* ocamlprof: 0 *) aux acc tail -prof/lazyCompiler.ml:632: (* ocamlprof: 0 *) raise ( -prof/lazyCompiler.ml:736: (* ocamlprof: 0 *) raise (Compile_error (lxm, "Can not alias 'nor' nor '#', sorry")) -prof/lazyCompiler.ml:763: (* ocamlprof: 0 *) raise (Compile_error (lxm, "can not alias this operator, sorry")) -prof/lazyCompiler.ml:780: | UnifyType.Ko msg -> (* ocamlprof: 0 *) raise(Compile_error(lxm, msg)) -prof/lazyCompiler.ml:783: | UnifyType.Ko msg -> (* ocamlprof: 0 *) raise(Compile_error (lxm, msg)) -prof/lazyCompiler.ml:788: let res = if !Global.one_op_per_equation then (* ocamlprof: 798 *) Split.node res else (* ocamlprof: 0 *) res in -prof/licDump.ml:76: | Extern_const_eff (s,t,vopt) -> (* ocamlprof: 0 *) (long s) ^ (string_of_const_eff_opt vopt) -prof/licDump.ml:77: | Enum_const_eff (s,t) -> (* ocamlprof: 0 *) (long s) -prof/licDump.ml:78: | Struct_const_eff (fl, t) -> (* ocamlprof: 0 *) ( -prof/licDump.ml:81: (* ocamlprof: 0 *) (Ident.to_string id)^" = "^(string_of_const_eff veff) -prof/licDump.ml:93: | None -> (* ocamlprof: 0 *) "" -prof/licDump.ml:94: | Some val_exp_eff -> (* ocamlprof: 0 *) string_of_const_eff val_exp_eff -prof/licDump.ml:100: | External_type_eff i -> (* ocamlprof: 0 *) long i -prof/licDump.ml:118: | Any -> (* ocamlprof: 0 *) "a" -prof/licDump.ml:119: | Overload -> (* ocamlprof: 0 *) "o" -prof/licDump.ml:233: | [] -> (* ocamlprof: 0 *) "" -prof/licDump.ml:234: | [x] -> (* ocamlprof: 0 *) string_of_type_eff x -prof/licDump.ml:235: | l -> (* ocamlprof: 0 *) String.concat " * " (List.map string_of_type_eff l) -prof/licDump.ml:259: | TypeStaticArgEff (id, teff) -> (* ocamlprof: 0 *) sprintf "%s" (string_of_type_eff teff) -prof/licDump.ml:261: (* ocamlprof: 0 *) sprintf "%s" (string_of_node_key_rec opeff.node_key_eff) -prof/licDump.ml:267: | TypeStaticArgEff (id, teff) -> (* ocamlprof: 0 *) sprintf "%s" (string_of_type_eff teff) -prof/licDump.ml:276: | None -> (* ocamlprof: 0 *) None -prof/licDump.ml:288: fun x -> (* ocamlprof: 0 *) (string_of_type_eff x.var_type_eff) ^ -prof/licDump.ml:371: | Some _ -> (* ocamlprof: 0 *) idref -prof/licDump.ml:384: (* ocamlprof: 0 *) (string_of_val_exp_eff ve1) ^ " | " ^ (string_of_val_exp_eff ve2) -prof/licDump.ml:430: (* ocamlprof: 0 *) ("(" ^ str ^ ")") -prof/licDump.ml:440: | Some pn -> (* ocamlprof: 0 *) Ident.string_of_idref idref -prof/licDump.ml:445: | STRUCT_anonymous -> (* ocamlprof: 0 *) "") ^ -prof/licDump.ml:456: | SyntaxTreeCore.Base -> (* ocamlprof: 0 *) "base" -prof/licDump.ml:509: | AbstractEff -> (* ocamlprof: 0 *) [] -prof/licDump.ml:551: | AbstractEff -> (* ocamlprof: 0 *) "" -prof/licDump.ml:553: (* ocamlprof: 672 *) ((match neff.loclist_eff with None -> (* ocamlprof: 0 *) "" | Some [] -> (* ocamlprof: 174 *) "" -prof/licDump.ml:600:let node_error_string lxm nkey = (* ocamlprof: 0 *) ( -prof/licDump.ml:607:let print_compile_node_error nkey lxm msg = (* ocamlprof: 0 *) ( -prof/licDump.ml:613:let print_global_node_error lxm nkey msg = (* ocamlprof: 0 *) ( -prof/lxm.ml:28:let cstart x = (* ocamlprof: 0 *) (x._cstart) -prof/lxm.ml:29:let cend x = (* ocamlprof: 0 *) (x._cend) -prof/lxm.ml:30:let file x = (* ocamlprof: 0 *) x._file -prof/lxm.ml:31:let pragma x = (* ocamlprof: 0 *) x._pragma -prof/main.ml:67: ( "--output-file", Arg.String(fun x -> (* ocamlprof: 0 *) Global.outfile := x), "<file>" -prof/main.ml:69: ( "-o", Arg.String(fun x -> (* ocamlprof: 0 *) Global.outfile := x), -prof/main.ml:72: ( "--node", Arg.String(fun x -> (* ocamlprof: 0 *) Global.main_node := x), -prof/main.ml:75: ( "-n", Arg.String(fun x -> (* ocamlprof: 0 *) Global.main_node := x), -prof/main.ml:83: (function x -> (* ocamlprof: 0 *) Global.compile_all_items := true), -prof/main.ml:89: ( "--verbose", Arg.Unit (fun vl -> (* ocamlprof: 0 *) Verbose.set_level 1 ), -prof/main.ml:92: ( "-v", Arg.Unit (fun vl -> (* ocamlprof: 0 *) Verbose.set_level 1 ), -prof/main.ml:95: ( "--verbose-level", Arg.Int(fun vl -> (* ocamlprof: 0 *) Verbose.set_level vl ), "<int>" -prof/main.ml:101: ( "--keep-nested-calls", Arg.Unit (fun _ -> (* ocamlprof: 0 *) Global.one_op_per_equation := false), -prof/main.ml:106: ("-h", Arg.Unit (fun _ -> (* ocamlprof: 0 *) (Arg.usage arg_list usage_msg; exit 0)), "" ); -prof/main.ml:108: ("--help", Arg.Unit (fun _ -> (* ocamlprof: 0 *) (Arg.usage arg_list usage_msg; exit 0)), -prof/main.ml:146: with _ -> (* ocamlprof: 0 *) print_string ("*** '"^infile^"': bad file name.\n"); exit 1 -prof/main.ml:168: (* ocamlprof: 0 *) print_string ("old-style (un-packaged) lustre files can " ^ -prof/main.ml:192: if Sys.file_exists !Global.outfile then (* ocamlprof: 0 *) Sys.remove !Global.outfile; -prof/main.ml:202: if (!Global.infiles = []) then (* ocamlprof: 0 *) ( -prof/main.ml:210: (* ocamlprof: 0 *) Some (Ident.idref_of_string !Global.main_node) -prof/main.ml:212: if !Global.outfile <> "" then (* ocamlprof: 0 *) Global.oc := open_out !Global.outfile; -prof/main.ml:231: (* ocamlprof: 0 *) prerr_string ( -prof/main.ml:235: (if List.length !Global.infiles > 1 then (* ocamlprof: 0 *) "s " else (* ocamlprof: 0 *) " ") ^ -prof/parserUtils.ml:132:let ternexp lxm op e1 e2 e3 = (* ocamlprof: 0 *) CallByPos( {src = lxm ; it = op }, Oper [e1 ; e2; e3] ) -prof/parserUtils.ml:151: (* ocamlprof: 0 *) print_string ("Parser.idref_of_lxm" ^(Lxm.str lxm)); -prof/parserUtils.ml:463: (* ocamlprof: 0 *) CallByPos(flagit (IDENT_n (Ident.idref_of_string(istr))) lxm, -prof/predef.ml:67: | REAL2INT_n -> (* ocamlprof: 0 *) "real2int" -prof/predef.ml:68: | INT2REAL_n -> (* ocamlprof: 0 *) "int2real" -prof/predef.ml:89: | IUMINUS_n -> (* ocamlprof: 0 *) "-" -prof/predef.ml:90: | IMINUS_n -> (* ocamlprof: 0 *) "-" -prof/predef.ml:92: | ISLASH_n -> (* ocamlprof: 0 *) "/" -prof/predef.ml:93: | ITIMES_n -> (* ocamlprof: 0 *) "*" -prof/predef.ml:94: | RUMINUS_n -> (* ocamlprof: 0 *) "-" -prof/predef.ml:95: | RMINUS_n -> (* ocamlprof: 0 *) "-" -prof/predef.ml:96: | RPLUS_n -> (* ocamlprof: 0 *) "+" -prof/predef.ml:97: | RSLASH_n -> (* ocamlprof: 0 *) "/" -prof/predef.ml:98: | RTIMES_n -> (* ocamlprof: 0 *) "*" -prof/predef.ml:113: | DIESE_n -> (* ocamlprof: 0 *) "diese" -prof/predef.ml:120: | IMINUS_n -> (* ocamlprof: 0 *) "iminus" -prof/predef.ml:122: | ISLASH_n -> (* ocamlprof: 0 *) "idiv" -prof/predef.ml:123: | ITIMES_n -> (* ocamlprof: 0 *) "itimes" -prof/predef.ml:124: | RUMINUS_n -> (* ocamlprof: 0 *) "ruminus" -prof/predef.ml:125: | RMINUS_n -> (* ocamlprof: 0 *) "rminus" -prof/predef.ml:126: | RPLUS_n -> (* ocamlprof: 0 *) "plus" -prof/predef.ml:127: | RSLASH_n -> (* ocamlprof: 0 *) "rdiv" -prof/predef.ml:128: | RTIMES_n -> (* ocamlprof: 0 *) "rtimes" -prof/predef.ml:146: | "true" -> (* ocamlprof: 0 *) TRUE_n -prof/predef.ml:147: | "false" -> (* ocamlprof: 0 *) FALSE_n -prof/predef.ml:150: | "real2int" -> (* ocamlprof: 0 *) REAL2INT_n -prof/predef.ml:151: | "int2real" -> (* ocamlprof: 0 *) INT2REAL_n -prof/predef.ml:155: | "xor" -> (* ocamlprof: 0 *) XOR_n -prof/predef.ml:156: | "impl" -> (* ocamlprof: 0 *) IMPL_n -prof/predef.ml:158: | "neq" -> (* ocamlprof: 0 *) NEQ_n -prof/predef.ml:159: | "lt" -> (* ocamlprof: 0 *) LT_n -prof/predef.ml:161: | "gt" -> (* ocamlprof: 0 *) GT_n -prof/predef.ml:162: | "gte" -> (* ocamlprof: 0 *) GTE_n -prof/predef.ml:163: | "div" -> (* ocamlprof: 0 *) DIV_n -prof/predef.ml:164: | "mod" -> (* ocamlprof: 0 *) MOD_n -prof/predef.ml:168: | "nor" -> (* ocamlprof: 0 *) NOR_n -prof/predef.ml:169: | "#" -> (* ocamlprof: 0 *) DIESE_n -prof/predef.ml:170: | "diese" -> (* ocamlprof: 0 *) DIESE_n -prof/predef.ml:173: | "uminus" -> (* ocamlprof: 0 *) UMINUS_n -prof/predef.ml:174: | "minus" -> (* ocamlprof: 0 *) MINUS_n -prof/predef.ml:176: | "slash" -> (* ocamlprof: 0 *) SLASH_n -prof/predef.ml:177: | "times" -> (* ocamlprof: 0 *) TIMES_n -prof/predef.ml:181: | "iminus" -> (* ocamlprof: 0 *) IMINUS_n -prof/predef.ml:183: | "islash" -> (* ocamlprof: 0 *) ISLASH_n -prof/predef.ml:184: | "itimes" -> (* ocamlprof: 0 *) ITIMES_n -prof/predef.ml:186: | "ruminus" -> (* ocamlprof: 0 *) RUMINUS_n -prof/predef.ml:187: | "rminus" -> (* ocamlprof: 0 *) RMINUS_n -prof/predef.ml:188: | "rplus" -> (* ocamlprof: 0 *) RPLUS_n -prof/predef.ml:189: | "rslash" -> (* ocamlprof: 0 *) RSLASH_n -prof/predef.ml:190: | "rtimes" -> (* ocamlprof: 0 *) RTIMES_n -prof/predefEvalConst.ml:16: (* ocamlprof: 0 *) raise (EvalConst_error( -prof/predefEvalConst.ml:17: "type mismatch "^(if expect = "" then (* ocamlprof: 0 *) "" else (* ocamlprof: 0 *) (expect^" expected")))) -prof/predefEvalConst.ml:22: (* ocamlprof: 0 *) raise (EvalConst_error( -prof/predefEvalConst.ml:24: (List.length v) (if List.length v>1 then (* ocamlprof: 0 *) "s" else (* ocamlprof: 0 *) "") expect)) -prof/predefEvalConst.ml:51: fun op -> fun ll -> (* ocamlprof: 0 *) match List.flatten ll with -prof/predefEvalConst.ml:52: | [Real_const_eff v0; Real_const_eff v1] -> (* ocamlprof: 0 *) [Real_const_eff (op v0 v1)] -prof/predefEvalConst.ml:61: fun op -> fun ll -> (* ocamlprof: 0 *) match List.flatten ll with -prof/predefEvalConst.ml:62: | [Int_const_eff v0] -> (* ocamlprof: 0 *) [Int_const_eff (op v0)] -prof/predefEvalConst.ml:66: fun op -> fun ll -> (* ocamlprof: 0 *) match List.flatten ll with -prof/predefEvalConst.ml:67: | [Real_const_eff v0] -> (* ocamlprof: 0 *) [Real_const_eff (op v0)] -prof/predefEvalConst.ml:82: (* ocamlprof: 0 *) raise (EvalConst_error( -prof/predefEvalConst.ml:91: (* ocamlprof: 0 *) raise (EvalConst_error( -prof/predefEvalConst.ml:100: fun op -> fun ll -> (* ocamlprof: 0 *) match List.flatten ll with -prof/predefEvalConst.ml:101: | [Real_const_eff v0] -> (* ocamlprof: 0 *) [Int_const_eff (op v0)] -prof/predefEvalConst.ml:105: fun op -> fun ll -> (* ocamlprof: 0 *) match List.flatten ll with -prof/predefEvalConst.ml:106: | [Int_const_eff v0] -> (* ocamlprof: 0 *) [Real_const_eff (op v0)] -prof/predefEvalConst.ml:137: | REAL2INT_n -> (* ocamlprof: 0 *) fi_evaluator int_of_float ll -prof/predefEvalConst.ml:138: | INT2REAL_n -> (* ocamlprof: 0 *) if_evaluator float_of_int ll -prof/predefEvalConst.ml:144: | NEQ_n -> (* ocamlprof: 0 *) aab_evaluator (<>) ll -prof/predefEvalConst.ml:145: | LT_n -> (* ocamlprof: 0 *) aab_evaluator (<) ll -prof/predefEvalConst.ml:146: | LTE_n -> (* ocamlprof: 0 *) aab_evaluator (<=) ll -prof/predefEvalConst.ml:148: | GTE_n -> (* ocamlprof: 0 *) aab_evaluator (>=) ll -prof/predefEvalConst.ml:157: | IUMINUS_n -> (* ocamlprof: 0 *) ii_evaluator (fun x -> (* ocamlprof: 0 *) -x) ll -prof/predefEvalConst.ml:158: | IMINUS_n -> (* ocamlprof: 0 *) iii_evaluator (-) ll -prof/predefEvalConst.ml:159: | IPLUS_n -> (* ocamlprof: 0 *) iii_evaluator (+) ll -prof/predefEvalConst.ml:160: | ISLASH_n -> (* ocamlprof: 0 *) iii_evaluator (/) ll -prof/predefEvalConst.ml:161: | ITIMES_n -> (* ocamlprof: 0 *) iii_evaluator ( * ) ll -prof/predefEvalConst.ml:162: | RUMINUS_n -> (* ocamlprof: 0 *) ff_evaluator (fun x -> (* ocamlprof: 0 *) -.x) ll -prof/predefEvalConst.ml:163: | RMINUS_n -> (* ocamlprof: 0 *) fff_evaluator (-.) ll -prof/predefEvalConst.ml:164: | RPLUS_n -> (* ocamlprof: 0 *) fff_evaluator (+.) ll -prof/predefEvalConst.ml:165: | RSLASH_n -> (* ocamlprof: 0 *) fff_evaluator (/.) ll -prof/predefEvalConst.ml:166: | RTIMES_n -> (* ocamlprof: 0 *) fff_evaluator ( *.) ll -prof/predefEvalConst.ml:167: | NOR_n -> (* ocamlprof: 0 *) boolred_evaluator 0 ll -prof/predefEvalConst.ml:173: | BoolRed -> (* ocamlprof: 0 *) boolred_evaluator 1 ll -prof/predefEvalType.ml:19: (* ocamlprof: 0 *) let str_l = List.map LicDump.string_of_type_eff tel in -prof/predefEvalType.ml:23: (if expect = "" then (* ocamlprof: 0 *) "" -prof/predefEvalType.ml:24: else (* ocamlprof: 0 *) (" whereas\n*** type '" ^expect^"' was expected"))))) -prof/predefEvalType.ml:30: (if expect = "" then (* ocamlprof: 0 *) "" -prof/predefEvalType.ml:32: (if msg = "" then (* ocamlprof: 0 *) "" else (* ocamlprof: 1 *) ("\n*** " ^ msg))))) -prof/predefEvalType.ml:36: (* ocamlprof: 0 *) raise (EvalType_error( -prof/predefEvalType.ml:38: (List.length v) (if List.length v>1 then (* ocamlprof: 0 *) "s" else (* ocamlprof: 0 *) "") expect)) -prof/predefEvalType.ml:125: (* ocamlprof: 0 *) match UnifyType.f [t1] [t2] with -prof/predefEvalType.ml:126: | Equal -> (* ocamlprof: 0 *) (lti,lto) -prof/predefEvalType.ml:128: (* ocamlprof: 0 *) (List.map (fun (id,tid) -> (* ocamlprof: 0 *) id, subst_type t tid) lti, -prof/predefEvalType.ml:129: List.map (fun (id,tid) -> (* ocamlprof: 0 *) id, subst_type t tid) lto) -prof/predefEvalType.ml:130: | Ko(msg) -> (* ocamlprof: 0 *) raise (Compile_error(lxm, msg)) -prof/predefEvalType.ml:169: | _ -> (* ocamlprof: 0 *) raise (Compile_error(lxm, "\n*** type error: 3 int were expected")) -prof/predefEvalType.ml:187: | REAL2INT_n -> (* ocamlprof: 0 *) ri_profile -prof/predefEvalType.ml:188: | INT2REAL_n -> (* ocamlprof: 0 *) ir_profile -prof/predefEvalType.ml:192: | RUMINUS_n -> (* ocamlprof: 0 *) rr_profile -prof/predefEvalType.ml:196: | RMINUS_n | RPLUS_n | RTIMES_n | RSLASH_n -> (* ocamlprof: 0 *) rrr_profile -prof/predefEvalType.ml:258: (* ocamlprof: 0 *) (type_error (List.flatten [[Bool_type_eff]; t; e]) "bool*any*any") -prof/predefEvalType.ml:259: | x -> (* ocamlprof: 0 *) (arity_error x "3") -prof/predefEvalType.ml:266: (* ocamlprof: 93 *) acc | _ -> (* ocamlprof: 0 *) (type_error [ceff] "bool") -prof/predefEvalType.ml:277: (* ocamlprof: 0 *) arity_error [l] (string_of_int (List.length lti)) -prof/predefEvalType.ml:282: (* ocamlprof: 0 *) type_error2 -prof/predefEvalType.ml:287: (* ocamlprof: 0 *) type_error2 -prof/solveIdent.ml:77: | Some op -> (* ocamlprof: 0 *) Predef_n (op,[]) -prof/solveIdent.ml:111: | EnumConst(id,te) -> (* ocamlprof: 0 *) EnumConst(id,te) -prof/solveIdent.ml:119: | ArrayType(id,te,ve) -> (* ocamlprof: 0 *) ArrayType(id,te, r_val_exp ve) -prof/split.ml:37: | CallByPosEff({ it = Eff.FBY }, _) -> (* ocamlprof: 0 *) true -prof/split.ml:39: | CallByPosEff({ it = Eff.CURRENT }, _) -> (* ocamlprof: 0 *) true -prof/symbolTab.ml:36: (* ocamlprof: 0 *) raise (Compile_error(lxm, "unknown type (" ^ (Ident.to_string id)^")")) -prof/symbolTab.ml:41: (* ocamlprof: 0 *) raise (Compile_error(lxm, "unknown type (" ^ (Ident.to_string id)^")")) -prof/symbolTab.ml:61: (* ocamlprof: 0 *) raise (Global_error("Can not find node " ^ (Ident.to_string id)^ -prof/syntaxTab.ml:97: (* ocamlprof: 0 *) print_string ("*** Can not find package '" ^ -prof/syntaxTab.ml:100: (fun pn pm -> (* ocamlprof: 0 *) print_string ("\n***\t - '"^(Ident.pack_name_to_string pn)^ "'")) -prof/syntaxTab.ml:111: with Not_found -> (* ocamlprof: 0 *) raise(Compile_error(lxm, "")) -prof/syntaxTab.ml:313: with Not_found -> (* ocamlprof: 0 *) raise(Compile_error(lxm, "unknown package")) -prof/syntaxTab.ml:378: (* ocamlprof: 0 *) print_string "*** not implemented.\n"; -prof/syntaxTab.ml:382: (* ocamlprof: 0 *) print_string "*** not implemented.\n"; -prof/syntaxTab.ml:386: (* ocamlprof: 0 *) print_string "*** not implemented.\n"; -prof/syntaxTab.ml:394: (* ocamlprof: 0 *) let p = Verbose.print_string ~level:3 in -prof/syntaxTab.ml:400: (fun pm -> (* ocamlprof: 0 *) p (SyntaxTree.pack_or_model_to_string pm); p "\n\t\t") -prof/syntaxTab.ml:406: (fun id _mi -> (* ocamlprof: 0 *) p ((Ident.to_string id) ^ " ")) -prof/syntaxTab.ml:412: (fun pn pi -> (* ocamlprof: 0 *) p ((Ident.pack_name_to_string pn) ^ " ")) -prof/syntaxTab.ml:418: (fun pn pm -> (* ocamlprof: 0 *) p ((Ident.pack_name_to_string pn) ^ " ")) -prof/syntaxTree.ml:124: | LeftVar sflg -> (* ocamlprof: 0 *) sflg.src -prof/syntaxTree.ml:125: | LeftField (x, _) -> (* ocamlprof: 0 *) lexeme_of_left_part x -prof/syntaxTree.ml:126: | LeftArray (x, _) -> (* ocamlprof: 0 *) lexeme_of_left_part x -prof/syntaxTree.ml:127: | LeftSlice (x, _) -> (* ocamlprof: 0 *) lexeme_of_left_part x -prof/syntaxTree.ml:133: | NSPack pi -> (* ocamlprof: 0 *) Ident.pack_name_to_string pi.it.pa_name ^ " (pack) " -prof/syntaxTree.ml:134: | NSModel mi -> (* ocamlprof: 0 *) Ident.pack_name_to_string mi.it.mo_name ^ " (model) " -prof/unifyClock.ml:27: (* ocamlprof: 1749 *) if List.mem_assoc i s then (* ocamlprof: 0 *) s else (* ocamlprof: 1749 *) (i,c)::s -prof/unifyType.ml:47: (* ocamlprof: 1165 *) if l1 <> l2 then (* ocamlprof: 0 *) Ko "\n*** incompatible structure" else -prof/unifyType.ml:107: | Ko(msg) -> (* ocamlprof: 0 *) msg -prof/unifyType.ml:108: | Equal -> (* ocamlprof: 0 *) "types are equals\n" -prof/unifyType.ml:109: | Unif t -> (* ocamlprof: 0 *) "types are unifiable via " ^ (teff2str t) ^ "\n" -prof/uniqueOutput.ml:64: (* ocamlprof: 0 *) let rec aux vds v acc = (* ocamlprof: 0 *) match vds with -prof/uniqueOutput.ml:65: | VDS_def -> (* ocamlprof: 0 *) acc -prof/uniqueOutput.ml:66: | VDS_undef -> (* ocamlprof: 0 *) v::acc -prof/uniqueOutput.ml:68: (* ocamlprof: 0 *) List.fold_left (fun acc (id,vds) -> (* ocamlprof: 0 *) aux vds (v^"."^(id2str id)) acc) acc fl -prof/uniqueOutput.ml:69: | VDS_array(a) -> (* ocamlprof: 0 *) fst -prof/uniqueOutput.ml:71: (fun (acc,i) vds -> (* ocamlprof: 0 *) aux vds (v^"["^(int2str i) ^"]") acc, i+1) (acc,0) a) -prof/uniqueOutput.ml:83: (* ocamlprof: 0 *) let msg = "\n*** Variable " ^ v ^ " is defined twice." in -prof/uniqueOutput.ml:186: (* ocamlprof: 0 *) let msg = "\n*** Undefined variable(s): " ^ -prof/uniqueOutput.ml:201: (* ocamlprof: 0 *) let msg = "\n*** Error; " ^(id2str v.var_name_eff) ^ -prof/uniqueOutput.ml:211: (* ocamlprof: 0 *) let msg = "\n*** Undefined variable: " ^ (id2str v.var_name_eff) -prof/verbose.ml:34: (fun t -> (* ocamlprof: 2837 *) if (!_level >= level) then (* ocamlprof: 0 *) (print_string t; flush stdout) else (* ocamlprof: 2837 *) ()) s diff --git a/src/parser.mly b/src/parser.mly index b5dfa16c62e81f247f8a25e2267c7d7c0afd86ae..ce6e640eb25b963b850c24d4aaf2ef92bf7e64d0 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -57,6 +57,7 @@ open ParserUtils %token <Lxm.t> TK_LET %token <Lxm.t> TK_LT %token <Lxm.t> TK_LTE +%token <Lxm.t> TK_MERGE %token <Lxm.t> TK_MINUS %token <Lxm.t> TK_MOD %token <Lxm.t> TK_NEQ diff --git a/src/test/should_work/NONREG/merge.lus b/src/test/should_work/NONREG/merge.lus new file mode 100644 index 0000000000000000000000000000000000000000..0c1f6c800ad52cf6f3b98e8de8e22acc4d6d0658 --- /dev/null +++ b/src/test/should_work/NONREG/merge.lus @@ -0,0 +1,11 @@ +type trival = enum { Pile, Face, Tranche }; --- +node merge_node(clk: trival; --- + i1 when Pile(clk); i2 when Face(clk); + i3 when Tranche(clk)) +returns (y: int); --- +let + y = merge clk + (Pile: i1) + (Face: i2) + (Tranche: i3); +tel \ No newline at end of file diff --git a/src/test/should_work/NONREG/param_node.lus b/src/test/should_work/NONREG/param_node.lus new file mode 100644 index 0000000000000000000000000000000000000000..2716196a9977383ef4910db6b898e61abe6ae96f --- /dev/null +++ b/src/test/should_work/NONREG/param_node.lus @@ -0,0 +1,12 @@ + +-- A node parametrized by a node + +node toto_n<<node f(a, b: int) returns (x: int);const n : int>>(a: int) +returns (x: int^n); +var v : int; +let + v = f(a, 1); + x = v ^ n; +tel + +node toto_3 = toto_n<<Lustre::iplus, 3>>; \ No newline at end of file diff --git a/src/test/should_work/Pascal/consensus2.lus b/src/test/should_work/Pascal/consensus2.lus new file mode 100644 index 0000000000000000000000000000000000000000..e01b44c6ae18f908e52eda6f0c1087583473aa7b --- /dev/null +++ b/src/test/should_work/Pascal/consensus2.lus @@ -0,0 +1,9 @@ +node consensus<<const n : int>>(T: bool^n) +returns (a: bool); +let + a = with (n = 1) + then T[0] + else T[0] and consensus << n-1 >> (T[1 .. n-1]); +tel + +node main = consensus<<8>>; \ No newline at end of file diff --git a/src/test/should_work/Pascal/struct.lus b/src/test/should_work/Pascal/struct.lus new file mode 100644 index 0000000000000000000000000000000000000000..c221174d12e37e653f54dd2c5aa98e8c22de6a15 --- /dev/null +++ b/src/test/should_work/Pascal/struct.lus @@ -0,0 +1,9 @@ +type complex = struct { + re : real = 0.; + im : real = 0. +}; --- + +node plus (a, b : complex) returns (c : complex); +let + c = complex { re = a.re+b.re ; im = a.im+b.im }; +tel diff --git a/src/test/should_work/Pascal/struct0.lus b/src/test/should_work/Pascal/struct0.lus index 8690518f7d94870ef25aba7199da6e53b5f9cf33..d8e114ce3ae9a59d73f3a43bcc847e98a0dc1d73 100644 --- a/src/test/should_work/Pascal/struct0.lus +++ b/src/test/should_work/Pascal/struct0.lus @@ -1,7 +1,7 @@ type Toto = struct { x : int = 1; y : int = 2 -}; +}; node bibi (dummy : int) returns (z : Toto); let diff --git a/src/test/should_work/packEnvTest/complex.lus b/src/test/should_work/packEnvTest/complex.lus new file mode 100644 index 0000000000000000000000000000000000000000..b7e402baa7a415c4dcfa63adb94ba122a13f8550 --- /dev/null +++ b/src/test/should_work/packEnvTest/complex.lus @@ -0,0 +1,11 @@ +package complex -- uses trigo, math, ... ; +provides + type t; -- Encapsulation + const i:t; + function re(c: t) returns (r:real); --- +body + type t = struct { re : real ; im : real }; + const i:t = t { re = 0. ; im = 1. }; + function re(c: t) returns (re:real); + let re = c.re; tel; +end \ No newline at end of file diff --git a/src/test/should_work/packEnvTest/iter.lus b/src/test/should_work/packEnvTest/iter.lus new file mode 100644 index 0000000000000000000000000000000000000000..89a7d509623e3baa84579fa4ede660afb0127da9 --- /dev/null +++ b/src/test/should_work/packEnvTest/iter.lus @@ -0,0 +1,36 @@ +model iter +needs + const size: t; + type t; + node n(x,y:t) returns (z:t); +provides + node map2(x, y: t^size) returns (z:t^size); +body + node map2(x, y: t^size) returns (z:t^size); + let + z = map<<n, size>>(x, y); + tel +end + +package p = iter(3, int, +); +package p = iter(3, int, Lustre::iplus); + +package main uses p; + provides + node main (t1, t2: int^3) returns (t12: int^3); + +body + +node main (t1, t2: int^3) returns (t12: int^3); + let + t12 = p::map2(t1, t2); + tel +end + + +-- Ce serait de pouvoir écrire directement : +-- iter<<3, int, +>>::map2(t1, t2); +-- +-- voire +-- +-- iter::map2<<3, int, +>>(t1, t2); \ No newline at end of file diff --git a/src/test/should_work/packEnvTest/model.lus b/src/test/should_work/packEnvTest/model.lus new file mode 100644 index 0000000000000000000000000000000000000000..ea36f240eccb59bc4a3553a4620a1702b16e5cf5 --- /dev/null +++ b/src/test/should_work/packEnvTest/model.lus @@ -0,0 +1,9 @@ +model modSimple + needs type t; + provides + node fby1(init, fb: t) returns (next: t); +body + node fby1(init, fb: t) returns (next: t); + let next = init -> pre fb; tel +end +package pint is modSimple(int); diff --git a/src/test/should_work/packEnvTest/packages.lus b/src/test/should_work/packEnvTest/packages.lus index abd436ef523ba93a88664cef42548d9ad88c4869..e45433d58fd28679dc4d41d56bef3fa822eed766 100644 --- a/src/test/should_work/packEnvTest/packages.lus +++ b/src/test/should_work/packEnvTest/packages.lus @@ -4,16 +4,14 @@ -- * fournit : un noeud ---------------------------- model modSimple - needs - type t; + needs type t; provides node fby1(init, fb: t) returns (next: t); body - -node fby1(init, fb: t) returns (next: t); -let - next = init -> pre fb; -tel + node fby1(init, fb: t) returns (next: t); + let + next = init -> pre fb; + tel end ----------------------- diff --git a/src/test/should_work/packEnvTest/polymorphic_pack.lus b/src/test/should_work/packEnvTest/polymorphic_pack.lus new file mode 100644 index 0000000000000000000000000000000000000000..635c8c35d1511eb6ab625a4d685edfab8924ecb2 --- /dev/null +++ b/src/test/should_work/packEnvTest/polymorphic_pack.lus @@ -0,0 +1,19 @@ +model iter +needs + const size: t; + type t; + node n(x,y:t) returns (z:t); +provides + node map2(x, y: t^size) returns (z:t^size); +body + node map2(x, y: t^size) returns (z:t^size); + let + z = map<<n, size>>(x, y); + tel +end + +-- generates a type 'o' ! Raler ? +-- Dois-je refuser les packages polymorphes ? +package p = iter(3, int, +); + + \ No newline at end of file diff --git a/src/test/test.res.exp b/src/test/test.res.exp index f0dd72d425075aca0931cdced08759384f135c52..63b9fa6d9f71c7e9bad4af41e06587d658c9f69d 100644 --- a/src/test/test.res.exp +++ b/src/test/test.res.exp @@ -3062,6 +3062,13 @@ tel -- end of node long_et_stupide_nom_de_noeud::long_et_stupide_nom_de_noeud +---------------------------------------------------------------------- +====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/merge.lus +Opening file should_work/NONREG/merge.lus +*** Error in file "should_work/NONREG/merge.lus", line 3, col 7 to 10, token 'when': +*** syntax error + + ---------------------------------------------------------------------- ====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/minmax1.lus Opening file should_work/NONREG/minmax1.lus @@ -7208,6 +7215,13 @@ tel -- end of node cst::cst +---------------------------------------------------------------------- +====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/param_node.lus +Opening file should_work/NONREG/param_node.lus +*** Error in file "should_work/NONREG/param_node.lus", line 8, col 7 to 7, token 'f': +*** unknown node (f) + + ---------------------------------------------------------------------- ====> ../lus2lic -vl 2 --compile-all-items should_work/NONREG/patrick.lus Opening file should_work/NONREG/patrick.lus @@ -7820,6 +7834,130 @@ type A_bool_6 = bool^6; type A_bool_10 = bool^10; type A_bool_3 = bool^3; +---------------------------------------------------------------------- +====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/consensus2.lus +Opening file should_work/Pascal/consensus2.lus +node consensus2::consensus_1(T:A_bool_1) returns (a:bool); +var + _v1:bool; +let + a = T[0]; + _v1 = T[0]; +tel +-- end of node consensus2::consensus_1 +node consensus2::consensus_2(T:A_bool_2) returns (a:bool); +var + _v1:bool; + _v2:A_bool_1; + _v3:bool; + _v4:bool; +let + a = T[0] and consensus2::consensus_1(T[1 .. 1]); + _v1 = T[0]; + _v2 = T[1 .. 1]; + _v3 = consensus2::consensus_1(_v2); + _v4 = _v1 and _v3; +tel +-- end of node consensus2::consensus_2 +node consensus2::consensus_3(T:A_bool_3) returns (a:bool); +var + _v1:bool; + _v2:A_bool_2; + _v3:bool; + _v4:bool; +let + a = T[0] and consensus2::consensus_2(T[1 .. 2]); + _v1 = T[0]; + _v2 = T[1 .. 2]; + _v3 = consensus2::consensus_2(_v2); + _v4 = _v1 and _v3; +tel +-- end of node consensus2::consensus_3 +node consensus2::consensus_4(T:A_bool_4) returns (a:bool); +var + _v1:bool; + _v2:A_bool_3; + _v3:bool; + _v4:bool; +let + a = T[0] and consensus2::consensus_3(T[1 .. 3]); + _v1 = T[0]; + _v2 = T[1 .. 3]; + _v3 = consensus2::consensus_3(_v2); + _v4 = _v1 and _v3; +tel +-- end of node consensus2::consensus_4 +node consensus2::consensus_5(T:A_bool_5) returns (a:bool); +var + _v1:bool; + _v2:A_bool_4; + _v3:bool; + _v4:bool; +let + a = T[0] and consensus2::consensus_4(T[1 .. 4]); + _v1 = T[0]; + _v2 = T[1 .. 4]; + _v3 = consensus2::consensus_4(_v2); + _v4 = _v1 and _v3; +tel +-- end of node consensus2::consensus_5 +node consensus2::consensus_6(T:A_bool_6) returns (a:bool); +var + _v1:bool; + _v2:A_bool_5; + _v3:bool; + _v4:bool; +let + a = T[0] and consensus2::consensus_5(T[1 .. 5]); + _v1 = T[0]; + _v2 = T[1 .. 5]; + _v3 = consensus2::consensus_5(_v2); + _v4 = _v1 and _v3; +tel +-- end of node consensus2::consensus_6 +node consensus2::consensus_7(T:A_bool_7) returns (a:bool); +var + _v1:bool; + _v2:A_bool_6; + _v3:bool; + _v4:bool; +let + a = T[0] and consensus2::consensus_6(T[1 .. 6]); + _v1 = T[0]; + _v2 = T[1 .. 6]; + _v3 = consensus2::consensus_6(_v2); + _v4 = _v1 and _v3; +tel +-- end of node consensus2::consensus_7 +node consensus2::consensus_8(T:A_bool_8) returns (a:bool); +var + _v1:bool; + _v2:A_bool_7; + _v3:bool; + _v4:bool; +let + a = T[0] and consensus2::consensus_7(T[1 .. 7]); + _v1 = T[0]; + _v2 = T[1 .. 7]; + _v3 = consensus2::consensus_7(_v2); + _v4 = _v1 and _v3; +tel +-- end of node consensus2::consensus_8 +node consensus2::main(T:A_bool_8) returns (a:bool); +let + a = consensus2::consensus_8(T); +tel +-- end of node consensus2::main +-- automatically defined aliases: +type A_bool_7 = bool^7; +type A_bool_4 = bool^4; +type A_bool_8 = bool^8; +type A_bool_1 = bool^1; +type A_bool_5 = bool^5; +type A_bool_2 = bool^2; +type A_bool_6 = bool^6; +type A_bool_3 = bool^3; + ---------------------------------------------------------------------- ====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/fby.lus Opening file should_work/Pascal/fby.lus @@ -9445,6 +9583,22 @@ Opening file should_work/Pascal/pfs.lus *** syntax error +---------------------------------------------------------------------- +====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/struct.lus +Opening file should_work/Pascal/struct.lus +type _struct::complex = struct {re : real = 0.000000; im : real = 0.000000}; + +node struct::plus( + a:_struct::complex; + b:_struct::complex) +returns ( + c:_struct::complex); +let + c = _struct::complex{re=a.re + b.re;im=a.im + b.im}; +tel +-- end of node struct::plus + + ---------------------------------------------------------------------- ====> ../lus2lic -vl 2 --compile-all-items should_work/Pascal/struct0.lus Opening file should_work/Pascal/struct0.lus @@ -17599,6 +17753,14 @@ tel -- end of node Main::Condact +---------------------------------------------------------------------- +====> ../lus2lic -vl 2 --compile-all-items should_work/packEnvTest/complex.lus +Opening file should_work/packEnvTest/complex.lus +type _complex::t = struct {re : real; im : real}; + +*** oops: an internal error occurred in file licDump.ml, line 534, column 26 +*** when compiling lustre program should_work/packEnvTest/complex.lus + ---------------------------------------------------------------------- ====> ../lus2lic -vl 2 --compile-all-items should_work/packEnvTest/contractForElementSelectionInArray/contractForElementSelectionInArray.lus Opening file should_work/packEnvTest/contractForElementSelectionInArray/contractForElementSelectionInArray.lus @@ -18134,6 +18296,27 @@ tel -- automatically defined aliases: type A_int_10 = int^10; +---------------------------------------------------------------------- +====> ../lus2lic -vl 2 --compile-all-items should_work/packEnvTest/iter.lus +Opening file should_work/packEnvTest/iter.lus +*** Error in file "should_work/packEnvTest/iter.lus", line 16, col 9 to 9, token 'p': +*** package already declared in line:15, col:9 to 9 + + +---------------------------------------------------------------------- +====> ../lus2lic -vl 2 --compile-all-items should_work/packEnvTest/model.lus +Opening file should_work/packEnvTest/model.lus +type _pint::t = int; +node pint::fby1(init:int; fb:int) returns (next:int); +var + _v1:int; +let + next = init -> _v1; + _v1 = pre fb; +tel +-- end of node pint::fby1 + + ---------------------------------------------------------------------- ====> ../lus2lic -vl 2 --compile-all-items should_work/packEnvTest/modelInst.lus Opening file should_work/packEnvTest/modelInst.lus @@ -18322,6 +18505,24 @@ tel -- end of node main::foo +---------------------------------------------------------------------- +====> ../lus2lic -vl 2 --compile-all-items should_work/packEnvTest/polymorphic_pack.lus +Opening file should_work/packEnvTest/polymorphic_pack.lus +type _p::t = int; +const p::size = 3; +node p::n(i1:o; i2:o) returns (o:o); +let + o = Lustre::plus(i1, i2); +tel +-- end of node p::n +node p::map2(x:A_int_3; y:A_int_3) returns (z:A_int_3); +let + z = map<<p::n, 3>>(x, y); +tel +-- end of node p::map2 +-- automatically defined aliases: +type A_int_3 = int^3; + ---------------------------------------------------------------------- ====> ../lus2lic -vl 2 --compile-all-items should_work/to_sort_out/asservi.lus Opening file should_work/to_sort_out/asservi.lus diff --git a/src/untested_line_counter b/src/untested_line_counter index c3c7f2c514cdce61f0da6dfee70c5b8798cc6fc0..d46f8dbee1ab7eb7593b50560abb5148018a8ecb 100644 --- a/src/untested_line_counter +++ b/src/untested_line_counter @@ -1 +1 @@ -402 / 1584 = 25.37 % +389 / 1584 = 24.55 %