From c152e54abf140b7d38c7ffecbb3091a276aa3ba0 Mon Sep 17 00:00:00 2001 From: Erwan Jahier <jahier@imag.fr> Date: Wed, 23 Jul 2008 15:38:53 +0200 Subject: [PATCH] In the LicDump, always print the package name of constants, in order to avoid name clashes in the lic. --- src/compiledData.ml | 3 +- src/evalClock.ml | 3 +- src/evalType.ml | 5 +- src/getEff.ml | 21 +- src/global.ml | 2 +- src/ident.ml | 6 +- src/ident.mli | 3 +- src/lazyCompiler.ml | 2 +- src/licDump.ml | 9 +- src/licDump.mli | 2 +- src/symbolTab.ml | 35 +-- src/symbolTab.mli | 14 +- src/syntaxTab.ml | 14 +- src/test/should_work/NONREG/packed_cst.lus | 19 ++ src/test/test.res.exp | 250 +++++++++++---------- 15 files changed, 232 insertions(+), 156 deletions(-) create mode 100644 src/test/should_work/NONREG/packed_cst.lus diff --git a/src/compiledData.ml b/src/compiledData.ml index 8f53b79b..aa475df0 100644 --- a/src/compiledData.ml +++ b/src/compiledData.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 22/07/2008 (at 11:15) by Erwan Jahier> *) +(** Time-stamp: <modified the 23/07/2008 (at 10:06) by Erwan Jahier> *) (** @@ -177,6 +177,7 @@ and by_pos_op_eff = | Predef_eff of Predef.op * static_arg_eff list | CALL_eff of node_exp_eff srcflagged | IDENT_eff of Ident.idref (* should be an Ident.t or long, really... *) + | CONST_eff of Ident.idref * Ident.pack_name | PRE_eff | ARROW_eff diff --git a/src/evalClock.ml b/src/evalClock.ml index 6968aaa7..0031192b 100644 --- a/src/evalClock.ml +++ b/src/evalClock.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 22/07/2008 (at 10:58) by Erwan Jahier> *) +(** Time-stamp: <modified the 23/07/2008 (at 15:25) by Erwan Jahier> *) open Predef @@ -257,6 +257,7 @@ and (eval_by_pos_clock : id_solver -> by_pos_op_eff -> Lxm.t -> val_exp_eff list (* nb: the args have been put inside the HAT_eff constructor *) + | CONST_eff (idref,_) -> [get_constant_clock ()],s | IDENT_eff idref -> ( try ([var_info_eff_to_clock_eff (id_solver.id2var idref lxm)], s) with _ -> (* => it is a constant *) [get_constant_clock ()],s diff --git a/src/evalType.ml b/src/evalType.ml index e4e7738d..0a0f2680 100644 --- a/src/evalType.ml +++ b/src/evalType.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 22/07/2008 (at 10:58) by Erwan Jahier> *) +(** Time-stamp: <modified the 23/07/2008 (at 15:27) by Erwan Jahier> *) open Predef @@ -49,11 +49,12 @@ and (eval_by_pos_type : | UnifyType.Ko msg -> raise (Compile_error(lxm, msg)) ) + | CONST_eff (id,_) -> [type_of_const_eff (id_solver.id2const id lxm)] | IDENT_eff id -> ( (* [id] migth be a constant, but also a variable *) try [type_of_const_eff (id_solver.id2const id lxm)] with _ -> [(id_solver.id2var id lxm).var_type_eff] - ) + ) | WITH_eff(ve) -> f id_solver ve | TUPLE_eff -> List.flatten (List.map (f id_solver) args) diff --git a/src/getEff.ml b/src/getEff.ml index 528ec8a0..0bb0146f 100644 --- a/src/getEff.ml +++ b/src/getEff.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 22/07/2008 (at 10:56) by Erwan Jahier> *) +(** Time-stamp: <modified the 23/07/2008 (at 15:36) by Erwan Jahier> *) open Lxm @@ -321,6 +321,25 @@ and (translate_by_pos_op : id_solver -> by_pos_op srcflagged -> val_exp list -> | CALL_n node_exp_f -> CALL_eff (flagit (node id_solver node_exp_f) node_exp_f.src) + | IDENT_n idref -> ( + try + match Ident.pack_of_idref idref with + | Some pn -> IDENT_eff idref + (* Constant with a pack name are treated as + IDENT_eff. Indeed, I do not see any means to + know if idref denotes a constant or not, since + the SymbolTab tables are indexed by + Ident.t... Anyway, CONST_eff was introduced + precisely to handle idref constants with no pack + name, so handling idref with a pack name as + before should be ok (albeit being quite + inelegant). *) + | None -> + let id = Ident.of_idref idref in + let pn = fst (SymbolTab.find_const2 id_solver.symbols id lxm) in + CONST_eff (idref, pn) + with _ -> IDENT_eff idref + ) | IDENT_n idref -> IDENT_eff idref | CURRENT_n -> CURRENT_eff | PRE_n -> PRE_eff diff --git a/src/global.ml b/src/global.ml index 2706a942..ebab4b38 100644 --- a/src/global.ml +++ b/src/global.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 18/07/2008 (at 14:32) by Erwan Jahier> *) +(** Time-stamp: <modified the 22/07/2008 (at 15:39) by Erwan Jahier> *) (** Some global variables. diff --git a/src/ident.ml b/src/ident.ml index 5e33b400..b4552018 100644 --- a/src/ident.ml +++ b/src/ident.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 13/06/2008 (at 09:24) by Erwan Jahier> *) +(** Time-stamp: <modified the 23/07/2008 (at 10:05) by Erwan Jahier> *) (* J'ai appele ca symbol (mais ca remplace le ident) : c'est juste une couche qui garantit l'unicite en memoire @@ -139,5 +139,9 @@ let (long_of_idref : idref -> long) = | None -> (!dft_pack_name, name_of_idref idr) +let (make_idref : pack_name -> t -> idref) = + fun pn id -> + { id_pack = Some pn ; id_id = id } + (*************************************************************************) diff --git a/src/ident.mli b/src/ident.mli index 6c71500e..fde88ced 100644 --- a/src/ident.mli +++ b/src/ident.mli @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 21/05/2008 (at 14:37) by Erwan Jahier> *) +(** Time-stamp: <modified the 23/07/2008 (at 10:05) by Erwan Jahier> *) type t @@ -49,6 +49,7 @@ type idref = } val idref_of_string : string -> idref +val make_idref : pack_name -> t -> idref val string_of_idref : idref -> string diff --git a/src/lazyCompiler.ml b/src/lazyCompiler.ml index 64893d3a..b9222a77 100644 --- a/src/lazyCompiler.ml +++ b/src/lazyCompiler.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 22/07/2008 (at 10:56) by Erwan Jahier> *) +(** Time-stamp: <modified the 22/07/2008 (at 16:12) by Erwan Jahier> *) open Lxm diff --git a/src/licDump.ml b/src/licDump.ml index 2c8dbb7c..d4684c02 100644 --- a/src/licDump.ml +++ b/src/licDump.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 22/07/2008 (at 11:25) by Erwan Jahier> *) +(** Time-stamp: <modified the 23/07/2008 (at 10:10) by Erwan Jahier> *) open CompiledData open Printf @@ -250,6 +250,12 @@ and (string_of_by_pos_op_eff : by_pos_op_eff -> val_exp_eff list -> string) = ((string_of_node_key_rec nee.it.node_key_eff) ^ (tuple_par vel)) ) | IDENT_eff idref, _ -> Ident.string_of_idref idref + | CONST_eff (idref,pn), _ -> + Ident.string_of_idref ( + match Ident.pack_of_idref idref with + | Some _ -> idref + | None -> Ident.make_idref pn (Ident.of_idref idref) + ) | PRE_eff, _ -> "pre " ^ (tuple vel) | ARROW_eff, [ve1; ve2] -> (string_of_val_exp_eff ve1) ^ " -> " ^ (string_of_val_exp_eff ve2) @@ -287,6 +293,7 @@ and (string_of_by_pos_op_eff : by_pos_op_eff -> val_exp_eff list -> string) = | ARRAY_ACCES_eff(i, type_eff), _ -> assert false in let do_not_parenthesize = function + | CONST_eff _,_ | IDENT_eff _,_ | Predef_eff((Predef.ICONST_n _), _),_ | Predef_eff((Predef.RCONST_n _), _),_ diff --git a/src/licDump.mli b/src/licDump.mli index 01b09f61..c37f0bd1 100644 --- a/src/licDump.mli +++ b/src/licDump.mli @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 22/07/2008 (at 11:24) by Erwan Jahier> *) +(** Time-stamp: <modified the 22/07/2008 (at 15:47) by Erwan Jahier> *) open CompiledData diff --git a/src/symbolTab.ml b/src/symbolTab.ml index 39a01617..083b808e 100644 --- a/src/symbolTab.ml +++ b/src/symbolTab.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 29/05/2008 (at 10:11) by Erwan Jahier> *) +(** Time-stamp: <modified the 23/07/2008 (at 10:06) by Erwan Jahier> *) (* Sous-module pour SyntaxTab @@ -13,7 +13,7 @@ type 'a elt = | Imported of Ident.long * static_param srcflagged list type t = { - st_consts: (Ident.t , (const_info srcflagged) elt) Hashtbl.t ; + st_consts: (Ident.t , (Ident.pack_name * const_info srcflagged elt)) Hashtbl.t ; st_types : (Ident.t , (type_info srcflagged) elt) Hashtbl.t ; st_nodes : (Ident.t , (node_info srcflagged) elt) Hashtbl.t ; } @@ -37,6 +37,11 @@ let find_type (this: t) (id: Ident.t) lxm = let find_const (this: t) (id: Ident.t) lxm = + try snd (Hashtbl.find (this.st_consts) id) + with Not_found -> + raise (Compile_error(lxm, "unknown constant (" ^ (Ident.to_string id) ^")")) + +let find_const2 (this: t) (id: Ident.t) lxm = try Hashtbl.find (this.st_consts) id with Not_found -> raise (Compile_error(lxm, "unknown constant (" ^ (Ident.to_string id) ^")")) @@ -55,8 +60,8 @@ let find_node (this: t) (id: Ident.t) lxm = (* Manip de SymbolTab.t *) -let add_import_const (this: t) (id: Ident.t) (aid: Ident.long) = - Hashtbl.replace (this.st_consts) id (Imported (aid, [])) +let add_import_const (this: t) (pn:Ident.pack_name) (id: Ident.t) (aid: Ident.long) = + Hashtbl.replace (this.st_consts) id (pn, Imported (aid, [])) let add_import_type (this: t) (id: Ident.t) (aid: Ident.long) = Hashtbl.replace (this.st_types) id (Imported (aid, [])) @@ -65,10 +70,11 @@ let add_import_node (this: t) (id: Ident.t) (aid: Ident.long) (params:static_param srcflagged list) = Hashtbl.replace (this.st_nodes) id (Imported (aid, params)) -let add_const (this: t) (n: Ident.t) (cix: const_info srcflagged) = - Hashtbl.replace this.st_consts n (Local cix) +let add_const (this: t) (pn:Ident.pack_name) (n: Ident.t) + (cix: (const_info srcflagged)) = + Hashtbl.replace this.st_consts n (pn, Local cix) -let add_type (this: t) (n: Ident.t) (tix: type_info srcflagged) = ( +let add_type (this: t) pn (n: Ident.t) (tix: type_info srcflagged) = ( Hashtbl.replace this.st_types n (Local tix) ; (* cas particulier des types enums *) match tix.it with @@ -78,7 +84,8 @@ let add_type (this: t) (n: Ident.t) (tix: type_info srcflagged) = ( let te = Named_type_exp { Ident.id_pack = None; Ident.id_id = tname} in let tex = Lxm.flagit te tix.src in let ci = EnumConst (ec.it, tex) in - add_const this ec.it (Lxm.flagit ci (ec.src)) + add_const this pn ec.it (Lxm.flagit ci (ec.src)); + add_const this pn ec.it (Lxm.flagit ci (ec.src)) ) in List.iter treat_enum_const ecl ) @@ -89,16 +96,18 @@ let add_node (this: t) (n: Ident.t) (oix: node_info srcflagged) = Hashtbl.add this.st_nodes n (Local oix) -let iter_types this f = ( Hashtbl.iter f this.st_types) -let iter_consts this f = ( Hashtbl.iter f this.st_consts) -let iter_nodes this f = ( Hashtbl.iter f this.st_nodes) +let iter_types this f = Hashtbl.iter f this.st_types +let iter_consts this f = Hashtbl.iter (fun id (pn,ci) -> f id ci) this.st_consts +let iter_nodes this f = Hashtbl.iter f this.st_nodes +let iter_consts2 this f = Hashtbl.iter f this.st_consts + (* useful for debug *) let (dump : t -> unit) = fun x -> let const_info_dump = function - | Imported(l,_) -> print_string (Ident.long_to_string l) - | Local(x) -> (match x.it with + | pn, Imported(l,_) -> print_string (Ident.long_to_string l) + | pn, Local(x) -> (match x.it with | ExternalConst (id,texp,vopt) -> print_string "extern" | EnumConst (id,texp) -> print_string "enum" | DefinedConst (id,texp,vexp) -> diff --git a/src/symbolTab.mli b/src/symbolTab.mli index 44017afc..e74f2c37 100644 --- a/src/symbolTab.mli +++ b/src/symbolTab.mli @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 14/04/2008 (at 17:53) by Erwan Jahier> *) +(** Time-stamp: <modified the 23/07/2008 (at 10:21) by Erwan Jahier> *) (********************************************************** Sous-module pour SyntaxTab @@ -36,21 +36,25 @@ val find_type : t -> Ident.t -> Lxm.t -> (type_info Lxm.srcflagged) elt val find_const : t -> Ident.t -> Lxm.t -> (const_info Lxm.srcflagged) elt val find_node : t -> Ident.t -> Lxm.t -> (node_info Lxm.srcflagged) elt +val find_const2 : t -> Ident.t -> Lxm.t -> Ident.pack_name * const_info Lxm.srcflagged elt + (* Ajout de nom d'item importés (via uses) *) -val add_import_const : t -> Ident.t -> Ident.long -> unit +val add_import_const : t -> Ident.pack_name -> Ident.t -> Ident.long -> unit val add_import_type : t -> Ident.t -> Ident.long -> unit val add_import_node : t -> Ident.t -> Ident.long -> static_param srcflagged list -> unit (** Add local items declaration *) -val add_type : t -> Ident.t -> type_info Lxm.srcflagged -> unit -val add_const : t -> Ident.t -> const_info Lxm.srcflagged -> unit +val add_type : t -> Ident.pack_name -> Ident.t -> type_info Lxm.srcflagged -> unit +val add_const : t -> Ident.pack_name -> Ident.t -> const_info Lxm.srcflagged -> unit val add_node : t -> Ident.t -> node_info Lxm.srcflagged -> unit (* Itérer sur les items *) val iter_types: t -> (Ident.t -> (type_info Lxm.srcflagged) elt -> unit) -> unit -val iter_consts: t ->(Ident.t -> (const_info Lxm.srcflagged) elt-> unit) -> unit +val iter_consts: t ->(Ident.t -> (const_info Lxm.srcflagged) elt -> unit) -> unit val iter_nodes : t ->(Ident.t -> (node_info Lxm.srcflagged) elt -> unit) -> unit +val iter_consts2: + t ->(Ident.t -> Ident.pack_name * const_info Lxm.srcflagged elt -> unit) -> unit diff --git a/src/syntaxTab.ml b/src/syntaxTab.ml index e3ad29ad..97480406 100644 --- a/src/syntaxTab.ml +++ b/src/syntaxTab.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 02/06/2008 (at 14:29) by Erwan Jahier> *) +(** Time-stamp: <modified the 22/07/2008 (at 16:06) by Erwan Jahier> *) (** Table des infos sources : une couche au dessus de SyntaxTree pour mieux @@ -317,9 +317,9 @@ init_pack_mng_stabs (this: t) (pname: Ident.pack_name) (pm: pack_mng) = ( (iks: Ident.long Lxm.srcflagged) = (match ii with | ConstItem n -> ( - SymbolTab.add_import_const pm.pm_body_stab n iks.it; + SymbolTab.add_import_const pm.pm_body_stab px.it n iks.it; match pm.pm_provide_stab with - Some pt -> SymbolTab.add_import_const pt n iks.it + Some pt -> SymbolTab.add_import_const pt px.it n iks.it | None -> () ) | TypeItem n -> ( @@ -343,8 +343,8 @@ init_pack_mng_stabs (this: t) (pname: Ident.pack_name) (pm: pack_mng) = ( (* PUIS LES DECLARATION LOCALES *) (* ... dans le body : *) - Hashtbl.iter (SymbolTab.add_type pm.pm_body_stab) pg.pg_body.pk_type_table; - Hashtbl.iter (SymbolTab.add_const pm.pm_body_stab) pg.pg_body.pk_const_table; + Hashtbl.iter (SymbolTab.add_type pm.pm_body_stab pname) pg.pg_body.pk_type_table; + Hashtbl.iter (SymbolTab.add_const pm.pm_body_stab pname) pg.pg_body.pk_const_table; Hashtbl.iter (SymbolTab.add_node pm.pm_body_stab) pg.pg_body.pk_node_table; (* ... dans le provide : *) match pg.pg_provides with @@ -358,8 +358,8 @@ init_pack_mng_stabs (this: t) (pname: Ident.pack_name) (pm: pack_mng) = ( let lxm = x.src in let s = Lxm.id lxm in match (x.it) with - | TypeInfo xti -> SymbolTab.add_type pptab s (Lxm.flagit xti lxm) - | ConstInfo xci -> SymbolTab.add_const pptab s (Lxm.flagit xci lxm) + | TypeInfo xti -> SymbolTab.add_type pptab pname s (Lxm.flagit xti lxm) + | ConstInfo xci -> SymbolTab.add_const pptab pname s (Lxm.flagit xci lxm) | NodeInfo xoi -> SymbolTab.add_node pptab s (Lxm.flagit xoi lxm) in List.iter treat_prov spflg diff --git a/src/test/should_work/NONREG/packed_cst.lus b/src/test/should_work/NONREG/packed_cst.lus new file mode 100644 index 00000000..8bb52065 --- /dev/null +++ b/src/test/should_work/NONREG/packed_cst.lus @@ -0,0 +1,19 @@ + +package cst + +provides + node cst(x:int) returns (y:int); + +body + const i : int =1 ; + const j : int =1 ; + const k : int =1 ; + + node cst(x:int) returns (y:int); + var z,t: int; + let + z = i+j; + t = j-k; + y = x + 2*z + 3*t; + tel +end \ No newline at end of file diff --git a/src/test/test.res.exp b/src/test/test.res.exp index dcd765ab..46e8974f 100644 --- a/src/test/test.res.exp +++ b/src/test/test.res.exp @@ -32,7 +32,7 @@ function Int8::incr(x:A_bool_8) returns (incr:A_bool_8); var co:bool; let - (co, incr) = (fillred<<Int8::fulladd, 8>>(true, x, zero)); + (co, incr) = (fillred<<Int8::fulladd, 8>>(true, x, Int8::zero)); tel -- end of node Int8::incr function Int8::add(x:A_bool_8; y:A_bool_8) returns (sum:A_bool_8); @@ -289,9 +289,9 @@ let (Watch::WATCH_DAY_TO_ALPHA_DISPLAY(watch_time))) else ( if mode_is_stopwatch then ((Watch::STOPWATCH_TIME_TO_MAIN_DISPLAY(stopwatch_time)), - (Watch::WATCH_TIME_TO_MINI_DISPLAY(watch_time)), stringST) else + (Watch::WATCH_TIME_TO_MINI_DISPLAY(watch_time)), Watch::stringST) else ((Watch::ALARM_TIME_TO_MAIN_DISPLAY(alarm_time)), - (Watch::WATCH_TIME_TO_MINI_DISPLAY(watch_time)), stringAL))); + (Watch::WATCH_TIME_TO_MINI_DISPLAY(watch_time)), Watch::stringAL))); tel -- end of node Watch::DISPLAY extern function Watch::SOMME(i1:int; i2:int; i3:int) returns (somme:int); @@ -350,17 +350,18 @@ let internal_status = (0 -> ( if toggle_alarm then ( if ((pre internal_status) = 0) then 1 else 0) else ( if ((Watch::EDGE((not in_set))) and ((pre internal_status) = 0)) then 1 else (pre internal_status)))); - count = (0 -> ( if start_beeping then ALARM_DURATION else ( if (((pre - count) <> 0) and second) then ((pre count) - 1) else (0 -> (pre count))))); + count = (0 -> ( if start_beeping then Watch::ALARM_DURATION else ( if + (((pre count) <> 0) and second) then ((pre count) - 1) else (0 -> (pre + count))))); time_out = (false -> (((pre count) <> 0) and (count = 0))); beep = ( if ((Watch::TWO_STATES(false, start_beeping, (stop_beep or time_out))) and second) then 4 else 0); - time = (INITIAL_ALARM_TIME -> ( if toggle_24h then + time = (Watch::INITIAL_ALARM_TIME -> ( if toggle_24h then (Watch::TOGGLE_24H_IN_ALARM_MODE((pre time))) else ( if set then (Watch::SET_ALARM_TIME((pre time), position_set)) else (pre time)))); enhance = position_set; position_set = ( if (true -> (Watch::EDGE(in_set))) then - INITIAL_ALARM_POSITION else ( if next_position then + Watch::INITIAL_ALARM_POSITION else ( if next_position then (Watch::NEXT_ALARM_TIME_POSITION((pre position_set))) else (pre position_set))); tel @@ -447,8 +448,8 @@ let chime_is_set = (internal_chime_is_set = 1); beep = ( if second then ( if ((Watch::IS_O_CLOCK(time)) and chime_is_set) then 2 else 0) else 0); - time = (INITIAL_WATCH_TIME -> ( if (not in_set) then ( if second then - (Watch::INCREMENT_WATCH_TIME((pre time))) else ( if toggle_24h then + time = (Watch::INITIAL_WATCH_TIME -> ( if (not in_set) then ( if second + then (Watch::INCREMENT_WATCH_TIME((pre time))) else ( if toggle_24h then (Watch::TOGGLE_24H_IN_WATCH_MODE((pre time))) else ( if (Watch::EDGE((not in_set))) then (Watch::CONFIRM_TIME((pre time))) else (pre time)))) else ( if second then (Watch::INCREMENT_WATCH_TIME_IN_SET_MODE((pre time), @@ -456,7 +457,7 @@ let position_set)) else (pre time))))); enhance = position_set; position_set = ( if (true -> (Watch::EDGE(in_set))) then - INITIAL_WATCH_POSITION else ( if next_position then + Watch::INITIAL_WATCH_POSITION else ( if next_position then (Watch::NEXT_WATCH_TIME_POSITION((pre position_set))) else (pre position_set))); tel @@ -485,8 +486,8 @@ let run_state = (Watch::TWO_STATES(false, start_stop, start_stop)); lap_state = (Watch::TWO_STATES(false, (lap and run_state), lap)); time = (current (internal_time when lap_state)); - internal_time = ( if (true -> reset) then INITIAL_STOPWATCH_TIME else ( if - (run_state and hs) then (Watch::INCREMENT_STOPWATCH_TIME((pre + internal_time = ( if (true -> reset) then Watch::INITIAL_STOPWATCH_TIME + else ( if (run_state and hs) then (Watch::INCREMENT_STOPWATCH_TIME((pre internal_time))) else (pre internal_time))); must_beep = ( if start_stop then true else ( if (hs and run_state) then (Watch::IS_ZERO_MOD_10_MN(internal_time)) else false)); @@ -603,7 +604,7 @@ let (Watch::WATCH_TO_DISPLAY_POS(watch_position_enhanced)) else ( if mode_is_set_alarm then (Watch::ALARM_TO_DISPLAY_POS(alarm_position_enhanced)) else - NULL_POSITION)); + Watch::NULL_POSITION)); status = (Watch::STATUS(alarm_is_set, chime_is_set, stopwatch_running, stopwatch_lapping)); (watch_time, watch_position_enhanced, chime_is_set, chime_beep) = @@ -830,14 +831,14 @@ let vigilence_partielle = (alarme::bascule(false, ((alarme::edge(en_marche)) or (alarme::edge(demande_entree))), ((pre tps_vigilence) = 0))); tps_vigilence = (alarme::decompte(((alarme::edge(en_marche)) or - (alarme::edge(demande_entree))), delai_vigilence, (en_marche and ((pre - tps_vigilence) > 0)))); - tps_alarme = (alarme::decompte((alarme::edge(alarme)), delai_alarme, ((pre - alarme) and ((pre tps_alarme) > 0)))); + (alarme::edge(demande_entree))), alarme::delai_vigilence, (en_marche and + ((pre tps_vigilence) > 0)))); + tps_alarme = (alarme::decompte((alarme::edge(alarme)), + alarme::delai_alarme, ((pre alarme) and ((pre tps_alarme) > 0)))); reprise = (alarme::bascule(false, ((pre alarme) and ((pre tps_alarme) = 0)), ((pre tps_reprise) = 0))); - tps_reprise = (alarme::decompte((alarme::edge(reprise)), delai_reprise, - ((pre reprise) and (pre (tps_reprise > 0))))); + tps_reprise = (alarme::decompte((alarme::edge(reprise)), + alarme::delai_reprise, ((pre reprise) and (pre (tps_reprise > 0))))); alarme = (false -> ( if ((en_marche and (not reprise)) and (pb_hab or (pb_tmp and (not vigilence_partielle)))) then true else ( if ((pre alarme) and (((pre tps_alarme) = 0) or (alarme::edge((not en_marche))))) then false @@ -1206,8 +1207,8 @@ var z:int; t:int; let - z = (i + j); - t = (j - k); + z = (cst::i + cst::j); + t = (cst::j - cst::k); y = ((x + (2 * z)) + (3 * t)); tel -- end of node cst::cst @@ -1240,8 +1241,8 @@ let teta = 3.14; x0 = 0.; y0 = 0.; - x = (x0 + (L * (deconne::sin(teta)))); - y = (y0 + (L * (deconne::cos(teta)))); + x = (x0 + (deconne::L * (deconne::sin(teta)))); + y = (y0 + (deconne::L * (deconne::cos(teta)))); p = (deconne::make_pend(x0, y0, x, y)); tel -- end of node deconne::deconne @@ -1340,8 +1341,10 @@ type _enum::couleur = enum {enum::bleu, enum::blanc, enum::rouge}; type _enum::color = enum {enum::blue, enum::white, enum::redd}; node enum::boo(e:int) returns (c:_enum::couleur; c2:_enum::color); let - c = ( if (e = 0) then bleu else ( if (e = 1) then blanc else rouge)); - c2 = ( if (e = 0) then blue else ( if (e = 1) then white else redd)); + c = ( if (e = 0) then enum::bleu else ( if (e = 1) then enum::blanc else + enum::rouge)); + c2 = ( if (e = 0) then enum::blue else ( if (e = 1) then enum::white else + enum::redd)); tel -- end of node enum::boo @@ -2597,8 +2600,8 @@ var z:int; t:int; let - z = (i + j); - t = (j - k); + z = (cst::i + cst::j); + t = (cst::j - cst::k); y = ((x + (2 * z)) + (3 * t)); tel -- end of node cst::cst @@ -2766,7 +2769,7 @@ tel -- end of node test::tutu node test::toto(x:bool) returns (y:bool); let - y = ((test::tutu(x)) and c); + y = ((test::tutu(x)) and test::c); tel -- end of node test::toto @@ -2961,7 +2964,7 @@ node heater_control::not_a_sauna2( returns ( ok:bool); let - ok = (true -> ((pre T) < (TMAX - 6.0))); + ok = (true -> ((pre T) < (heater_control::TMAX - 6.0))); tel -- end of node heater_control::not_a_sauna2 node heater_control::min2(one:real; two:real) returns (m:real); @@ -3038,19 +3041,19 @@ var V23:bool; Tguess:real; let - V12 = ((heater_control::abs((T1 - T2))) < DELTA); - V13 = ((heater_control::abs((T1 - T3))) < DELTA); - V23 = ((heater_control::abs((T2 - T3))) < DELTA); - Tguess = ( if (heater_control::noneoftree(V12, V13, V23)) then FAILURE - else ( if (heater_control::oneoftree(V12, V13, V23)) then - (heater_control::Median(T1, T2, T3)) else ( if + V12 = ((heater_control::abs((T1 - T2))) < heater_control::DELTA); + V13 = ((heater_control::abs((T1 - T3))) < heater_control::DELTA); + V23 = ((heater_control::abs((T2 - T3))) < heater_control::DELTA); + Tguess = ( if (heater_control::noneoftree(V12, V13, V23)) then + heater_control::FAILURE else ( if (heater_control::oneoftree(V12, V13, + V23)) then (heater_control::Median(T1, T2, T3)) else ( if (heater_control::alloftree(V12, V13, V23)) then (heater_control::Median(T1, T2, T3)) else ( if V12 then (heater_control::Average(T1, T2)) else ( if V13 then (heater_control::Average(T1, T3)) else (heater_control::Average(T2, T3))))))); - Heat_on = (true -> ( if (Tguess = FAILURE) then false else ( if (Tguess < - TMIN) then true else ( if (Tguess > TMAX) then false else (pre - Heat_on))))); + Heat_on = (true -> ( if (Tguess = heater_control::FAILURE) then false else + ( if (Tguess < heater_control::TMIN) then true else ( if (Tguess > + heater_control::TMAX) then false else (pre Heat_on))))); tel -- end of node heater_control::heater_control @@ -3063,7 +3066,7 @@ node heater_control::not_a_sauna( returns ( ok:bool); let - ok = (true -> ((pre T) < (TMAX + 1.0))); + ok = (true -> ((pre T) < (heater_control::TMAX + 1.0))); tel -- end of node heater_control::not_a_sauna @@ -3338,8 +3341,8 @@ var three_roll:bool; cpt_roll:int; let - cpt_roll = (0 -> ( if three_roll then SAFE_COUNTER_TIME else ( if ((pre - cpt_roll) > 0) then ((pre cpt_roll) - 1) else 0))); + cpt_roll = (0 -> ( if three_roll then onlyroll::SAFE_COUNTER_TIME else ( + if ((pre cpt_roll) > 0) then ((pre cpt_roll) - 1) else 0))); zero_roll = (onlyroll::noneof(f1, f2, f3, f4)); one_roll = (onlyroll::oneoffour(f1, f2, f3, f4)); two_roll = (onlyroll::twooffour(f1, f2, f3, f4)); @@ -3348,7 +3351,7 @@ let x2, x3, x4)) else ( if (one_roll and (cpt_roll = 0)) then (onlyroll::Median(x1, x2, x3, x4, f1, f2, f3, f4)) else ( if (two_roll and (cpt_roll = 0)) then (onlyroll::Average(x1, x2, x3, x4, f1, f2, f3, f4)) - else FAIL_SAFE_ROLL_VALUE))); + else onlyroll::FAIL_SAFE_ROLL_VALUE))); tel -- end of node onlyroll::Calculate node onlyroll::abs(v:real) returns (a:real); @@ -3373,14 +3376,14 @@ returns ( local_value:real; inline_monitor_failed:bool); let - inline_monitor_failed = ((onlyroll::maintain(TIME_ROLL, - ((onlyroll::abs((xa - xb))) > DELTA_ROLL))) or disc); + inline_monitor_failed = ((onlyroll::maintain(onlyroll::TIME_ROLL, + ((onlyroll::abs((xa - xb))) > onlyroll::DELTA_ROLL))) or disc); local_value = xa; tel -- end of node onlyroll::Monitor node onlyroll::InNominalRange(r:real) returns (i:bool); let - i = ((r < NRmaxR) and (r > NRminR)); + i = ((r < onlyroll::NRmaxR) and (r > onlyroll::NRminR)); tel -- end of node onlyroll::InNominalRange @@ -3399,14 +3402,14 @@ var two:bool; three:bool; let - one = ((onlyroll::abs((xi - pxother1))) > CROSS_CH_TOL_ROLL); - two = ((onlyroll::abs((xi - pxother2))) > CROSS_CH_TOL_ROLL); - three = ((onlyroll::abs((xi - pxother3))) > CROSS_CH_TOL_ROLL); - r = (onlyroll::maintain(TIME_CROSS_ROLL, ( if pfother1 then ( if pfother2 - then ( if pfother3 then false else three) else ( if pfother3 then two else - (two and three))) else ( if pfother2 then ( if pfother3 then one else (one - and three)) else ( if pfother3 then (one and two) else ((one and two) and - three)))))); + one = ((onlyroll::abs((xi - pxother1))) > onlyroll::CROSS_CH_TOL_ROLL); + two = ((onlyroll::abs((xi - pxother2))) > onlyroll::CROSS_CH_TOL_ROLL); + three = ((onlyroll::abs((xi - pxother3))) > onlyroll::CROSS_CH_TOL_ROLL); + r = (onlyroll::maintain(onlyroll::TIME_CROSS_ROLL, ( if pfother1 then ( if + pfother2 then ( if pfother3 then false else three) else ( if pfother3 then + two else (two and three))) else ( if pfother2 then ( if pfother3 then one + else (one and three)) else ( if pfother3 then (one and two) else ((one and + two) and three)))))); tel -- end of node onlyroll::values_nok @@ -3610,7 +3613,7 @@ tel -- end of node onlyroll::onlyroll node onlyroll::InHardoverRange(r:real) returns (i:bool); let - i = ((r > HORmaxR) or (r < HORminR)); + i = ((r > onlyroll::HORmaxR) or (r < onlyroll::HORminR)); tel -- end of node onlyroll::InHardoverRange @@ -3731,8 +3734,8 @@ const t::A = [[1, 1], [1, 1], [1, 1]]; const t::B = [2, 2]; node t::toto(x:bool) returns (a:A_A_int_2_3; b:A_int_2); let - a = A; - b = B; + a = t::A; + b = t::B; tel -- end of node t::toto -- automatically defined aliases: @@ -4275,7 +4278,7 @@ returns ( let acc_out = acc_in; diff = ((Gyroscope2::abs((acc_in.local_value - channel.local_value))) > - CROSS_CHANNEL_TOLERANCE); + Gyroscope2::CROSS_CHANNEL_TOLERANCE); tel -- end of node Gyroscope2::compare_rolls @@ -4440,12 +4443,15 @@ returns ( var secure_values:A_real_3; let - secure_values = (map<<Gyroscope2::EvaluateAxis, 3>>(axis, ([DELTA_ROLL, - DELTA_PITCH, DELTA_YAW]), ([GOD_ROLL, GOD_PITCH, GOD_YAW]), - ([DELTA_TO_GOD_ROLL, DELTA_TO_GOD_PITCH, DELTA_TO_GOD_YAW]))); + secure_values = (map<<Gyroscope2::EvaluateAxis, 3>>(axis, + ([Gyroscope2::DELTA_ROLL, Gyroscope2::DELTA_PITCH, Gyroscope2::DELTA_YAW]), + ([Gyroscope2::GOD_ROLL, Gyroscope2::GOD_PITCH, Gyroscope2::GOD_YAW]), + ([Gyroscope2::DELTA_TO_GOD_ROLL, Gyroscope2::DELTA_TO_GOD_PITCH, + Gyroscope2::DELTA_TO_GOD_YAW]))); valid = (red<<Gyroscope2::ValueIsSecureII, 3>>(true, secure_values, - ([DELTA_TO_GOD_ROLL, DELTA_TO_GOD_PITCH, DELTA_TO_GOD_YAW]), ([GOD_ROLL, - GOD_PITCH, GOD_YAW]))); + ([Gyroscope2::DELTA_TO_GOD_ROLL, Gyroscope2::DELTA_TO_GOD_PITCH, + Gyroscope2::DELTA_TO_GOD_YAW]), ([Gyroscope2::GOD_ROLL, + Gyroscope2::GOD_PITCH, Gyroscope2::GOD_YAW]))); tel -- end of node Gyroscope2::Gyroscope2 @@ -4505,7 +4511,7 @@ node alias::alias(a:bool) returns (b:bool; c:int); let b = (alias::aliasPredefNot(a)); c = (alias::aliasGivenNode(0, (map<<Lustre::iplus, 3>>((0^3), - (SIZE^3))))); + (alias::SIZE^3))))); tel -- end of node alias::alias -- automatically defined aliases: @@ -5897,8 +5903,8 @@ var three_roll:bool; cpt_roll:int; let - cpt_roll = (0 -> ( if three_roll then SAFE_COUNTER_TIME else ( if ((pre - cpt_roll) > 0) then ((pre cpt_roll) - 1) else 0))); + cpt_roll = (0 -> ( if three_roll then onlyroll::SAFE_COUNTER_TIME else ( + if ((pre cpt_roll) > 0) then ((pre cpt_roll) - 1) else 0))); zero_roll = (onlyroll::noneof(f1, f2, f3, f4)); one_roll = (onlyroll::oneoffour(f1, f2, f3, f4)); two_roll = (onlyroll::twooffour(f1, f2, f3, f4)); @@ -5907,7 +5913,7 @@ let x2, x3, x4)) else ( if (one_roll and (cpt_roll = 0)) then (onlyroll::Median(x1, x2, x3, x4, f1, f2, f3, f4)) else ( if (two_roll and (cpt_roll = 0)) then (onlyroll::Average(x1, x2, x3, x4, f1, f2, f3, f4)) - else FAIL_SAFE_ROLL_VALUE))); + else onlyroll::FAIL_SAFE_ROLL_VALUE))); tel -- end of node onlyroll::Calculate node onlyroll::abs(v:real) returns (a:real); @@ -5932,14 +5938,14 @@ returns ( local_value:real; inline_monitor_failed:bool); let - inline_monitor_failed = ((onlyroll::maintain(TIME_ROLL, - ((onlyroll::abs((xa - xb))) > DELTA_ROLL))) or disc); + inline_monitor_failed = ((onlyroll::maintain(onlyroll::TIME_ROLL, + ((onlyroll::abs((xa - xb))) > onlyroll::DELTA_ROLL))) or disc); local_value = xa; tel -- end of node onlyroll::Monitor node onlyroll::InNominalRange(r:real) returns (i:bool); let - i = ((r < NRmaxR) and (r > NRminR)); + i = ((r < onlyroll::NRmaxR) and (r > onlyroll::NRminR)); tel -- end of node onlyroll::InNominalRange @@ -5958,14 +5964,14 @@ var two:bool; three:bool; let - one = ((onlyroll::abs((xi - pxother1))) > CROSS_CH_TOL_ROLL); - two = ((onlyroll::abs((xi - pxother2))) > CROSS_CH_TOL_ROLL); - three = ((onlyroll::abs((xi - pxother3))) > CROSS_CH_TOL_ROLL); - r = (onlyroll::maintain(TIME_CROSS_ROLL, ( if pfother1 then ( if pfother2 - then ( if pfother3 then false else three) else ( if pfother3 then two else - (two and three))) else ( if pfother2 then ( if pfother3 then one else (one - and three)) else ( if pfother3 then (one and two) else ((one and two) and - three)))))); + one = ((onlyroll::abs((xi - pxother1))) > onlyroll::CROSS_CH_TOL_ROLL); + two = ((onlyroll::abs((xi - pxother2))) > onlyroll::CROSS_CH_TOL_ROLL); + three = ((onlyroll::abs((xi - pxother3))) > onlyroll::CROSS_CH_TOL_ROLL); + r = (onlyroll::maintain(onlyroll::TIME_CROSS_ROLL, ( if pfother1 then ( if + pfother2 then ( if pfother3 then false else three) else ( if pfother3 then + two else (two and three))) else ( if pfother2 then ( if pfother3 then one + else (one and three)) else ( if pfother3 then (one and two) else ((one and + two) and three)))))); tel -- end of node onlyroll::values_nok @@ -6168,7 +6174,7 @@ tel -- end of node onlyroll::onlyroll node onlyroll::InHardoverRange(r:real) returns (i:bool); let - i = ((r > HORmaxR) or (r < HORminR)); + i = ((r > onlyroll::HORmaxR) or (r < onlyroll::HORminR)); tel -- end of node onlyroll::InHardoverRange @@ -6381,8 +6387,8 @@ var three_roll:bool; cpt_roll:int; let - cpt_roll = (0 -> ( if three_roll then SAFE_COUNTER_TIME else ( if ((pre - cpt_roll) > 0) then ((pre cpt_roll) - 1) else 0))); + cpt_roll = (0 -> ( if three_roll then onlyroll2::SAFE_COUNTER_TIME else ( + if ((pre cpt_roll) > 0) then ((pre cpt_roll) - 1) else 0))); zero_roll = (onlyroll2::noneof(f1, f2, f3, f4)); one_roll = (onlyroll2::oneoffour(f1, f2, f3, f4)); two_roll = (onlyroll2::twooffour(f1, f2, f3, f4)); @@ -6391,7 +6397,7 @@ let (onlyroll2::OlympicAverage(x1, x2, x3, x4)) else ( if (one_roll and (cpt_roll = 0)) then (onlyroll2::Median(x1, x2, x3, x4, f1, f2, f3, f4)) else ( if (two_roll and (cpt_roll = 0)) then (onlyroll2::Average(x1, x2, - x3, x4, f1, f2, f3, f4)) else FAIL_SAFE_ROLL_VALUE))); + x3, x4, f1, f2, f3, f4)) else onlyroll2::FAIL_SAFE_ROLL_VALUE))); tel -- end of node onlyroll2::Calculate node onlyroll2::abs(v:real) returns (a:real); @@ -6416,14 +6422,14 @@ returns ( local_value:real; inline_monitor_failed:bool); let - inline_monitor_failed = ((onlyroll2::maintain(TIME_ROLL, - ((onlyroll2::abs((xa - xb))) > DELTA_ROLL))) or disc); + inline_monitor_failed = ((onlyroll2::maintain(onlyroll2::TIME_ROLL, + ((onlyroll2::abs((xa - xb))) > onlyroll2::DELTA_ROLL))) or disc); local_value = xa; tel -- end of node onlyroll2::Monitor node onlyroll2::InNominalRange(r:real) returns (i:bool); let - i = ((r < NRmaxR) and (r > NRminR)); + i = ((r < onlyroll2::NRmaxR) and (r > onlyroll2::NRminR)); tel -- end of node onlyroll2::InNominalRange @@ -6442,14 +6448,15 @@ var two:bool; three:bool; let - one = ((onlyroll2::abs((xi - pxother1))) > CROSS_CH_TOL_ROLL); - two = ((onlyroll2::abs((xi - pxother2))) > CROSS_CH_TOL_ROLL); - three = ((onlyroll2::abs((xi - pxother3))) > CROSS_CH_TOL_ROLL); - r = (onlyroll2::maintain(TIME_CROSS_ROLL, ( if pfother1 then ( if pfother2 - then ( if pfother3 then false else three) else ( if pfother3 then two else - (two and three))) else ( if pfother2 then ( if pfother3 then one else (one - and three)) else ( if pfother3 then (one and two) else ((one and two) and - three)))))); + one = ((onlyroll2::abs((xi - pxother1))) > onlyroll2::CROSS_CH_TOL_ROLL); + two = ((onlyroll2::abs((xi - pxother2))) > onlyroll2::CROSS_CH_TOL_ROLL); + three = ((onlyroll2::abs((xi - pxother3))) > + onlyroll2::CROSS_CH_TOL_ROLL); + r = (onlyroll2::maintain(onlyroll2::TIME_CROSS_ROLL, ( if pfother1 then ( + if pfother2 then ( if pfother3 then false else three) else ( if pfother3 + then two else (two and three))) else ( if pfother2 then ( if pfother3 then + one else (one and three)) else ( if pfother3 then (one and two) else ((one + and two) and three)))))); tel -- end of node onlyroll2::values_nok @@ -6653,7 +6660,7 @@ tel -- end of node onlyroll2::onlyroll2 node onlyroll2::InHardoverRange(r:real) returns (i:bool); let - i = ((r > HORmaxR) or (r < HORminR)); + i = ((r > onlyroll2::HORmaxR) or (r < onlyroll2::HORminR)); tel -- end of node onlyroll2::InHardoverRange @@ -6946,8 +6953,8 @@ returns ( var maintain:bool; let - maintain = (Gyroscope::Maintain(TIME, ((Gyroscope::abs((inChannel.valuea - - inChannel.valueb))) > delta))); + maintain = (Gyroscope::Maintain(Gyroscope::TIME, + ((Gyroscope::abs((inChannel.valuea - inChannel.valueb))) > delta))); outChannel = Valid_ChannelT{local_failure=maintain;local_value=( if maintain then 0.0 else ((inChannel.valuea + inChannel.valueb) / 2.0))}; tel @@ -7037,12 +7044,15 @@ returns ( var secure_values:A_real_3; let - secure_values = (map<<Gyroscope::EvaluateAxis, 3>>(axis, ([DELTA_ROLL, - DELTA_PITCH, DELTA_YAW]), ([GOD_ROLL, GOD_PITCH, GOD_YAW]), - ([DELTA_TO_GOD_ROLL, DELTA_TO_GOD_PITCH, DELTA_TO_GOD_YAW]))); + secure_values = (map<<Gyroscope::EvaluateAxis, 3>>(axis, + ([Gyroscope::DELTA_ROLL, Gyroscope::DELTA_PITCH, Gyroscope::DELTA_YAW]), + ([Gyroscope::GOD_ROLL, Gyroscope::GOD_PITCH, Gyroscope::GOD_YAW]), + ([Gyroscope::DELTA_TO_GOD_ROLL, Gyroscope::DELTA_TO_GOD_PITCH, + Gyroscope::DELTA_TO_GOD_YAW]))); valid = (red<<Gyroscope::ValueIsSecureII, 3>>(true, secure_values, - ([DELTA_TO_GOD_ROLL, DELTA_TO_GOD_PITCH, DELTA_TO_GOD_YAW]), ([GOD_ROLL, - GOD_PITCH, GOD_YAW]))); + ([Gyroscope::DELTA_TO_GOD_ROLL, Gyroscope::DELTA_TO_GOD_PITCH, + Gyroscope::DELTA_TO_GOD_YAW]), ([Gyroscope::GOD_ROLL, Gyroscope::GOD_PITCH, + Gyroscope::GOD_YAW]))); tel -- end of node Gyroscope::Gyroscope @@ -7218,7 +7228,7 @@ let Tacc_inShift2{multiplieur=acc_in.multiplieur;rank=acc_in.rank;actual_rank=(acc_in.actual_rank + 1)}; elt_out = ( if ((acc_in.actual_rank >= acc_in.rank) and - (acc_in.actual_rank < (acc_in.rank + size))) then + (acc_in.actual_rank < (acc_in.rank + produitBool::size))) then (produitBool::selectElementOfRank_inArray_((acc_in.actual_rank - acc_in.rank), acc_in.multiplieur)) else false); tel @@ -7316,7 +7326,7 @@ let T2_STRUCT{multiplieur=i_acc_in.multiplieur;rank=i_acc_in.rank;actual_rank=(i_acc_in.actual_rank + 1)}; o_elt_out = ( if ((i_acc_in.actual_rank >= i_acc_in.rank) and - (i_acc_in.actual_rank < (i_acc_in.rank + c_size))) then + (i_acc_in.actual_rank < (i_acc_in.rank + shiftFill_ludic::c_size))) then (shiftFill_ludic::n_selectElementOfRank_inArray_(i_acc_in.actual_rank, i_acc_in.multiplieur)) else false); tel @@ -7378,7 +7388,7 @@ let T2_STRUCT{multiplieur=i_acc_in.multiplieur;rank=i_acc_in.rank;actual_rank=(i_acc_in.actual_rank + 1)}; o_elt_out = ( if ((i_acc_in.actual_rank >= i_acc_in.rank) and - (i_acc_in.actual_rank < (i_acc_in.rank + c_size))) then + (i_acc_in.actual_rank < (i_acc_in.rank + shift_ludic::c_size))) then (shift_ludic::n_selectElementOfRank_inArray_(i_acc_in.actual_rank, i_acc_in.multiplieur)) else false); tel @@ -7906,7 +7916,7 @@ returns ( var Vide:A_int_20; let - Vide = (COM_ERR^20); + Vide = (normal::COM_ERR^20); TabComChg = (red<<normal::fusion_tab_com, 4>>(Vide, AllTabComChg, AllTabComVal)); tel @@ -8400,7 +8410,7 @@ returns ( var Vide:A_int_20; let - Vide = (COM_ERR^20); + Vide = (testSilus::COM_ERR^20); TabComChg = (red<<testSilus::fusion_tab_com, 4>>(Vide, AllTabComChg, AllTabComVal)); tel @@ -9223,7 +9233,7 @@ returns ( let oint = (Pint::n(0, i)); obool = (Pbool::n(true, (i < 50))); - oreal = (Preal::n(0., (0. -> ((pi * ray) * ray)))); + oreal = (Preal::n(0., (0. -> ((main::pi * ray) * ray)))); tel -- end of node main::main @@ -9322,14 +9332,14 @@ const asservi::L = 2.000000; const asservi::T = 0.100000; node asservi::D(x:real) returns (d:real); let - d = (0.0 -> ((x - (pre x)) / T)); + d = (0.0 -> ((x - (pre x)) / asservi::T)); tel -- end of node asservi::D extern function asservi::sin(x:real) returns (y:real); extern function asservi::cos(x:real) returns (y:real); node asservi::I(dx:real) returns (x:real); let - x = (0.0 -> (pre ((T * dx) + x))); + x = (0.0 -> (pre ((asservi::T * dx) + x))); tel -- end of node asservi::I node asservi::I2(d2x:real) returns (x:real); @@ -9337,13 +9347,13 @@ var dx:real; let dx = (asservi::I(d2x)); - x = (dx -> ((T * dx) + (pre x))); + x = (dx -> ((asservi::T * dx) + (pre x))); tel -- end of node asservi::I2 node asservi::PEND(d2x0:real; d2y0:real) returns (teta:real); let - teta = (asservi::I2(((((asservi::sin(teta)) * (d2y0 + G)) - - ((asservi::cos(teta)) * d2x0)) / L))); + teta = (asservi::I2(((((asservi::sin(teta)) * (d2y0 + asservi::G)) - + ((asservi::cos(teta)) * d2x0)) / asservi::L))); tel -- end of node asservi::PEND @@ -9365,8 +9375,8 @@ let d2x0 = (asservi::D((asservi::D(x0)))); d2y0 = (asservi::D((asservi::D(y0)))); teta = (asservi::PEND(d2x0, d2y0)); - x = (x0 + (L * (asservi::sin(teta)))); - y = (y0 + (L * (asservi::cos(teta)))); + x = (x0 + (asservi::L * (asservi::sin(teta)))); + y = (y0 + (asservi::L * (asservi::cos(teta)))); p = (asservi::make_pend(x0, y0, x, y)); tel -- end of node asservi::jeu @@ -9382,12 +9392,12 @@ var y:real; let d2y0 = 0.0; - d2x0 = (delta -> (((((8.0 * G) * (asservi::sin(teta))) / - (asservi::cos(teta))) + ((asservi::sqrt(((1.0 * G) * L))) * - (asservi::D(teta)))) + ((0.5 * x0) / L))); + d2x0 = (delta -> (((((8.0 * asservi::G) * (asservi::sin(teta))) / + (asservi::cos(teta))) + ((asservi::sqrt(((1.0 * asservi::G) * asservi::L))) + * (asservi::D(teta)))) + ((0.5 * x0) / asservi::L))); teta = (asservi::PEND((delta -> d2x0), d2y0)); - x = (x0 + (L * (asservi::sin(teta)))); - y = (y0 + (L * (asservi::cos(teta)))); + x = (x0 + (asservi::L * (asservi::sin(teta)))); + y = (y0 + (asservi::L * (asservi::cos(teta)))); x0 = (asservi::I2(d2x0)); y0 = (asservi::I2(d2y0)); p = (asservi::make_pend(x0, y0, x, y)); @@ -9562,8 +9572,8 @@ let begin = (active -> (bug::edge_detect(active))); en = (bug::edge_detect((not active))); alarm = (not (bug::once_from_to(action, begin, en))); - (intO, realO) = ((((ze_const_int + x) + y), ((10.0 - 10.0) - 10.0)) -> - (intI, ((pre realO) * realI))); + (intO, realO) = ((((bug::ze_const_int + x) + y), ((10.0 - 10.0) - 10.0)) + -> (intI, ((pre realO) * realI))); x = (0 -> ( if active then y else ((pre x) + 1))); y = (1 -> ( if active then ((pre y) + 1) else x)); tel -- GitLab