diff --git a/Makefile b/Makefile index a7a56ce735b0b62188201a5be4da5d6742cfebe8..29010e5b85265e2b7522402e2cc6b90a312232a8 100644 --- a/Makefile +++ b/Makefile @@ -15,11 +15,12 @@ tests: $(OSRC) tests.ml ./tests circuits: $(OSRC) circuits.ml + mkdir -p graphics $(OCAMLCC) -g -o circuits $(OSRC) circuits.ml ./circuits clean: rm *.cmi rm *.cmo - rm *.pdf - rm *.dot + rm graphics/*.pdf + rm graphics/*.dot diff --git a/README.md b/README.md index 6892fd187faaa9c11bcb7d7e7c512b7ae6c6a438..4de52e5517f6ae3875f2ba44038f7575ae78a557 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,22 @@ To compile and run the circuits make circuits ``` +Once it is built, you will be able to use it with the following +console command : -To update your version of the repository +``` +./circuits +``` + +Note that the default circuit is obtained by reading `lines.txt`, +but any alternative text file can be used by supplying the filename +as an argument : ``` -git pull origin master +./circuits filename ``` +The graphics are generated in a separate directory called `graphics`. ## Syntax overview diff --git a/circuits.ml b/circuits.ml index fa4b965d164745e8fe52af58c36f1d7c1250894b..408bd57119363596edf9abe9829fe2d632e7d819 100644 --- a/circuits.ml +++ b/circuits.ml @@ -158,9 +158,10 @@ let convert_label = function let ptg_of_dag dag = - (*Dags.debug_dag dag;*) + (* Dags.debug_dag dag; *) - (* FIRST OF ALL TRANSLATE ALL THE NAMES SO THAT + (* + * FIRST OF ALL TRANSLATE ALL THE NAMES SO THAT * THEY DO NOT CONFLICT WITH OTHER PTG NAMES *) let dag = mapids (fun x -> x + !counter) dag in @@ -278,7 +279,7 @@ let fc = ref 0;; *) let report txt ptg = incr fc; - let base = Printf.sprintf "test%03d" !fc in + let base = Printf.sprintf "graphics/test%03d" !fc in (*print_string (txt ^ ": " ^ base ^ "\n");*) (*ptg |> string_of_ptg |> print_string ;*) ptg_to_file (base ^ ".dot") ptg;