code cleanup

This commit is contained in:
Antoine Grimod 2023-01-09 21:09:29 +01:00
parent ad97c6b627
commit 23e234732f
3 changed files with 6 additions and 5 deletions

View File

@ -43,7 +43,8 @@ let _ =
["linearization_reset"; "automata_translation"; "remove_if";
"linearization_pre"; "linearization_tuples"; "linearization_app";
"ensure_assign_val";
"equations_ordering"; "clock_unification"] in
"equations_ordering";
"clock_unification"] in
let sanity_passes = ["sanity_pass_assignment_unicity"; "check_typing"] in
let usage_msg =
"Usage: main [-passes p1,...,pn] [-ast] [-verbose] [-debug] \

View File

@ -244,7 +244,7 @@ let pass_linearization_pre verbose debug =
| [TInt] -> IVar nvar
| [TBool] -> BVar nvar
| [TReal] -> RVar nvar
| _ -> failwith "Should not happened." in
| _ -> failwith "Should not happened. (pass_linearization_pre)" in
let neq_patt: t_varlist = (t, [nvar]) in
let neq_expr: t_expression = e in
let vars = varlist_concat (t, [nvar]) vars in
@ -930,8 +930,6 @@ let automata_translation_pass verbose debug =
let clock_unification_pass verbose debug ast =
let failure str = raise (PassExn ("Failed to unify clocks: "^str)) in
let known_clocks = Hashtbl.create 100 in
let used = Hashtbl.create 100 in (*keep track of variables that appear on right side of equation*)
let changed = ref false in
@ -1042,6 +1040,7 @@ let clock_unification_pass verbose debug ast =
| EConst(_, _) -> ()
| EVar(_, var) -> if not (List.mem var node_inputs) then raise (PassExn "Clock unification failure: input clock depends on non input clock")
else check_inputs q
| _ -> failwith "Should not happen. (clock_unification)"
end
| _ -> check_inputs q
in

View File

@ -19,6 +19,7 @@ tel
node test (u, v: int; c: bool) returns (o: int);
var x, y: int; b: bool;
let
o = 2 * (merge c u v);
x = merge c u v;
o = 2 * x;
tel