diff --git a/_build/_digests b/_build/_digests index 8080847..2a54dc8 100644 --- a/_build/_digests +++ b/_build/_digests @@ -1,27 +1,29 @@ "Rule: ocaml dependencies mli (%=src/gfile )": "7\182\192g\020\238\188\b\211\164{\014\157\135\011\003" "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/tools.mli": "9\173\222\177]e\245\229\131\151\020fsu\133@" +"Rule: ocaml: ml & cmi -> cmx & o (%=src/gfile )": "\236O\148Y\157m\028\183\166?\231a\231\187u\132" "Rule: ocaml dependencies ml (%=src/ftest )": "b\201\017\148\224\147!\233\229\244\171s cmx & o (%=src/gfile )": "\182Q)\149\222\216>\226\020\149\246\194]5\249P" -"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/ftest.ml": "\007\196\023\203\192\230\143\1569\199\162\136\173\005;S" -"Rule: ocaml: mli -> cmi (%=src/graph )": "ZJ:\176\2527A6\005k\191 cmi (%=src/tools )": "\176h\209/\001\212$k\139(\220\204\150Aq\251" +"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/ftest.ml": "~\190 \235\142\210\r\222\253\136>\194\180\207\183\168" +"Rule: ocaml: mli -> cmi (%=src/graph )": ")2\159\205\136\031\251\145\0263\01878\001\b\134" +"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" +"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/tools.ml": "\021\223v\253\172\1820\185\180f[\180\189P\r)" "Rule: ocaml: cmx* & o* -> native (%=src/ftest )": "\028v\248\005\138\247 \162\160\253\214\194a\167\011\174" +"Rule: ocaml: mli -> cmi (%=src/tools )": "*\130\\\221>3X\156\180\205\"\245\255-\230~" "Rule: ocaml: ml & cmi -> cmx & o (%=src/ftest )": "\237\160\207\006\164Q\152#\240Q\196\136\242\206'\194" "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/graph.ml": "\005\175.\2458\176E\202]\255\235=9\015\000\237" "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" -"Rule: ocaml: mli -> cmi (%=src/gfile )": "\2028\135\152o,Y9\219\178\241C\150A*\209" +"Rule: ocaml: mli -> cmi (%=src/gfile )": "\015\211&r\030l{}\183\187\236\2266\022\129\191" "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" "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/gfile.mli": "\203\249\163Ct\234\0067d}\142\011m8T`" -"Rule: ocaml dependencies ml (%=src/tools )": "@\146\174l\148\031\206 \152\144\169\127\219\241\171\219" "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/tools.ml": "~[\186\208\199\129\006\030\012\196\245\183'\163\211&" +"Rule: ocaml dependencies ml (%=src/tools )": "u\207\140\137\026\138+o\170\142E\195\193\183k9" "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/ftest.ml": "~\190 \235\142\210\r\222\253\136>\194\180\207\183\168" -"Rule: ocaml: ml -> cmo & cmi (%=src/ftest )": "\199c\170\173N\127:;\2025\231\252\136+T\184" -"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/gfile.ml": "\1966\177\141\185,fpl\1987gT\128b\028" +"Rule: ocaml: ml -> cmo & cmi (%=src/ftest )": ":=\223\176n\222\012\220\136\154\171h\019\1591\176" "Resource: /home/alejeune/Documents/4ir/S1/Ocaml/FordFulkersonLeChameau/src/gfile.ml": "\1966\177\141\185,fpl\1987gT\128b\028" -"Rule: ocaml: ml & cmi -> cmx & o (%=src/graph )": "\210F\017y\223{\198]\215\245\217O\191 \169\220" +"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/gfile.ml": "\1966\177\141\185,fpl\1987gT\128b\028" +"Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/tools.mli": "9\173\222\177]e\245\229\131\151\020fsu\133@" +"Rule: ocaml: ml & cmi -> cmx & o (%=src/graph )": "\190\tV\232\254i\031+\141\154\168\219\155n\156C" "Rule: ocaml dependencies ml (%=src/graph )": "\137kk#\140\236\011\255?\132T\225M\018\169\224" -"Rule: ocaml dependencies mli (%=src/graph )": "\b\217\022sE\156(F\165M\014)D\182\178e" +"Rule: ocaml dependencies mli (%=src/graph )": "\012\213_n\023=\207kZ+\251(^M\2028" "Resource: /home/chepycou/Documents/cours/4-IR/functionalProgramming/Projet/repoGit/ocaml-maxflow-project/src/gfile.mli": "\203\249\163Ct\234\0067d}\142\011m8T`" -"Rule: ocaml dependencies mli (%=src/tools )": "\22566|\026\\\138\197K\020\155\144/$\219\161" "Rule: ocaml dependencies ml (%=src/gfile )": "U4(<\t=rQ\240c\0278\231N\1949" +"Rule: ocaml dependencies mli (%=src/tools )": "\22566|\026\\\138\197K\020\155\144/$\219\161" diff --git a/_build/_log b/_build/_log index 7be03b8..4142a45 100644 --- a/_build/_log +++ b/_build/_log @@ -1,37 +1,45 @@ ### Starting build. # Target: src/ftest.ml.depends, tags: { extension:ml, file:src/ftest.ml, include, ocaml, ocamldep, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamldep.opt -modules src/ftest.ml > src/ftest.ml.depends +/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/ftest.ml > src/ftest.ml.depends # cached # Target: src/gfile.mli.depends, tags: { extension:mli, file:src/gfile.mli, include, ocaml, ocamldep, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamldep.opt -modules src/gfile.mli > src/gfile.mli.depends # cached +/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/gfile.mli > src/gfile.mli.depends # cached # Target: src/graph.mli.depends, tags: { extension:mli, file:src/graph.mli, include, ocaml, ocamldep, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamldep.opt -modules src/graph.mli > src/graph.mli.depends # cached +/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/graph.mli > src/graph.mli.depends # cached # Target: src/graph.cmi, tags: { byte, compile, extension:mli, file:src/graph.mli, include, interf, ocaml, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/graph.cmi src/graph.mli # cached +/home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/graph.cmi src/graph.mli # cached # Target: src/gfile.cmi, tags: { byte, compile, extension:mli, file:src/gfile.mli, include, interf, ocaml, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/gfile.cmi src/gfile.mli # cached +/home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/gfile.cmi src/gfile.mli # cached # Target: src/tools.mli.depends, tags: { extension:mli, file:src/tools.mli, include, ocaml, ocamldep, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamldep.opt -modules src/tools.mli > src/tools.mli.depends +/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/tools.mli > src/tools.mli.depends # cached # Target: src/tools.cmi, tags: { byte, compile, extension:mli, file:src/tools.mli, include, interf, ocaml, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/tools.cmi src/tools.mli +/home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/tools.cmi src/tools.mli # cached # Target: src/ftest.cmo, tags: { byte, compile, extension:cmo, extension:ml, file:src/ftest.cmo, file:src/ftest.ml, implem, include, ocaml, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/ftest.cmo src/ftest.ml +/home/chepycou/.opam/4.14.0/bin/ocamlc.opt -c -I src -o src/ftest.cmo src/ftest.ml # cached # Target: src/gfile.ml.depends, tags: { extension:ml, file:src/gfile.ml, include, ocaml, ocamldep, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamldep.opt -modules src/gfile.ml > src/gfile.ml.depends # cached +/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/gfile.ml > src/gfile.ml.depends # cached # Target: src/graph.ml.depends, tags: { extension:ml, file:src/graph.ml, include, ocaml, ocamldep, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamldep.opt -modules src/graph.ml > src/graph.ml.depends # cached +/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/graph.ml > src/graph.ml.depends # cached # Target: src/graph.cmx, tags: { compile, extension:cmx, extension:ml, file:src/graph.cmx, file:src/graph.ml, implem, include, native, ocaml, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/graph.cmx src/graph.ml # cached +/home/chepycou/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/graph.cmx src/graph.ml # cached # Target: src/gfile.cmx, tags: { compile, extension:cmx, extension:ml, file:src/gfile.cmx, file:src/gfile.ml, implem, include, native, ocaml, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/gfile.cmx src/gfile.ml # cached +/home/chepycou/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/gfile.cmx src/gfile.ml # cached # Target: src/tools.ml.depends, tags: { extension:ml, file:src/tools.ml, include, ocaml, ocamldep, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamldep.opt -modules src/tools.ml > src/tools.ml.depends +/home/chepycou/.opam/4.14.0/bin/ocamldep.opt -modules src/tools.ml > src/tools.ml.depends # cached # Target: src/tools.cmx, tags: { compile, extension:cmx, extension:ml, file:src/tools.cmx, file:src/tools.ml, implem, include, native, ocaml, quiet, traverse } -/mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/tools.cmx src/tools.ml -+ /mnt/commetud/GEI/OCaml/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/tools.cmx src/tools.ml +/home/chepycou/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/tools.cmx src/tools.ml ++ /home/chepycou/.opam/4.14.0/bin/ocamlopt.opt -c -I src -o src/tools.cmx src/tools.ml File "src/tools.ml", line 1: Error: The implementation src/tools.ml does not match the interface src/tools.cmi: - The value `add_arc' is required but not provided - File "src/tools.mli", line 5, characters 0-54: Expected declaration + Values do not match: + val gmap : 'a Graph.graph -> ('a -> int) -> int Graph.graph + is not included in + val gmap : 'a Graph.graph -> ('a -> 'b) -> 'b Graph.graph + The type 'a Graph.graph -> ('a -> int) -> int Graph.graph + is not compatible with the type + 'a Graph.graph -> ('a -> 'b) -> 'b Graph.graph + Type int is not compatible with type 'b + File "src/tools.mli", line 4, characters 0-44: Expected declaration + File "src/tools.ml", line 16, characters 4-8: Actual declaration Command exited with code 2. # Compilation unsuccessful. diff --git a/_build/ocamlc.where b/_build/ocamlc.where index 58675aa..8f0bc6b 100644 --- a/_build/ocamlc.where +++ b/_build/ocamlc.where @@ -1 +1 @@ -/mnt/commetud/GEI/OCaml/.opam/4.14.0/lib/ocaml +/home/chepycou/.opam/4.14.0/lib/ocaml diff --git a/_build/src/ftest.cmi b/_build/src/ftest.cmi index c1ab6c4..e83d23b 100644 Binary files a/_build/src/ftest.cmi and b/_build/src/ftest.cmi differ diff --git a/_build/src/ftest.cmo b/_build/src/ftest.cmo index 5f02acf..9e9cd00 100644 Binary files a/_build/src/ftest.cmo and b/_build/src/ftest.cmo differ diff --git a/_build/src/gfile.cmi b/_build/src/gfile.cmi index 528fcc4..6057676 100644 Binary files a/_build/src/gfile.cmi and b/_build/src/gfile.cmi differ diff --git a/_build/src/gfile.cmx b/_build/src/gfile.cmx index 865caea..a70fe51 100644 Binary files a/_build/src/gfile.cmx and b/_build/src/gfile.cmx differ diff --git a/_build/src/gfile.o b/_build/src/gfile.o index 9fa0b9f..52f4f59 100644 Binary files a/_build/src/gfile.o and b/_build/src/gfile.o differ diff --git a/_build/src/graph.cmi b/_build/src/graph.cmi index a1a8cfb..2f97542 100644 Binary files a/_build/src/graph.cmi and b/_build/src/graph.cmi differ diff --git a/_build/src/graph.cmx b/_build/src/graph.cmx index 34042ca..0f9e748 100644 Binary files a/_build/src/graph.cmx and b/_build/src/graph.cmx differ diff --git a/_build/src/graph.mli b/_build/src/graph.mli index dd9c265..05607c5 100644 --- a/_build/src/graph.mli +++ b/_build/src/graph.mli @@ -1,4 +1,4 @@ - + (* Type of a directed graph in which arcs have labels of type 'a. *) type 'a graph diff --git a/_build/src/graph.o b/_build/src/graph.o index f21c5aa..638e174 100644 Binary files a/_build/src/graph.o and b/_build/src/graph.o differ diff --git a/src/tools.ml b/src/tools.ml index 7a8836e..1937ab6 100644 --- a/src/tools.ml +++ b/src/tools.ml @@ -4,11 +4,14 @@ open Graph (* assert false is of type ∀α.α, so the type-checker is happy. *) (* returns a new graph having the same nodes than gr, but no arc. *) -let clone_nodes gr = n_fold gr new_node empty_graph; -(* maps all arcs of gr by function f *) -let gmap gr f = e_fold gr (fun acc id1 id2 x -> add_arc id1 id2 (f x)) (clone_nodes gr); - +let clone_nodes gr = n_fold gr new_node empty_graph +(*adds an arc or its value if there is an existing one*) let add_arc g id1 id2 n = match find_arc g id1 id2 with - | None -> new_arc(g id1 id2 n graph) - | Some a -> new_arc(g id1 id2 n+a graph) \ No newline at end of file + | None -> new_arc g id1 id2 n + | Some a -> new_arc g id1 id2 (n + a) + +(* maps all arcs of gr by function f *) +let gmap gr f = e_fold gr (fun acc id1 id2 x -> add_arc acc id1 id2 (f x)) (clone_nodes gr) + (*TODO : ici rajouter un new_arc plutôt qu'un add_arc*) +