Commit 646cfab8 authored by Léonard Gérard's avatar Léonard Gérard Committed by Léonard Gérard

Enforce style : no tab, no trailing whitespace.

parent 3bc58241
......@@ -134,7 +134,7 @@ let rec last_clock ct = match ct with
E.g. .... on C1(x) and .... on C2(x) are. *)
let same_control ck1 ck2 = match ck_repr ck1, ck_repr ck2 with
| Cbase, Cbase -> true
| Con(_,_,x1), Con(_,_,x2) -> x1 = x2
| Con(_,_,x1), Con(_,_,x2) -> x1 = x2
| Cvar {contents = Cindex i1}, Cvar {contents = Cindex i2} -> i1 = i2
| _ -> false
......
......@@ -73,17 +73,17 @@ let ident_list_of_pat pat =
let rec typing h pat e =
let ct,base = match e.e_desc with
| Econst _ ->
let ck = fresh_clock() in
Ck ck, ck
let ck = fresh_clock() in
Ck ck, ck
| Evar x ->
let ck = ck_of_name h x in
Ck ck, ck
let ck = ck_of_name h x in
Ck ck, ck
| Efby (e1, e2) ->
let ct,ck = typing h pat e1 in
expect h pat ct e2;
expect h pat ct e2;
ct, ck
| Epre(_,e) ->
typing h pat e
typing h pat e
| Ewhen (e,c,n) ->
let ck_n = ck_of_name h n in
let base = expect h pat (skeleton ck_n e.e_ty) e in
......@@ -108,27 +108,27 @@ let rec typing h pat e =
| Imapi -> (* clocking the node with the extra i input on [ck_r] *)
let il (* stubs i as 0 *) =
List.map (fun x -> mk_exp
(Econst (Initial.mk_static_int 0))
~ct_annot:(Some(Ck(base_ck)))
Initial.tint
(Econst (Initial.mk_static_int 0))
~ct_annot:(Some(Ck(base_ck)))
Initial.tint
~linearity:Linearity.Ltop
) nl
) nl
in
typing_app h base_ck pat op (pargs@args@il)
| Ifold | Imapfold ->
(* clocking node with equality constaint on last input and last output *)
let ct = typing_app h base_ck pat op (pargs@args) in
Misc.optional (unify (Ck(Clocks.last_clock ct)))
(Misc.last_element args).e_ct_annot;
Misc.optional (unify (Ck(Clocks.last_clock ct)))
(Misc.last_element args).e_ct_annot;
ct
| Ifoldi -> (* clocking the node with the extra i and last in/out constraints *)
let il (* stubs i as 0 *) =
List.map (fun x -> mk_exp
(Econst (Initial.mk_static_int 0))
~ct_annot:(Some(Ck(base_ck)))
Initial.tint
(Econst (Initial.mk_static_int 0))
~ct_annot:(Some(Ck(base_ck)))
Initial.tint
~linearity:Linearity.Ltop
) nl
) nl
in
let rec insert_i args = match args with
| [] -> il
......@@ -137,7 +137,7 @@ let rec typing h pat e =
in
let ct = typing_app h base_ck pat op (pargs@(insert_i args)) in
Misc.optional (unify (Ck (Clocks.last_clock ct)))
(Misc.last_element args).e_ct_annot;
(Misc.last_element args).e_ct_annot;
ct
in
ct, base_ck
......@@ -147,10 +147,10 @@ let rec typing h pat e =
None -> ()
| Some e_ct ->
try
unify ct e_ct
unify ct e_ct
with Unify ->
eprintf "Incoherent clock annotation.@\n";
error_message e.e_loc (Etypeclash (ct,e_ct));
eprintf "Incoherent clock annotation.@\n";
error_message e.e_loc (Etypeclash (ct,e_ct));
end;
e.e_ct_annot <- Some(ct);
ct, base
......@@ -177,8 +177,8 @@ and typing_app h base pat op e_list = match op with
| None -> build_env a_l v_l env
| Some n -> build_env a_l v_l ((n,v)::env))
| _ ->
Printf.printf "Fun/node : %s\n" (Names.fullname f);
Misc.internal_error "Clocking, non matching signature"
Printf.printf "Fun/node : %s\n" (Names.fullname f);
Misc.internal_error "Clocking, non matching signature"
in
let env_pat = build_env node.node_outputs pat_id_list [] in
let env_args = build_env node.node_inputs e_list [] in
......@@ -200,8 +200,8 @@ and typing_app h base pat op e_list = match op with
Clocks.Con (sigck_to_ck sck, c, id)
in
List.iter2
(fun a e -> expect h pat (Ck(sigck_to_ck a.a_clock)) e)
node.node_inputs e_list;
(fun a e -> expect h pat (Ck(sigck_to_ck a.a_clock)) e)
node.node_inputs e_list;
Clocks.prod (List.map (fun a -> sigck_to_ck a.a_clock) node.node_outputs)
let append_env h vds =
......@@ -214,8 +214,8 @@ let rec typing_eq h ({ eq_desc = desc; eq_loc = loc } as eq) =
let pat_ct = typing_pat h pat in
(try unify ct pat_ct
with Unify ->
eprintf "Incoherent clock between right and left side of the equation.@\n";
error_message loc (Etypeclash (ct, pat_ct)))
eprintf "Incoherent clock between right and left side of the equation.@\n";
error_message loc (Etypeclash (ct, pat_ct)))
| Eblock b ->
ignore(typing_block h b)
| _ -> assert false
......
......@@ -7,7 +7,7 @@
(* *)
(****************************************************)
(*
(*
Translate enumerated types (state variables) into boolean
type t = A | B | C | D
......@@ -22,7 +22,7 @@
(e when A(x))
-->
(e when False(x1)) when False(x2)
merge x (A -> e0) (B -> e1) (C -> e2) (D -> e3)
-->
merge x1 (False -> merge x2 (False -> e0) (True -> e1))
......
......@@ -237,21 +237,21 @@ and merge context e x c_e_list =
let ty = (List.hd (List.hd e_lists)).e_ty in
let lin = (List.hd (List.hd e_lists)).e_linearity in
let rec build_c_e_list c_list e_lists =
match c_list, e_lists with
| [], [] -> [], []
| c::c_l, (e::e_l)::e_ls ->
let c_e_list, e_lists = build_c_e_list c_l e_ls in
(c,e)::c_e_list, e_l::e_lists
| _ -> assert false in
match c_list, e_lists with
| [], [] -> [], []
| c::c_l, (e::e_l)::e_ls ->
let c_e_list, e_lists = build_c_e_list c_l e_ls in
(c,e)::c_e_list, e_l::e_lists
| _ -> assert false in
let rec build_merge_list c_list e_lists =
match e_lists with
[] -> assert false
| []::_ -> []
| _ ::_ ->
let c_e_list, e_lists = build_c_e_list c_list e_lists in
let e_merge = mk_exp ~loc:e.e_loc (Emerge(x, c_e_list)) ty ~linearity:lin in
let e_merge_list = build_merge_list c_list e_lists in
e_merge::e_merge_list in
match e_lists with
[] -> assert false
| []::_ -> []
| _ ::_ ->
let c_e_list, e_lists = build_c_e_list c_list e_lists in
let e_merge = mk_exp ~loc:e.e_loc (Emerge(x, c_e_list)) ty ~linearity:lin in
let e_merge_list = build_merge_list c_list e_lists in
e_merge::e_merge_list in
build_merge_list c_list e_lists
in
let c_e_list, context = mapfold translate_tag context c_e_list in
......@@ -263,14 +263,14 @@ and merge context e x c_e_list =
let e_lists = List.map (fun (_,e) -> e_to_e_list e) c_e_list in
let e_lists, context =
mapfold
(fun context e_list -> add_list context ExtValue e_list)
context e_lists in
(fun context e_list -> add_list context ExtValue e_list)
context e_lists in
let e_list = mk_merge x c_list e_lists in
context, { e with
e_desc = Eapp(mk_app Etuple, e_list, None) }
e_desc = Eapp(mk_app Etuple, e_list, None) }
) else
context, { e with
e_desc = Emerge(x, c_e_list) }
e_desc = Emerge(x, c_e_list) }
(* applies distribution rules *)
(* [(p1,...,pn) = (e1,...,en)] into [p1 = e1;...;pn = en] *)
......@@ -332,8 +332,8 @@ let contract funs context c =
c_assume = e_a;
c_enforce = e_e;
c_block = { b with
b_local = d_list@b.b_local;
b_equs = eq_list@b.b_equs; }
b_local = d_list@b.b_local;
b_equs = eq_list@b.b_equs; }
}, void_context
let program p =
......
This diff is collapsed.
This diff is collapsed.
......@@ -3,28 +3,28 @@ let
automaton
state A
do
y = 1;
y = 1;
until (x = 0) then B
state B
do
y = 2;
y = 2;
until (x = 1) then C
state C
do
automaton
state D
do
y = 3;
until (x = 2) then E
state E
do
y = 4;
until (x = 3) then F
state F
do
y = 5;
until (x = 4) then D
end
automaton
state D
do
y = 3;
until (x = 2) then E
state E
do
y = 4;
until (x = 3) then F
state F
do
y = 5;
until (x = 4) then D
end
until (x = 5) then A
end
tel
......@@ -22,7 +22,7 @@ let
o = false;
until true then Cruise
state Cruise do
o = true;
o = true;
end
tel
*)
......@@ -36,8 +36,8 @@ tel
node mod_counter_r<<m :int>>(res :bool) returns (cpt :int)
let
reset
cpt = (0 fby cpt) + 1
every (res or (0 fby cpt = m))
cpt = (0 fby cpt) + 1
every (res or (0 fby cpt = m))
tel
(* count from 1 to m included *)
......@@ -105,9 +105,9 @@ tel
node down_img <<size_x, size_y, ratio_x, ratio_y :int>> (x :pixel :: .)
returns (y_flat :pixel; y_clock :bool;
y, y_dh, y_dh_t, y_dhv_t :pixel;
y, y_dh, y_dh_t, y_dhv_t :pixel;
ck_y_dh, ck_y_dhv :bool
)
)
var
x_line, y_dh_t_line :bool;
......@@ -135,8 +135,8 @@ let
tel*)
node main<<size_x, size_y:int>> () returns (img, out : pixel; ck_out :bool;
y, y_dh, y_dh_t, y_dhv_t :pixel;
ck_y_dh, ck_y_dhv :bool)
y, y_dh, y_dh_t, y_dhv_t :pixel;
ck_y_dh, ck_y_dhv :bool)
(*var img : pixel;*)
let
(*ck_out = true fby false fby not ck_out;*)
......
#!/bin/sh
find . \! -path "*build*" -and \( -iname "*.ml" -or -iname "*.mli" -or -iname "*.mly" -or -iname "*.mll" -or -iname "*.ept" -or -iname "*.txt" \) -exec perl -pi -e 's/( |\t)+$//gi; s/\t/ /g' {} \;
find . \! -path "*build*" -and \( -iname "*.ml" -or -iname "*.mli" -or -iname "*.mly" -or -iname "*.mll" -or -iname "*.ept" -or -iname "*.txt" \) -exec perl -pi -e 's/( |\t)+$//gi; s/\t/ /g' {} \;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment