Browse Source

added display support for ints + main tested. Ford Fulkerson Finished

rlacroix 1 year ago
parent
commit
5ca008700e
12 changed files with 162 additions and 172 deletions
  1. 18
    18
      _build/_digests
  2. 30
    13
      _build/_log
  3. BIN
      _build/src/ftest.cmi
  4. BIN
      _build/src/ftest.cmx
  5. 4
    3
      _build/src/ftest.ml
  6. BIN
      _build/src/ftest.native
  7. BIN
      _build/src/ftest.o
  8. 17
    21
      outfile
  9. 9
    2
      src/display.ml
  10. 2
    2
      src/display.mli
  11. 2
    5
      src/ftest.ml
  12. 80
    108
      test.svg

+ 18
- 18
_build/_digests View File

@@ -1,42 +1,42 @@
1
-"Rule: ocaml: ml & cmi -> cmx & o (%=src/display )": "\027\"r\253b.\004\234\141\ba\206\238\025\242r"
2 1
 "Rule: ocaml dependencies mli (%=src/gfile )": "7\182\192g\020\238\188\b\211\164{\014\157\135\011\003"
2
+"Rule: ocaml: ml & cmi -> cmx & o (%=src/display )": "\239\213\229\211j!\190#\027U\183\135\175^\143<"
3 3
 "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/tools.mli": "9\173\222\177]e\245\229\131\151\020fsu\133@"
4
-"Rule: ocaml dependencies ml (%=src/ftest )": "\022\160\161\193C\022\254\133j\146\196\000-~(\161"
5 4
 "Rule: ocaml: ml & cmi -> cmx & o (%=src/gfile )": "\236O\148Y\157m\028\183\166?\231a\231\187u\132"
6
-"Rule: ocaml dependencies mli (%=src/display )": "+\178\012\248)#\197\218\144\1935\220\193\190\212\183"
7
-"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/ftest.ml": "\204\235D\031\004O\173\136R\148y\171\207]&g"
5
+"Rule: ocaml dependencies ml (%=src/ftest )": "\129\231\129\216(|Io\133\186\180\221\250\\\208s"
6
+"Rule: ocaml dependencies mli (%=src/display )": "\231~k=1\249%\182S0\233D\212\252\223\161"
7
+"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/ftest.ml": "\134j\0044\254:\143\174\205\170s\173Q\171\183\185"
8 8
 "Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/fordFulkerson.ml": "qra\159@\212u\200\192\132V9-\127\2022"
9
+"Rule: ocaml: mli -> cmi (%=src/display )": "\165\163&C\247\02392\222\141}\166\237\209\226\196"
9 10
 "Rule: ocaml: mli -> cmi (%=src/graph )": ")2\159\205\136\031\251\145\0263\01878\001\b\134"
10
-"Rule: ocaml: mli -> cmi (%=src/display )": "\020\015~%\135\196\153\152}\154\244v\253$N\164"
11 11
 "Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/graph.mli": "\253S\031\015\162|\210x\252\n \227\001{\133e"
12
-"Rule: ocaml: ml & cmi -> cmx & o (%=src/fordFulkerson )": "\158P\156*\236\171\2120>1Z\179\149\240\201."
13 12
 "Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/tools.ml": "\185\244\209\136L\1577;\191J\171\162M\135xa"
13
+"Rule: ocaml: ml & cmi -> cmx & o (%=src/fordFulkerson )": "NH\210[_\240)6\144(\177'?\001\2204"
14
+"Rule: ocaml: cmx* & o* -> native (%=src/ftest )": "\190\238\178*\217\183\208\002\243m\177K\227T\138*"
14 15
 "Rule: ocaml: mli -> cmi (%=src/tools )": "\239.\206\1667\139\246~\227$\235l\012\210\208;"
15
-"Rule: ocaml: cmx* & o* -> native (%=src/ftest )": "O\\\249\200\251,\018\028\206cr\144\204\180\181\214"
16
-"Rule: ocaml: ml & cmi -> cmx & o (%=src/ftest )": "8u\155\140\162\183(4F\239\206\198\150\176\162\227"
17
-"Rule: ocaml: mli -> cmi (%=src/fordFulkerson )": "\206\016hD\235I\220+\252\2129\195G\179\151g"
16
+"Rule: ocaml: mli -> cmi (%=src/fordFulkerson )": "v\184\208\237V\182T\138\168\207\20258\221\233s"
17
+"Rule: ocaml: ml & cmi -> cmx & o (%=src/ftest )": "S\179.\031\214@{\006P\197\221\"\003\t\173u"
18 18
 "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/graph.ml": "\005\175.\2458\176E\202]\255\235=9\015\000\237"
19 19
 "Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/graph.ml": "\005\175.\2458\176E\202]\255\235=9\015\000\237"
20 20
 "Rule: ocaml: mli -> cmi (%=src/gfile )": "\015\211&r\030l{}\183\187\236\2266\022\129\191"
21 21
 "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/graph.mli": "\031\217\135\022\208\254\154\148\252)\210\130\174\215X\031"
22 22
 "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/gfile.mli": "\203\249\163Ct\234\0067d}\142\011m8T`"
23
-"Rule: ocaml dependencies ml (%=src/tools )": "\228\210\133\187`\193\179>\031\016\197\147\221\006j\017"
24 23
 "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/tools.ml": "~[\186\208\199\129\006\030\012\196\245\183'\163\211&"
24
+"Rule: ocaml dependencies ml (%=src/tools )": "\228\210\133\187`\193\179>\031\016\197\147\221\006j\017"
25 25
 "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/ftest.ml": "~\190 \235\142\210\r\222\253\136>\194\180\207\183\168"
26
-"Rule: ocaml: ml -> cmo & cmi (%=src/ftest )": "aTb\021\214\239K\186C,\231\n\012T'\136"
27
-"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/fordFulkerson.mli": "_;(\155\176\"\225\011\230\191\031M\168\250\219\170"
26
+"Rule: ocaml: ml -> cmo & cmi (%=src/ftest )": "^\163\159\019\141kEw\168\171,\156\252=X\006"
28 27
 "Rule: ocaml dependencies mli (%=src/fordFulkerson )": "\022\200\166Dz0\003\233z\198y\144S\162\2034"
29
-"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/display.mli": "\129\140,\157Z\158D\177\144\227\139t\029Y\253\019"
28
+"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/fordFulkerson.mli": "_;(\155\176\"\225\011\230\191\031M\168\250\219\170"
29
+"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/display.mli": "\1933\002\200+\198\166\181\251\020[Kl\1395\244"
30 30
 "Rule: ocaml: ml & cmi -> cmx & o (%=src/tools )": "z\158\235\155v\003\214Q\150\t\224\"\026\246(\158"
31
-"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/gfile.ml": "\1966\177\141\185,fpl\1987gT\128b\028"
32
-"Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/gfile.ml": "\1966\177\141\185,fpl\1987gT\128b\028"
33 31
 "Rule: ocaml dependencies ml (%=src/fordFulkerson )": "P\128\241\162\216\228\240\163<\168\241\235\129v\231\185"
32
+"Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/gfile.ml": "\1966\177\141\185,fpl\1987gT\128b\028"
33
+"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/gfile.ml": "\1966\177\141\185,fpl\1987gT\128b\028"
34 34
 "Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/tools.mli": "\025v\144\241\237\241\b\248\197tD\012\171\216\202\148"
35 35
 "Rule: ocaml: ml & cmi -> cmx & o (%=src/graph )": "\190\tV\232\254i\031+\141\154\168\219\155n\156C"
36 36
 "Rule: ocaml dependencies ml (%=src/graph )": "\137kk#\140\236\011\255?\132T\225M\018\169\224"
37
-"Rule: ocaml dependencies ml (%=src/display )": "\162K\\\156\237a\012\132\237\169\243\248\212Sb\221"
38 37
 "Rule: ocaml dependencies mli (%=src/graph )": "\012\213_n\023=\207kZ+\251(^M\2028"
38
+"Rule: ocaml dependencies ml (%=src/display )": "\150I\199\147\226\208\148\192\184y\253\190\201\006>\168"
39 39
 "Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/gfile.mli": "\203\249\163Ct\234\0067d}\142\011m8T`"
40
-"Rule: ocaml dependencies mli (%=src/tools )": "\151\181\0055\199\150&\017\021_\215\015\215\018\027+"
41 40
 "Rule: ocaml dependencies ml (%=src/gfile )": "U4(<\t=rQ\240c\0278\231N\1949"
42
-"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/display.ml": "y\135\165\238\138M)N\224\237\005 \027+d\t"
41
+"Rule: ocaml dependencies mli (%=src/tools )": "\151\181\0055\199\150&\017\021_\215\015\215\018\027+"
42
+"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/display.ml": "\253\183m\179\227\189\240\189Z\198>\208jt\007#"

+ 30
- 13
_build/_log View File

@@ -1,8 +1,8 @@
1 1
 ### Starting build.
2 2
 # Target: src/ftest.ml.depends, tags: { extension:ml, file:src/ftest.ml, include, ocaml, ocamldep, quiet, traverse }
3
-/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/ftest.ml > src/ftest.ml.depends # cached
3
+/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/ftest.ml > src/ftest.ml.depends
4 4
 # Target: src/display.mli.depends, tags: { extension:mli, file:src/display.mli, include, ocaml, ocamldep, quiet, traverse }
5
-/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/display.mli > src/display.mli.depends
5
+/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/display.mli > src/display.mli.depends # cached
6 6
 # Target: src/gfile.mli.depends, tags: { extension:mli, file:src/gfile.mli, include, ocaml, ocamldep, quiet, traverse }
7 7
 /home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/gfile.mli > src/gfile.mli.depends # cached
8 8
 # Target: src/graph.mli.depends, tags: { extension:mli, file:src/graph.mli, include, ocaml, ocamldep, quiet, traverse }
@@ -11,23 +11,40 @@
11 11
 /home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/graph.cmi src/graph.mli # cached
12 12
 # Target: src/gfile.cmi, tags: { byte, compile, extension:mli, file:src/gfile.mli, include, interf, ocaml, quiet, traverse }
13 13
 /home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/gfile.cmi src/gfile.mli # cached
14
+# Target: src/display.cmi, tags: { byte, compile, extension:mli, file:src/display.mli, include, interf, ocaml, quiet, traverse }
15
+/home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/display.cmi src/display.mli # cached
14 16
 # Target: src/fordFulkerson.mli.depends, tags: { extension:mli, file:src/fordFulkerson.mli, include, ocaml, ocamldep, quiet, traverse }
15 17
 /home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/fordFulkerson.mli > src/fordFulkerson.mli.depends # cached
16
-# Target: src/display.cmi, tags: { byte, compile, extension:mli, file:src/display.mli, include, interf, ocaml, quiet, traverse }
17
-/home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/display.cmi src/display.mli
18 18
 # Target: src/tools.mli.depends, tags: { extension:mli, file:src/tools.mli, include, ocaml, ocamldep, quiet, traverse }
19 19
 /home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/tools.mli > src/tools.mli.depends # cached
20 20
 # Target: src/tools.cmi, tags: { byte, compile, extension:mli, file:src/tools.mli, include, interf, ocaml, quiet, traverse }
21 21
 /home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/tools.cmi src/tools.mli # cached
22 22
 # Target: src/fordFulkerson.cmi, tags: { byte, compile, extension:mli, file:src/fordFulkerson.mli, include, interf, ocaml, quiet, traverse }
23
-/home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/fordFulkerson.cmi src/fordFulkerson.mli
23
+/home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/fordFulkerson.cmi src/fordFulkerson.mli # cached
24 24
 # Target: src/ftest.cmo, tags: { byte, compile, extension:cmo, extension:ml, file:src/ftest.cmo, file:src/ftest.ml, implem, include, ocaml, quiet, traverse }
25 25
 /home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/ftest.cmo src/ftest.ml
26
-+ /home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/ftest.cmo src/ftest.ml
27
-File "src/ftest.ml", line 40, characters 43-50:
28
-40 |       let () = exportDifference graphFinal outfile in
29
-                                                ^^^^^^^
30
-Error: This expression has type string but an expression was expected of type
31
-         int Graph.graph
32
-Command exited with code 2.
33
-# Compilation unsuccessful.
26
+# Target: src/display.ml.depends, tags: { extension:ml, file:src/display.ml, include, ocaml, ocamldep, quiet, traverse }
27
+/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/display.ml > src/display.ml.depends # cached
28
+# Target: src/gfile.ml.depends, tags: { extension:ml, file:src/gfile.ml, include, ocaml, ocamldep, quiet, traverse }
29
+/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/gfile.ml > src/gfile.ml.depends # cached
30
+# Target: src/graph.ml.depends, tags: { extension:ml, file:src/graph.ml, include, ocaml, ocamldep, quiet, traverse }
31
+/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/graph.ml > src/graph.ml.depends # cached
32
+# Target: src/graph.cmx, tags: { compile, extension:cmx, extension:ml, file:src/graph.cmx, file:src/graph.ml, implem, include, native, ocaml, quiet, traverse }
33
+/home/chepycou/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/graph.cmx src/graph.ml # cached
34
+# Target: src/gfile.cmx, tags: { compile, extension:cmx, extension:ml, file:src/gfile.cmx, file:src/gfile.ml, implem, include, native, ocaml, quiet, traverse }
35
+/home/chepycou/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/gfile.cmx src/gfile.ml # cached
36
+# Target: src/display.cmx, tags: { compile, extension:cmx, extension:ml, file:src/display.cmx, file:src/display.ml, implem, include, native, ocaml, quiet, traverse }
37
+/home/chepycou/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/display.cmx src/display.ml # cached
38
+# Target: src/fordFulkerson.ml.depends, tags: { extension:ml, file:src/fordFulkerson.ml, include, ocaml, ocamldep, quiet, traverse }
39
+/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/fordFulkerson.ml > src/fordFulkerson.ml.depends # cached
40
+# Target: src/tools.ml.depends, tags: { extension:ml, file:src/tools.ml, include, ocaml, ocamldep, quiet, traverse }
41
+/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/tools.ml > src/tools.ml.depends # cached
42
+# Target: src/tools.cmx, tags: { compile, extension:cmx, extension:ml, file:src/tools.cmx, file:src/tools.ml, implem, include, native, ocaml, quiet, traverse }
43
+/home/chepycou/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/tools.cmx src/tools.ml # cached
44
+# Target: src/fordFulkerson.cmx, tags: { compile, extension:cmx, extension:ml, file:src/fordFulkerson.cmx, file:src/fordFulkerson.ml, implem, include, native, ocaml, quiet, traverse }
45
+/home/chepycou/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/fordFulkerson.cmx src/fordFulkerson.ml # cached
46
+# Target: src/ftest.cmx, tags: { compile, extension:cmx, extension:ml, file:src/ftest.cmx, file:src/ftest.ml, implem, include, native, ocaml, quiet, traverse }
47
+/home/chepycou/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/ftest.cmx src/ftest.ml
48
+# Target: src/ftest.native, tags: { dont_link_with, extension:native, file:src/ftest.native, include, link, native, ocaml, program, quiet, traverse }
49
+/home/chepycou/.opam/4.14.0/bin/ocamlopt.opt -I src src/graph.cmx src/gfile.cmx src/display.cmx src/tools.cmx src/fordFulkerson.cmx src/ftest.cmx -o src/ftest.native
50
+# Compilation successful.

BIN
_build/src/ftest.cmi View File


BIN
_build/src/ftest.cmx View File


+ 4
- 3
_build/src/ftest.ml View File

@@ -33,12 +33,13 @@
33 33
 
34 34
       let graphInt = gmap graph int_of_string in
35 35
 
36
-      let graphSolved = main graphInt 0 5 in
36
+      let graphSolved = main graphInt 0 3 in
37 37
 
38
-      let graphFinal = gmap graphSolved string_of_int in
39 38
 
40
-      let () = exportDifference graphFinal outfile in
39
+       let () = exportDifference graphInt graphSolved outfile in
41 40
       ()
41
+
42
+
42 43
       (* Rewrite the graph that has been read.
43 44
       let () = write_file outfile graphDot in
44 45
       ()

BIN
_build/src/ftest.native View File


BIN
_build/src/ftest.o View File


+ 17
- 21
outfile View File

@@ -1,29 +1,25 @@
1 1
 
2
-    digraph finite_state_machine {
2
+        digraph finite_state_machine {
3 3
 
4
-    	fontname="Helvetica,Arial,sans-serif"
4
+            fontname="Helvetica,Arial,sans-serif"
5 5
 
6
-    	node [fontname="Helvetica,Arial,sans-serif"]
6
+            node [fontname="Helvetica,Arial,sans-serif"]
7 7
 
8
-    	edge [fontname="Helvetica,Arial,sans-serif"]
8
+            edge [fontname="Helvetica,Arial,sans-serif"]
9 9
 
10
-    	rankdir=LR;
10
+            rankdir=LR;
11 11
 
12
-    	node [shape = circle];
12
+            node [shape = circle];
13 13
 
14
-    
15
- 5 -> 1 [label = "17"];
16
- 5 -> 4 [label = "8"];
17
- 1 -> 5 [label = "4"];
18
- 1 -> 3 [label = "10"];
19
- 1 -> 0 [label = "7"];
20
- 1 -> 4 [label = "1"];
21
- 3 -> 1 [label = "1"];
22
- 3 -> 0 [label = "10"];
23
- 3 -> 2 [label = "2"];
24
- 3 -> 4 [label = "5"];
25
- 2 -> 0 [label = "8"];
26
- 2 -> 4 [label = "4"];
27
- 4 -> 2 [label = "8"];
28
- 4 -> 5 [label = "6"];
14
+        
15
+ 4 -> 5 [label = "0/14"];
16
+ 1 -> 5 [label = "0/21"];
17
+ 1 -> 4 [label = "0/1"];
18
+ 3 -> 1 [label = "0/11"];
19
+ 3 -> 2 [label = "0/2"];
20
+ 3 -> 4 [label = "0/5"];
21
+ 2 -> 4 [label = "0/12"];
22
+ 0 -> 1 [label = "0/7"];
23
+ 0 -> 3 [label = "10/10"];
24
+ 0 -> 2 [label = "0/8"];
29 25
 }

+ 9
- 2
src/display.ml View File

@@ -5,7 +5,10 @@ open Gfile
5 5
 let exportBase g path =
6 6
     let str = e_fold
7 7
         g
8
-        (fun x id1 id2 label -> x ^ "\n " ^ (string_of_int id1) ^ " -> " ^ (string_of_int id2) ^ " [label = \"" ^ label ^"\"];" )
8
+        (fun x id1 id2 label -> x ^ "\n "
9
+            ^ (string_of_int id1) ^ " -> "
10
+            ^ (string_of_int id2) ^ " [label = \""
11
+            ^ (string_of_int label) ^ "\"];" )
9 12
         ""
10 13
     in
11 14
 
@@ -40,7 +43,11 @@ let exportDifference gStart gEnd path =
40 43
     in
41 44
         let str = e_fold
42 45
             gStart
43
-            (fun x id1 id2 label -> x ^ "\n " ^ (string_of_int id1) ^ " -> " ^ (string_of_int id2) ^ " [label = \"" ^ string_of_int (findUsedCapacity gEnd id1 id2 (int_of_string label))  ^ "/" ^ label  ^"\"];" )
46
+            (fun x id1 id2 label -> x ^ "\n "
47
+                ^ (string_of_int id1) ^ " -> "
48
+                ^ (string_of_int id2) ^ " [label = \""
49
+                ^ string_of_int (findUsedCapacity gEnd id1 id2 label)  ^ "/"
50
+                ^ (string_of_int label)  ^"\"];" )
44 51
             ""
45 52
         in
46 53
 

+ 2
- 2
src/display.mli View File

@@ -1,4 +1,4 @@
1 1
 open Graph
2 2
 open Gfile
3
-val exportBase: string graph -> path -> unit
4
-val exportDifference: string graph -> int graph -> path -> unit
3
+val exportBase: int graph -> path -> unit
4
+val exportDifference: int graph -> int graph -> path -> unit

+ 2
- 5
src/ftest.ml View File

@@ -33,13 +33,10 @@
33 33
 
34 34
       let graphInt = gmap graph int_of_string in
35 35
 
36
-      let graphSolved = main graphInt 0 5 in
36
+      let graphSolved = main graphInt 0 3 in
37 37
 
38
-      let graphFinal = gmap graphSolved string_of_int in
39 38
 
40
-
41
-      (*TODO : gérer les strings / non-strings ==> tout display à partir de type INT ça sera plus simple *)
42
-      let () = exportDifference graphFinal outfile in
39
+       let () = exportDifference graphInt graphSolved outfile in
43 40
       ()
44 41
 
45 42
 

+ 80
- 108
test.svg View File

@@ -4,144 +4,116 @@
4 4
 <!-- Generated by graphviz version 2.50.0 (0)
5 5
  -->
6 6
 <!-- Title: finite_state_machine Pages: 1 -->
7
-<svg width="468pt" height="221pt"
8
- viewBox="0.00 0.00 468.00 221.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
-<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 217)">
7
+<svg width="447pt" height="155pt"
8
+ viewBox="0.00 0.00 447.00 155.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 151)">
10 10
 <title>finite_state_machine</title>
11
-<polygon fill="white" stroke="transparent" points="-4,4 -4,-217 464,-217 464,4 -4,4"/>
12
-<!-- 5 -->
11
+<polygon fill="white" stroke="transparent" points="-4,4 -4,-151 443,-151 443,4 -4,4"/>
12
+<!-- 4 -->
13 13
 <g id="node1" class="node">
14
-<title>5</title>
15
-<ellipse fill="none" stroke="black" cx="18" cy="-18" rx="18" ry="18"/>
16
-<text text-anchor="middle" x="18" y="-14.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">5</text>
14
+<title>4</title>
15
+<ellipse fill="none" stroke="black" cx="322" cy="-77" rx="18" ry="18"/>
16
+<text text-anchor="middle" x="322" y="-73.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">4</text>
17 17
 </g>
18
-<!-- 1 -->
18
+<!-- 5 -->
19 19
 <g id="node2" class="node">
20
-<title>1</title>
21
-<ellipse fill="none" stroke="black" cx="106" cy="-78" rx="18" ry="18"/>
22
-<text text-anchor="middle" x="106" y="-74.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">1</text>
20
+<title>5</title>
21
+<ellipse fill="none" stroke="black" cx="421" cy="-108" rx="18" ry="18"/>
22
+<text text-anchor="middle" x="421" y="-104.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">5</text>
23 23
 </g>
24
-<!-- 5&#45;&gt;1 -->
24
+<!-- 4&#45;&gt;5 -->
25 25
 <g id="edge1" class="edge">
26
-<title>5&#45;&gt;1</title>
27
-<path fill="none" stroke="black" d="M29.99,-31.49C36.44,-38.8 45.06,-47.62 54,-54 61.67,-59.47 70.79,-64.23 79.18,-68.02"/>
28
-<polygon fill="black" stroke="black" points="77.99,-71.32 88.56,-72.03 80.74,-64.89 77.99,-71.32"/>
29
-<text text-anchor="middle" x="62" y="-66.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">17</text>
26
+<title>4&#45;&gt;5</title>
27
+<path fill="none" stroke="black" d="M339.45,-82.26C354.37,-87.02 376.59,-94.13 393.92,-99.66"/>
28
+<polygon fill="black" stroke="black" points="392.87,-103.01 403.46,-102.72 395,-96.34 392.87,-103.01"/>
29
+<text text-anchor="middle" x="371.5" y="-99.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">0/14</text>
30 30
 </g>
31
-<!-- 4 -->
31
+<!-- 1 -->
32 32
 <g id="node3" class="node">
33
-<title>4</title>
34
-<ellipse fill="none" stroke="black" cx="274" cy="-43" rx="18" ry="18"/>
35
-<text text-anchor="middle" x="274" y="-39.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">4</text>
33
+<title>1</title>
34
+<ellipse fill="none" stroke="black" cx="223" cy="-129" rx="18" ry="18"/>
35
+<text text-anchor="middle" x="223" y="-125.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">1</text>
36 36
 </g>
37
-<!-- 5&#45;&gt;4 -->
38
-<g id="edge2" class="edge">
39
-<title>5&#45;&gt;4</title>
40
-<path fill="none" stroke="black" d="M36.01,-19.23C45.93,-19.97 58.68,-20.97 70,-22 133.06,-27.73 206.99,-35.69 245.9,-39.98"/>
41
-<polygon fill="black" stroke="black" points="245.58,-43.47 255.9,-41.09 246.35,-36.51 245.58,-43.47"/>
42
-<text text-anchor="middle" x="150" y="-33.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">8</text>
37
+<!-- 1&#45;&gt;4 -->
38
+<g id="edge3" class="edge">
39
+<title>1&#45;&gt;4</title>
40
+<path fill="none" stroke="black" d="M238.35,-118.9C244.57,-114.7 252.02,-109.9 259,-106 270.79,-99.41 284.34,-92.95 295.76,-87.81"/>
41
+<polygon fill="black" stroke="black" points="297.42,-90.91 305.15,-83.66 294.58,-84.51 297.42,-90.91"/>
42
+<text text-anchor="middle" x="272.5" y="-109.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">0/1</text>
43 43
 </g>
44 44
 <!-- 1&#45;&gt;5 -->
45
-<g id="edge3" class="edge">
45
+<g id="edge2" class="edge">
46 46
 <title>1&#45;&gt;5</title>
47
-<path fill="none" stroke="black" d="M95.96,-63.01C89.7,-53.77 80.61,-42.33 70,-35 62.87,-30.08 54.21,-26.49 46.06,-23.91"/>
48
-<polygon fill="black" stroke="black" points="46.74,-20.47 36.17,-21.17 44.87,-27.22 46.74,-20.47"/>
49
-<text text-anchor="middle" x="62" y="-38.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">4</text>
50
-</g>
51
-<!-- 1&#45;&gt;4 -->
52
-<g id="edge6" class="edge">
53
-<title>1&#45;&gt;4</title>
54
-<path fill="none" stroke="black" d="M123.83,-74.45C152.66,-68.37 211.73,-55.92 246.26,-48.64"/>
55
-<polygon fill="black" stroke="black" points="247.06,-52.05 256.12,-46.56 245.62,-45.2 247.06,-52.05"/>
56
-<text text-anchor="middle" x="194" y="-66.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">1</text>
47
+<path fill="none" stroke="black" d="M240.99,-128.14C270.43,-126.52 332.78,-122.47 385,-115 387.72,-114.61 390.56,-114.15 393.38,-113.64"/>
48
+<polygon fill="black" stroke="black" points="394.17,-117.05 403.33,-111.73 392.85,-110.18 394.17,-117.05"/>
49
+<text text-anchor="middle" x="322" y="-126.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">0/21</text>
57 50
 </g>
58 51
 <!-- 3 -->
59 52
 <g id="node4" class="node">
60 53
 <title>3</title>
61
-<ellipse fill="none" stroke="black" cx="194" cy="-109" rx="18" ry="18"/>
62
-<text text-anchor="middle" x="194" y="-105.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">3</text>
63
-</g>
64
-<!-- 1&#45;&gt;3 -->
65
-<g id="edge4" class="edge">
66
-<title>1&#45;&gt;3</title>
67
-<path fill="none" stroke="black" d="M124.08,-75.98C134.26,-75.43 147.24,-75.88 158,-80 163.53,-82.12 168.82,-85.48 173.54,-89.18"/>
68
-<polygon fill="black" stroke="black" points="171.52,-92.06 181.35,-96.01 176.12,-86.79 171.52,-92.06"/>
69
-<text text-anchor="middle" x="150" y="-83.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">10</text>
70
-</g>
71
-<!-- 0 -->
72
-<g id="node5" class="node">
73
-<title>0</title>
74
-<ellipse fill="none" stroke="black" cx="442" cy="-152" rx="18" ry="18"/>
75
-<text text-anchor="middle" x="442" y="-148.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">0</text>
54
+<ellipse fill="none" stroke="black" cx="124" cy="-72" rx="18" ry="18"/>
55
+<text text-anchor="middle" x="124" y="-68.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">3</text>
76 56
 </g>
77
-<!-- 1&#45;&gt;0 -->
78
-<g id="edge5" class="edge">
79
-<title>1&#45;&gt;0</title>
80
-<path fill="none" stroke="black" d="M110.87,-95.45C119.4,-128.73 143.15,-198 193,-198 193,-198 193,-198 363,-198 385.28,-198 406.81,-183.9 421.58,-171.31"/>
81
-<polygon fill="black" stroke="black" points="423.97,-173.87 429.05,-164.57 419.28,-168.67 423.97,-173.87"/>
82
-<text text-anchor="middle" x="274" y="-201.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">7</text>
57
+<!-- 3&#45;&gt;4 -->
58
+<g id="edge6" class="edge">
59
+<title>3&#45;&gt;4</title>
60
+<path fill="none" stroke="black" d="M142.05,-72.43C176.08,-73.3 252.66,-75.26 293.74,-76.3"/>
61
+<polygon fill="black" stroke="black" points="293.76,-79.81 303.85,-76.56 293.94,-72.81 293.76,-79.81"/>
62
+<text text-anchor="middle" x="223" y="-77.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">0/5</text>
83 63
 </g>
84
-<!-- 4&#45;&gt;5 -->
85
-<g id="edge14" class="edge">
86
-<title>4&#45;&gt;5</title>
87
-<path fill="none" stroke="black" d="M256.93,-36.84C234.98,-28.78 194.2,-15.09 158,-10 119.33,-4.56 74.11,-9.17 46.01,-13.32"/>
88
-<polygon fill="black" stroke="black" points="45.12,-9.91 35.78,-14.92 46.2,-16.83 45.12,-9.91"/>
89
-<text text-anchor="middle" x="150" y="-13.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">6</text>
64
+<!-- 3&#45;&gt;1 -->
65
+<g id="edge4" class="edge">
66
+<title>3&#45;&gt;1</title>
67
+<path fill="none" stroke="black" d="M140.22,-79.91C152.89,-86.6 171.33,-96.57 187,-106 190.96,-108.38 195.12,-111 199.12,-113.59"/>
68
+<polygon fill="black" stroke="black" points="197.24,-116.54 207.52,-119.11 201.09,-110.7 197.24,-116.54"/>
69
+<text text-anchor="middle" x="173.5" y="-109.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">0/11</text>
90 70
 </g>
91 71
 <!-- 2 -->
92
-<g id="node6" class="node">
72
+<g id="node5" class="node">
93 73
 <title>2</title>
94
-<ellipse fill="none" stroke="black" cx="362" cy="-93" rx="18" ry="18"/>
95
-<text text-anchor="middle" x="362" y="-89.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">2</text>
74
+<ellipse fill="none" stroke="black" cx="223" cy="-18" rx="18" ry="18"/>
75
+<text text-anchor="middle" x="223" y="-14.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">2</text>
96 76
 </g>
97
-<!-- 4&#45;&gt;2 -->
98
-<g id="edge13" class="edge">
99
-<title>4&#45;&gt;2</title>
100
-<path fill="none" stroke="black" d="M289.98,-51.71C303.05,-59.31 322.24,-70.47 337.38,-79.27"/>
101
-<polygon fill="black" stroke="black" points="335.79,-82.39 346.19,-84.39 339.31,-76.34 335.79,-82.39"/>
102
-<text text-anchor="middle" x="318" y="-75.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">8</text>
77
+<!-- 3&#45;&gt;2 -->
78
+<g id="edge5" class="edge">
79
+<title>3&#45;&gt;2</title>
80
+<path fill="none" stroke="black" d="M137.57,-59.96C143.94,-54.3 152,-47.77 160,-43 171.26,-36.29 184.65,-30.63 196.1,-26.41"/>
81
+<polygon fill="black" stroke="black" points="197.29,-29.7 205.56,-23.07 194.96,-23.1 197.29,-29.7"/>
82
+<text text-anchor="middle" x="173.5" y="-46.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">0/2</text>
103 83
 </g>
104
-<!-- 3&#45;&gt;1 -->
84
+<!-- 2&#45;&gt;4 -->
105 85
 <g id="edge7" class="edge">
106
-<title>3&#45;&gt;1</title>
107
-<path fill="none" stroke="black" d="M176.22,-105.22C166.15,-102.75 153.17,-99.21 142,-95 138.61,-93.72 135.1,-92.24 131.68,-90.68"/>
108
-<polygon fill="black" stroke="black" points="132.94,-87.41 122.41,-86.24 129.92,-93.72 132.94,-87.41"/>
109
-<text text-anchor="middle" x="150" y="-103.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">1</text>
86
+<title>2&#45;&gt;4</title>
87
+<path fill="none" stroke="black" d="M240.64,-22.76C253.63,-26.92 271.8,-33.76 286,-43 291.78,-46.76 297.42,-51.57 302.43,-56.37"/>
88
+<polygon fill="black" stroke="black" points="300.2,-59.1 309.7,-63.77 305.19,-54.19 300.2,-59.1"/>
89
+<text text-anchor="middle" x="272.5" y="-46.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">0/12</text>
110 90
 </g>
111
-<!-- 3&#45;&gt;4 -->
112
-<g id="edge10" class="edge">
113
-<title>3&#45;&gt;4</title>
114
-<path fill="none" stroke="black" d="M208.23,-97.8C220.22,-87.66 238.09,-72.54 252.03,-60.75"/>
115
-<polygon fill="black" stroke="black" points="254.33,-63.38 259.7,-54.25 249.81,-58.04 254.33,-63.38"/>
116
-<text text-anchor="middle" x="234" y="-80.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">5</text>
91
+<!-- 0 -->
92
+<g id="node6" class="node">
93
+<title>0</title>
94
+<ellipse fill="none" stroke="black" cx="18" cy="-72" rx="18" ry="18"/>
95
+<text text-anchor="middle" x="18" y="-68.3" font-family="Helvetica,Arial,sans-serif" font-size="14.00">0</text>
117 96
 </g>
118
-<!-- 3&#45;&gt;0 -->
97
+<!-- 0&#45;&gt;1 -->
119 98
 <g id="edge8" class="edge">
120
-<title>3&#45;&gt;0</title>
121
-<path fill="none" stroke="black" d="M211.28,-114.1C217.14,-115.82 223.83,-117.64 230,-119 295.34,-133.39 373.41,-143.89 413.79,-148.83"/>
122
-<polygon fill="black" stroke="black" points="413.56,-152.33 423.91,-150.05 414.4,-145.38 413.56,-152.33"/>
123
-<text text-anchor="middle" x="318" y="-139.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">10</text>
99
+<title>0&#45;&gt;1</title>
100
+<path fill="none" stroke="black" d="M33.98,-81.08C40.04,-84.5 47.21,-88.24 54,-91 99.35,-109.46 112.03,-111.17 160,-121 171.32,-123.32 183.96,-125.09 194.85,-126.37"/>
101
+<polygon fill="black" stroke="black" points="194.73,-129.88 205.05,-127.49 195.49,-122.92 194.73,-129.88"/>
102
+<text text-anchor="middle" x="124" y="-120.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">0/7</text>
124 103
 </g>
125
-<!-- 3&#45;&gt;2 -->
104
+<!-- 0&#45;&gt;3 -->
126 105
 <g id="edge9" class="edge">
127
-<title>3&#45;&gt;2</title>
128
-<path fill="none" stroke="black" d="M212.14,-107.35C240.84,-104.58 298.87,-98.99 333.39,-95.66"/>
129
-<polygon fill="black" stroke="black" points="334.09,-99.11 343.7,-94.67 333.42,-92.14 334.09,-99.11"/>
130
-<text text-anchor="middle" x="274" y="-106.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">2</text>
106
+<title>0&#45;&gt;3</title>
107
+<path fill="none" stroke="black" d="M36.17,-72C52.36,-72 76.87,-72 95.73,-72"/>
108
+<polygon fill="black" stroke="black" points="95.8,-75.5 105.8,-72 95.8,-68.5 95.8,-75.5"/>
109
+<text text-anchor="middle" x="71" y="-75.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">10/10</text>
131 110
 </g>
132
-<!-- 2&#45;&gt;4 -->
133
-<g id="edge12" class="edge">
134
-<title>2&#45;&gt;4</title>
135
-<path fill="none" stroke="black" d="M354.62,-76.39C349.05,-64.44 339.68,-49.2 326,-42 318.62,-38.11 309.76,-37.22 301.51,-37.65"/>
136
-<polygon fill="black" stroke="black" points="301.1,-34.17 291.55,-38.77 301.88,-41.13 301.1,-34.17"/>
137
-<text text-anchor="middle" x="318" y="-45.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">4</text>
138
-</g>
139
-<!-- 2&#45;&gt;0 -->
140
-<g id="edge11" class="edge">
141
-<title>2&#45;&gt;0</title>
142
-<path fill="none" stroke="black" d="M377.55,-102.71C385.98,-108.44 396.73,-115.94 406,-123 410.63,-126.52 415.5,-130.43 420.08,-134.19"/>
143
-<polygon fill="black" stroke="black" points="417.99,-137.01 427.91,-140.72 422.47,-131.63 417.99,-137.01"/>
144
-<text text-anchor="middle" x="402" y="-126.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">8</text>
111
+<!-- 0&#45;&gt;2 -->
112
+<g id="edge10" class="edge">
113
+<title>0&#45;&gt;2</title>
114
+<path fill="none" stroke="black" d="M33.77,-62.89C50.59,-53 79.22,-37.6 106,-30 135.56,-21.61 170.84,-18.95 194.67,-18.18"/>
115
+<polygon fill="black" stroke="black" points="194.83,-21.67 204.75,-17.94 194.67,-14.68 194.83,-21.67"/>
116
+<text text-anchor="middle" x="124" y="-33.8" font-family="Helvetica,Arial,sans-serif" font-size="14.00">0/8</text>
145 117
 </g>
146 118
 </g>
147 119
 </svg>

Loading…
Cancel
Save