From fb1315c50bc500a4bf58ba0954c6ba256ec37dbe Mon Sep 17 00:00:00 2001 From: Yann Salmon Date: Tue, 23 Nov 2021 15:54:10 +0100 Subject: [PATCH] Suppression ;; --- ocaml/affichage_auto.ml | 41 ++++++++++++++++++++------------------- ocaml/affichage_graphe.ml | 10 +++++----- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/ocaml/affichage_auto.ml b/ocaml/affichage_auto.ml index aabda51..7237f63 100644 --- a/ocaml/affichage_auto.ml +++ b/ocaml/affichage_auto.ml @@ -7,7 +7,7 @@ type 'a regexp = | Lettre of 'a | Union of 'a regexp list | Concat of 'a regexp list - | Etoile of 'a regexp;; + | Etoile of 'a regexp (*** regexp_fin ***) (*** langloc ***) @@ -15,7 +15,7 @@ type 'a langloc = { eps : bool; (* indique si ε est dans le langage *) p : 'a list; (* liste représentant P(L) *) s : 'a list; (* liste représentant S(L) *) - f : ('a * 'a) list;};;(* liste représentant F(L) *) + f : ('a * 'a) list;}(* liste représentant F(L) *) (*** langloc_fin ***) (*** automate ***) @@ -23,7 +23,7 @@ type 'a nda = {nQ : int ; (* nombre d'états *) i : int list; (* états initiaux *) f : int list; (* états finals *) - t : (int * 'a * int) list;};; (* table de transition *) + t : (int * 'a * int) list;} (* table de transition *) (*** automate_fin ***) *) @@ -39,15 +39,15 @@ module Affichage = else if a = ' ' then "\\\\espace" else - String.make 1 a;; + String.make 1 a let s_o_l a = let lettre = s_o_c a - in "\"" ^ lettre ^ "\"";; + in "\"" ^ lettre ^ "\"" let s_o_m (a, n) = let lettre = s_o_c a in - "\"$\\text{" ^ lettre ^ "}_{" ^ (string_of_int n) ^ "}$\"";; + "\"$\ ext{" ^ lettre ^ "}_{" ^ (string_of_int n) ^ "}$\"" let dot_auto print string_of_lettre auto = let lien = "->" in @@ -67,7 +67,8 @@ module Affichage = print ";\n" ) auto.t; - print "}\n";; + print "} +" let auto_to_file fn string_of_lettre auto = let os = open_out fn in @@ -92,27 +93,27 @@ module Affichage = flush os;*) print "\\end{tikzpicture}\n"; print "\\end{document}"; - close_out os;; + close_out os let run wait cmd = if wait then ignore (Unix.system cmd) else - ignore (Unix.open_process cmd);; + ignore (Unix.open_process cmd) let rundot fn = let bn = try Filename.chop_extension fn with Invalid_argument _ -> fn in let pdfn = bn^".pdf" in run true ("latexmk -xelatex -cd -shell-escape " ^ (Filename.quote fn)); - pdfn;; + pdfn let openPDF wait fn = - run wait ("xdg-open " ^ (Filename.quote fn));; + run wait ("xdg-open " ^ (Filename.quote fn)) let vizgraph wait fn = let pdfn = rundot fn in - openPDF wait pdfn;; + openPDF wait pdfn let rec string_of_regexp sol = function | Vide -> "∅" @@ -122,23 +123,23 @@ module Affichage = | Union([x]) -> string_of_regexp sol x | Union(le) -> "(" ^ (String.concat "|" (List.map (fun x -> string_of_regexp sol x) le)) ^ ")" | Concat(le) -> String.concat "" (List.map (fun x -> string_of_regexp sol x) le) - | Etoile(x) -> (string_of_regexp sol x)^"*";; + | Etoile(x) -> (string_of_regexp sol x)^"*" end -let string_of_char = String.make 1;; -let string_of_charint (a, n) = (String.make 1 a) ^ (string_of_int n);; +let string_of_char = String.make 1 +let string_of_charint (a, n) = (String.make 1 a) ^ (string_of_int n) -let string_of_regexp = Affichage.string_of_regexp string_of_char;; -let string_of_regexp_marques = Affichage.string_of_regexp string_of_charint;; +let string_of_regexp = Affichage.string_of_regexp string_of_char +let string_of_regexp_marques = Affichage.string_of_regexp string_of_charint let afficher_auto a = let fn = (Filename.temp_file "auto" ".tex") in Affichage.auto_to_file fn Affichage.s_o_l a; - Affichage.vizgraph false fn;; + Affichage.vizgraph false fn let afficher_auto_marques a = let fn = (Filename.temp_file "auto" ".tex") in Affichage.auto_to_file fn Affichage.s_o_m a; - Affichage.vizgraph false fn;; + Affichage.vizgraph false fn -let string_of_list f l = "[" ^ (String.concat "; " (List.map f l)) ^"]";; +let string_of_list f l = "[" ^ (String.concat "; " (List.map f l)) ^"]" diff --git a/ocaml/affichage_graphe.ml b/ocaml/affichage_graphe.ml index 1969032..e7c849c 100644 --- a/ocaml/affichage_graphe.ml +++ b/ocaml/affichage_graphe.ml @@ -41,23 +41,23 @@ let graphe_to_dot fn oriente graphe marques estimations parents = graphe.(x) done; print "}"; - close_out os;; + close_out os let run wait cmd = if wait then ignore (Unix.system cmd) else - ignore (Unix.open_process cmd);; + ignore (Unix.open_process cmd) let rundot fn = let bn = try Filename.chop_extension fn with Invalid_argument _ -> fn in let pdfn = bn^".pdf" in run true ("dot -Tpdf " ^ (Filename.quote fn) ^ " -o " ^ (Filename.quote pdfn)); - pdfn;; + pdfn let openPDF wait fn = - run wait ("evince " ^ (Filename.quote fn));; + run wait ("evince " ^ (Filename.quote fn)) let vizgraph wait fn = let pdfn = rundot fn in - openPDF wait pdfn;; + openPDF wait pdfn