diff --git a/src/evalClock.ml b/src/evalClock.ml index 5bccfbe0bcdf61f4ad88bceb780739bbd5d7daec..c49f6c35df18f0b34383f2cbff88fe25f9298b03 100644 --- a/src/evalClock.ml +++ b/src/evalClock.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 19/08/2008 (at 16:33) by Erwan Jahier> *) +(** Time-stamp: <modified the 19/08/2008 (at 17:23) by Erwan Jahier> *) open Predef @@ -231,7 +231,7 @@ let rec (f : id_solver -> subst -> val_exp_eff -> clock_eff list * subst) = (fun ve cel -> let cel2 = List.map (apply_subst2 s) cel in if cel <> cel2 then - Hashtbl.replace val_exp_eff_clk_tab ve cel) + Hashtbl.replace val_exp_eff_clk_tab ve cel2) val_exp_eff_clk_tab; res @@ -350,10 +350,10 @@ and (eval_by_pos_clock : id_solver -> by_pos_op_eff -> Lxm.t -> val_exp_eff list let clk_args, s = f_list id_solver s args in let flat_clk_args = List.flatten clk_args in (* => mono-clock! *) - let clk_list = - if args = [] then [] else + let clk_list, s = + if args = [] then [],s else let _clk,s = UnifyClock.list lxm flat_clk_args s in - List.map (List.map (apply_subst s)) clk_args + List.map (List.map (apply_subst s)) clk_args, s in PredefEvalClock.f op lxm sargs clk_list, s diff --git a/src/licDump.ml b/src/licDump.ml index e77b066158b457be940d5fe058f5a044db62d2b6..7258f83c0da1ea85ff6b58013d542e6469ea84ea 100644 --- a/src/licDump.ml +++ b/src/licDump.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 19/08/2008 (at 15:58) by Erwan Jahier> *) +(** Time-stamp: <modified the 19/08/2008 (at 17:25) by Erwan Jahier> *) open CompiledData open Printf @@ -457,7 +457,9 @@ and string_of_clock (ck : clock_eff) = | BaseEff -> "" | On(_,BaseEff) -> "" | On(v,On(id,_)) ->" when " ^ (Ident.to_string id) - | _ -> assert false +(* | On(v,ClockVar i) -> " when _clock_var_"^ (string_of_int i) *) +(* | ClockVar i -> "_clock_var_" ^ (string_of_int i) *) + | _ -> assert false and string_of_clock_list cl = diff --git a/src/test/test.res.exp b/src/test/test.res.exp index 13f90f27e99bf8b4e2c9963a83bf12bf24890f8b..04df38e3b5f0d08e9df7237b834c68a5dfe3f314 100644 --- a/src/test/test.res.exp +++ b/src/test/test.res.exp @@ -9698,7 +9698,7 @@ type A_bool_10 = bool^10; Opening file should_work/clock/clock2.lus node clock2::clock(a:int; b:int) returns (c:int when a); var - _v1:int; + _v1:int when a; _v2:int when a; let c = (_v1 + _v2); diff --git a/src/unifyClock.ml b/src/unifyClock.ml index 75865aea737e1198ae83f88b324bba2cc043eec6..de10f6870485e9e5e06c588b8e7f846bb3bc1799 100644 --- a/src/unifyClock.ml +++ b/src/unifyClock.ml @@ -1,4 +1,4 @@ -(** Time-stamp: <modified the 19/08/2008 (at 16:32) by Erwan Jahier> *) +(** Time-stamp: <modified the 19/08/2008 (at 16:54) by Erwan Jahier> *) open SyntaxTree @@ -53,14 +53,14 @@ let rec (apply_subst:subst -> clock_eff -> clock_eff) = try apply_subst (s1,s2) (List.assoc i s2) with Not_found -> c -(* only apply the part of the subst that deals with clock var *) +(* exported *) let rec (apply_subst2:subst -> clock_eff -> clock_eff) = fun (s1,s2) c -> match c with | BaseEff -> BaseEff - | On(v,clk) -> On(v, apply_subst (s1,s2) clk) + | On(v,clk) -> On(v, apply_subst2 (s1,s2) clk) | ClockVar i -> - try apply_subst (s1,s2) (List.assoc i s2) + try apply_subst2 (s1,s2) (List.assoc i s2) with Not_found -> c (* exported *)