Commit a197787c authored by Aliaume Lopez's avatar Aliaume Lopez

Small corrections and added examples

parent 6b66e7a3
link xO:xI zO:zI for
PAR
xO:
(:zI . NOT | :zI) . AND . (1 | :xI) . OR . zO:
:zI
END
link xO:xI yO:yI for
PAR
xO:
(:xI | :yI) . AND
(:yI | :xI) . OR . yO:
END
......@@ -286,7 +286,8 @@ let report txt ptg =
(*print_string (txt ^ ": " ^ base ^ "\n");*)
(*ptg |> string_of_ptg |> print_string ;*)
ptg_to_file (base ^ ".dot") ptg;
Sys.command ("dot -Tpdf " ^ base ^ ".dot" ^ " -o " ^ base ^ ".pdf");;
Sys.command ("dot -Tpdf " ^ base ^ ".dot" ^ " -o " ^ base ^ ".pdf");
();;
(* Some utility functions for the local rules application *)
......
HIGH . link xO:xI yO:yI for
HIGH .
link xO:xI zO:zI for
PAR
xO:
(:xI | :yI) . AND
(:yI | :xI) . OR . yO:
(:zI . NOT | :zI) . AND . (1 | :xI) . OR . zO:
:zI
END
......@@ -194,6 +194,7 @@ let string_of_gate = function
| Wait -> "W"
| And -> "AND"
| Or -> "OR"
| Not -> "NOT"
| Mux -> "M";;
let rec string_of_value = function
......
......@@ -226,6 +226,8 @@ let reduce_and inputs =
try
let [a;b] = inputs in
match (a,b) with
| Some (Value Top) , _ -> Result Top
| _, Some (Value Top) -> Result Top
| Some (Value Low), _ -> Result Low
| _, Some (Value Low) -> Result Low
| Some (Value High), Some (Value High) -> Result High
......@@ -238,6 +240,8 @@ let reduce_or inputs =
try
let [a;b] = inputs in
match (a,b) with
| Some (Value Top) , _ -> Result Top
| _, Some (Value Top) -> Result Top
| Some (Value High), _ -> Result High
| _ , Some (Value High) -> Result High
| Some (Value Low), Some (Value Low) -> Result Low
......
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