code cleanup
This commit is contained in:
parent
ad97c6b627
commit
23e234732f
@ -43,7 +43,8 @@ let _ =
|
|||||||
["linearization_reset"; "automata_translation"; "remove_if";
|
["linearization_reset"; "automata_translation"; "remove_if";
|
||||||
"linearization_pre"; "linearization_tuples"; "linearization_app";
|
"linearization_pre"; "linearization_tuples"; "linearization_app";
|
||||||
"ensure_assign_val";
|
"ensure_assign_val";
|
||||||
"equations_ordering"; "clock_unification"] in
|
"equations_ordering";
|
||||||
|
"clock_unification"] in
|
||||||
let sanity_passes = ["sanity_pass_assignment_unicity"; "check_typing"] in
|
let sanity_passes = ["sanity_pass_assignment_unicity"; "check_typing"] in
|
||||||
let usage_msg =
|
let usage_msg =
|
||||||
"Usage: main [-passes p1,...,pn] [-ast] [-verbose] [-debug] \
|
"Usage: main [-passes p1,...,pn] [-ast] [-verbose] [-debug] \
|
||||||
|
@ -244,7 +244,7 @@ let pass_linearization_pre verbose debug =
|
|||||||
| [TInt] -> IVar nvar
|
| [TInt] -> IVar nvar
|
||||||
| [TBool] -> BVar nvar
|
| [TBool] -> BVar nvar
|
||||||
| [TReal] -> RVar 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_patt: t_varlist = (t, [nvar]) in
|
||||||
let neq_expr: t_expression = e in
|
let neq_expr: t_expression = e in
|
||||||
let vars = varlist_concat (t, [nvar]) vars 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 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 known_clocks = Hashtbl.create 100 in
|
||||||
let used = Hashtbl.create 100 in (*keep track of variables that appear on right side of equation*)
|
let used = Hashtbl.create 100 in (*keep track of variables that appear on right side of equation*)
|
||||||
let changed = ref false in
|
let changed = ref false in
|
||||||
@ -1042,6 +1040,7 @@ let clock_unification_pass verbose debug ast =
|
|||||||
| EConst(_, _) -> ()
|
| EConst(_, _) -> ()
|
||||||
| EVar(_, var) -> if not (List.mem var node_inputs) then raise (PassExn "Clock unification failure: input clock depends on non input clock")
|
| 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
|
else check_inputs q
|
||||||
|
| _ -> failwith "Should not happen. (clock_unification)"
|
||||||
end
|
end
|
||||||
| _ -> check_inputs q
|
| _ -> check_inputs q
|
||||||
in
|
in
|
||||||
|
@ -19,6 +19,7 @@ tel
|
|||||||
node test (u, v: int; c: bool) returns (o: int);
|
node test (u, v: int; c: bool) returns (o: int);
|
||||||
var x, y: int; b: bool;
|
var x, y: int; b: bool;
|
||||||
let
|
let
|
||||||
o = 2 * (merge c u v);
|
x = merge c u v;
|
||||||
|
o = 2 * x;
|
||||||
tel
|
tel
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user