Commit ebcd8f00 authored by Aliaume Lopez's avatar Aliaume Lopez

Implementation !!!

parent 8aca4e90
......@@ -276,7 +276,7 @@ let report txt ptg =
incr fc;
let base = Printf.sprintf "test%03d" !fc in
print_string (txt ^ ": " ^ base ^ "\n");
ptg |> string_of_ptg |> print_string ;
(*ptg |> string_of_ptg |> print_string ;*)
ptg_to_file (base ^ ".dot") ptg;
Sys.command ("dot -Tpdf " ^ base ^ ".dot" ^ " -o " ^ base ^ ".pdf");;
......@@ -320,13 +320,21 @@ let looping_reduction_step x =
let x = rewrite_local rules x in
report "LOCAL REWRITE" x;
let x = Rewriting.unfold_trace x in
report "TRACE UNFOLDING" x;
let x = Rewriting.garbage_collect_dual x in
report "GARBAGE COLLECT" x;
x;;
try
let (v, x1) = Rewriting.first_output x in
print_string "OUTPUT DETECTED : ";
v |> List.map string_of_value |> String.concat ", " |> print_string;
print_newline ();
x1
with
Rewriting.NoFirstValue ->
let x = Rewriting.unfold_trace x in
report "TRACE UNFOLDING" x;
let x = Rewriting.garbage_collect_dual x in
report "GARBAGE COLLECT" x;
x;;
(***
......
link a:b for HIGH
(HIGH | (LOW . WAIT) | (TOP . WAIT . WAIT)) . (JOIN | 1) . JOIN
......@@ -159,8 +159,9 @@ let circuit_of_name = function
| "NMOS" -> const "NMOS" 2 1
| "HIGH" -> const "HIGH" 0 1
| "LOW" -> const "LOW" 0 1
| "MUX" -> const "MUX" 3 1
| "BOT" -> const "BOT" 0 1
| "TOP" -> const "TOP" 0 1
| "MUX" -> const "MUX" 3 1
| "WAIT" -> const "WAIT" 1 1
| "DISC" -> const "DISC" 1 0
| "FORK" -> const "FORK" 1 2
......
......@@ -553,11 +553,11 @@ let trace_split ptg =
let trids = newids (List.length ptg.traced) in
let corres = List.combine ptg.traced trids in
print_string "CORRES : ";
corres |> List.map (fun (x,y) -> string_of_int x ^ ":" ^ string_of_int y)
|> String.concat " "
|> print_string;
print_string "\n";
(*print_string "CORRES : ";*)
(*corres |> List.map (fun (x,y) -> string_of_int x ^ ":" ^ string_of_int y) *)
(*|> String.concat " " *)
(*|> print_string;*)
(*print_string "\n";*)
(* this function seems complex, but in fact
* traced nodes have only one input and
......@@ -566,7 +566,7 @@ let trace_split ptg =
*)
let copy_pre_conn (x,y) t =
let [e] = edges_towards ~node:x t in
print_string "\n"; print_int e; print_string "\n";
(*print_string "\n"; print_int e; print_string "\n";*)
let n = fst (edge_get_nodes ~edge:e t) in
t |> edge_rem ~edge:e
|> edge_add ~from:n ~towards:y
......
......@@ -547,14 +547,14 @@ let garbage_collect_dual t =
in
let nodes_to_delete = List.filter filter_func (t.traced @ t.delays @ t.nodes) in
print_string "DELETING NODES: ";
nodes_to_delete |> List.map (string_of_int)
|> String.concat ", "
|> print_string;
print_newline ();
(*print_string "DELETING NODES: ";*)
(*nodes_to_delete |> List.map (string_of_int)*)
(*|> String.concat ", "*)
(*|> print_string;*)
(*print_newline ();*)
let remove_node_safely ~node:n t =
print_string ("\tREMOVE NODE : " ^ string_of_int n ^ "\n");
(*print_string ("\tREMOVE NODE : " ^ string_of_int n ^ "\n");*)
(* The edges comming from a reachable node *)
let pre = t
......
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