Suppression ;;
Cette révision appartient à :
@@ -7,7 +7,7 @@ type 'a regexp =
|
|||||||
| Lettre of 'a
|
| Lettre of 'a
|
||||||
| Union of 'a regexp list
|
| Union of 'a regexp list
|
||||||
| Concat of 'a regexp list
|
| Concat of 'a regexp list
|
||||||
| Etoile of 'a regexp;;
|
| Etoile of 'a regexp
|
||||||
(*** regexp_fin ***)
|
(*** regexp_fin ***)
|
||||||
|
|
||||||
(*** langloc ***)
|
(*** langloc ***)
|
||||||
@@ -15,7 +15,7 @@ type 'a langloc = {
|
|||||||
eps : bool; (* indique si ε est dans le langage *)
|
eps : bool; (* indique si ε est dans le langage *)
|
||||||
p : 'a list; (* liste représentant P(L) *)
|
p : 'a list; (* liste représentant P(L) *)
|
||||||
s : 'a list; (* liste représentant S(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 ***)
|
(*** langloc_fin ***)
|
||||||
|
|
||||||
(*** automate ***)
|
(*** automate ***)
|
||||||
@@ -23,7 +23,7 @@ type 'a nda =
|
|||||||
{nQ : int ; (* nombre d'états *)
|
{nQ : int ; (* nombre d'états *)
|
||||||
i : int list; (* états initiaux *)
|
i : int list; (* états initiaux *)
|
||||||
f : int list; (* états finals *)
|
f : int list; (* états finals *)
|
||||||
t : (int * 'a * int) list;};; (* table de transition *)
|
t : (int * 'a * int) list;} (* table de transition *)
|
||||||
(*** automate_fin ***)
|
(*** automate_fin ***)
|
||||||
|
|
||||||
*)
|
*)
|
||||||
@@ -39,15 +39,15 @@ module Affichage =
|
|||||||
else if a = ' ' then
|
else if a = ' ' then
|
||||||
"\\\\espace"
|
"\\\\espace"
|
||||||
else
|
else
|
||||||
String.make 1 a;;
|
String.make 1 a
|
||||||
|
|
||||||
let s_o_l a =
|
let s_o_l a =
|
||||||
let lettre = s_o_c a
|
let lettre = s_o_c a
|
||||||
in "\"" ^ lettre ^ "\"";;
|
in "\"" ^ lettre ^ "\""
|
||||||
|
|
||||||
let s_o_m (a, n) =
|
let s_o_m (a, n) =
|
||||||
let lettre = s_o_c a in
|
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 dot_auto print string_of_lettre auto =
|
||||||
let lien = "->" in
|
let lien = "->" in
|
||||||
@@ -67,7 +67,8 @@ module Affichage =
|
|||||||
print ";\n"
|
print ";\n"
|
||||||
)
|
)
|
||||||
auto.t;
|
auto.t;
|
||||||
print "}\n";;
|
print "}
|
||||||
|
"
|
||||||
|
|
||||||
let auto_to_file fn string_of_lettre auto =
|
let auto_to_file fn string_of_lettre auto =
|
||||||
let os = open_out fn in
|
let os = open_out fn in
|
||||||
@@ -92,27 +93,27 @@ module Affichage =
|
|||||||
flush os;*)
|
flush os;*)
|
||||||
print "\\end{tikzpicture}\n";
|
print "\\end{tikzpicture}\n";
|
||||||
print "\\end{document}";
|
print "\\end{document}";
|
||||||
close_out os;;
|
close_out os
|
||||||
|
|
||||||
|
|
||||||
let run wait cmd =
|
let run wait cmd =
|
||||||
if wait then
|
if wait then
|
||||||
ignore (Unix.system cmd)
|
ignore (Unix.system cmd)
|
||||||
else
|
else
|
||||||
ignore (Unix.open_process cmd);;
|
ignore (Unix.open_process cmd)
|
||||||
|
|
||||||
let rundot fn =
|
let rundot fn =
|
||||||
let bn = try Filename.chop_extension fn with Invalid_argument _ -> fn in
|
let bn = try Filename.chop_extension fn with Invalid_argument _ -> fn in
|
||||||
let pdfn = bn^".pdf" in
|
let pdfn = bn^".pdf" in
|
||||||
run true ("latexmk -xelatex -cd -shell-escape " ^ (Filename.quote fn));
|
run true ("latexmk -xelatex -cd -shell-escape " ^ (Filename.quote fn));
|
||||||
pdfn;;
|
pdfn
|
||||||
|
|
||||||
let openPDF wait fn =
|
let openPDF wait fn =
|
||||||
run wait ("xdg-open " ^ (Filename.quote fn));;
|
run wait ("xdg-open " ^ (Filename.quote fn))
|
||||||
|
|
||||||
let vizgraph wait fn =
|
let vizgraph wait fn =
|
||||||
let pdfn = rundot fn in
|
let pdfn = rundot fn in
|
||||||
openPDF wait pdfn;;
|
openPDF wait pdfn
|
||||||
|
|
||||||
let rec string_of_regexp sol = function
|
let rec string_of_regexp sol = function
|
||||||
| Vide -> "∅"
|
| Vide -> "∅"
|
||||||
@@ -122,23 +123,23 @@ module Affichage =
|
|||||||
| Union([x]) -> string_of_regexp sol x
|
| Union([x]) -> string_of_regexp sol x
|
||||||
| Union(le) -> "(" ^ (String.concat "|" (List.map (fun x -> string_of_regexp sol x) le)) ^ ")"
|
| 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)
|
| 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
|
end
|
||||||
|
|
||||||
let string_of_char = String.make 1;;
|
let string_of_char = String.make 1
|
||||||
let string_of_charint (a, n) = (String.make 1 a) ^ (string_of_int n);;
|
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 = Affichage.string_of_regexp string_of_char
|
||||||
let string_of_regexp_marques = Affichage.string_of_regexp string_of_charint;;
|
let string_of_regexp_marques = Affichage.string_of_regexp string_of_charint
|
||||||
|
|
||||||
let afficher_auto a = let fn = (Filename.temp_file "auto" ".tex") in
|
let afficher_auto a = let fn = (Filename.temp_file "auto" ".tex") in
|
||||||
Affichage.auto_to_file fn Affichage.s_o_l a;
|
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
|
let afficher_auto_marques a = let fn = (Filename.temp_file "auto" ".tex") in
|
||||||
Affichage.auto_to_file fn Affichage.s_o_m a;
|
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)) ^"]"
|
||||||
|
|||||||
@@ -41,23 +41,23 @@ let graphe_to_dot fn oriente graphe marques estimations parents =
|
|||||||
graphe.(x)
|
graphe.(x)
|
||||||
done;
|
done;
|
||||||
print "}";
|
print "}";
|
||||||
close_out os;;
|
close_out os
|
||||||
|
|
||||||
let run wait cmd =
|
let run wait cmd =
|
||||||
if wait then
|
if wait then
|
||||||
ignore (Unix.system cmd)
|
ignore (Unix.system cmd)
|
||||||
else
|
else
|
||||||
ignore (Unix.open_process cmd);;
|
ignore (Unix.open_process cmd)
|
||||||
|
|
||||||
let rundot fn =
|
let rundot fn =
|
||||||
let bn = try Filename.chop_extension fn with Invalid_argument _ -> fn in
|
let bn = try Filename.chop_extension fn with Invalid_argument _ -> fn in
|
||||||
let pdfn = bn^".pdf" in
|
let pdfn = bn^".pdf" in
|
||||||
run true ("dot -Tpdf " ^ (Filename.quote fn) ^ " -o " ^ (Filename.quote pdfn));
|
run true ("dot -Tpdf " ^ (Filename.quote fn) ^ " -o " ^ (Filename.quote pdfn));
|
||||||
pdfn;;
|
pdfn
|
||||||
|
|
||||||
let openPDF wait fn =
|
let openPDF wait fn =
|
||||||
run wait ("evince " ^ (Filename.quote fn));;
|
run wait ("evince " ^ (Filename.quote fn))
|
||||||
|
|
||||||
let vizgraph wait fn =
|
let vizgraph wait fn =
|
||||||
let pdfn = rundot fn in
|
let pdfn = rundot fn in
|
||||||
openPDF wait pdfn;;
|
openPDF wait pdfn
|
||||||
|
|||||||
Référencer dans un nouveau ticket
Bloquer un utilisateur