diff --git a/dm4/lib/lib.ml b/dm4/dm4.ml similarity index 100% rename from dm4/lib/lib.ml rename to dm4/dm4.ml diff --git a/dm4/dm4.opam b/dm4/dm4.opam deleted file mode 100644 index a43bbcb..0000000 --- a/dm4/dm4.opam +++ /dev/null @@ -1,32 +0,0 @@ -# This file is generated by dune, edit dune-project instead -opam-version: "2.0" -synopsis: "A short synopsis" -description: "A longer description" -maintainer: ["Maintainer Name "] -authors: ["Author Name "] -license: "LICENSE" -tags: ["add topics" "to describe" "your" "project"] -homepage: "https://github.com/username/reponame" -doc: "https://url/to/documentation" -bug-reports: "https://github.com/username/reponame/issues" -depends: [ - "dune" {>= "3.20"} - "ocaml" - "odoc" {with-doc} -] -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@runtest" {with-test} - "@doc" {with-doc} - ] -] -dev-repo: "git+https://github.com/username/reponame.git" -x-maintenance-intent: ["(latest)"] diff --git a/dm4/dune b/dm4/dune new file mode 100644 index 0000000..e7f4b63 --- /dev/null +++ b/dm4/dune @@ -0,0 +1,9 @@ +(library + (name dm4) + (modules dm4) +) +(executable + (name test) + (modules test) + (libraries dm4) +) diff --git a/dm4/dune-project b/dm4/dune-project deleted file mode 100644 index 3e0cb80..0000000 --- a/dm4/dune-project +++ /dev/null @@ -1,26 +0,0 @@ -(lang dune 3.20) - -(name dm4) - -(generate_opam_files true) - -(source - (github username/reponame)) - -(authors "Author Name ") - -(maintainers "Maintainer Name ") - -(license LICENSE) - -(documentation https://url/to/documentation) - -(package - (name dm4) - (synopsis "A short synopsis") - (description "A longer description") - (depends ocaml) - (tags - ("add topics" "to describe" your project))) - -; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html diff --git a/dm4/lib/dune b/dm4/lib/dune deleted file mode 100644 index 3247f9b..0000000 --- a/dm4/lib/dune +++ /dev/null @@ -1,3 +0,0 @@ -(library - (name lib) - (public_name dm4)) diff --git a/dm4/test/test_dm4.ml b/dm4/test.ml similarity index 98% rename from dm4/test/test_dm4.ml rename to dm4/test.ml index 899648d..37914ca 100644 --- a/dm4/test/test_dm4.ml +++ b/dm4/test.ml @@ -1,4 +1,4 @@ -open Lib;; +open Dm4;; assert (plusetfois 5 6 = (11, 30));; diff --git a/dm4/test/dune b/dm4/test/dune deleted file mode 100644 index b0b4a2f..0000000 --- a/dm4/test/dune +++ /dev/null @@ -1,3 +0,0 @@ -(executable - (name test_dm4) - (libraries lib)) diff --git a/dm5/lib/lib.ml b/dm5/dm5.ml similarity index 100% rename from dm5/lib/lib.ml rename to dm5/dm5.ml diff --git a/dm5/dm5.opam b/dm5/dm5.opam deleted file mode 100644 index a43bbcb..0000000 --- a/dm5/dm5.opam +++ /dev/null @@ -1,32 +0,0 @@ -# This file is generated by dune, edit dune-project instead -opam-version: "2.0" -synopsis: "A short synopsis" -description: "A longer description" -maintainer: ["Maintainer Name "] -authors: ["Author Name "] -license: "LICENSE" -tags: ["add topics" "to describe" "your" "project"] -homepage: "https://github.com/username/reponame" -doc: "https://url/to/documentation" -bug-reports: "https://github.com/username/reponame/issues" -depends: [ - "dune" {>= "3.20"} - "ocaml" - "odoc" {with-doc} -] -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@runtest" {with-test} - "@doc" {with-doc} - ] -] -dev-repo: "git+https://github.com/username/reponame.git" -x-maintenance-intent: ["(latest)"] diff --git a/dm5/dune b/dm5/dune new file mode 100644 index 0000000..9572003 --- /dev/null +++ b/dm5/dune @@ -0,0 +1,9 @@ +(library + (name dm5) + (modules dm5) +) +(executable + (name test) + (modules test) + (libraries dm5) +) diff --git a/dm5/dune-project b/dm5/dune-project deleted file mode 100644 index 52a81e5..0000000 --- a/dm5/dune-project +++ /dev/null @@ -1,26 +0,0 @@ -(lang dune 3.20) - -(name dm5) - -(generate_opam_files true) - -(source - (github username/reponame)) - -(authors "Author Name ") - -(maintainers "Maintainer Name ") - -(license LICENSE) - -(documentation https://url/to/documentation) - -(package - (name dm5) - (synopsis "A short synopsis") - (description "A longer description") - (depends ocaml) - (tags - ("add topics" "to describe" your project))) - -; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html diff --git a/dm5/lib/dune b/dm5/lib/dune deleted file mode 100644 index 794f940..0000000 --- a/dm5/lib/dune +++ /dev/null @@ -1,3 +0,0 @@ -(library - (name lib) - (public_name dm5)) diff --git a/dm5/test/test.ml b/dm5/test.ml similarity index 97% rename from dm5/test/test.ml rename to dm5/test.ml index 3513b98..14ee239 100644 --- a/dm5/test/test.ml +++ b/dm5/test.ml @@ -1,4 +1,4 @@ -open Lib;; +open Dm5;; assert (rotation [| diff --git a/dm5/test/dune b/dm5/test/dune deleted file mode 100644 index d2d6441..0000000 --- a/dm5/test/dune +++ /dev/null @@ -1,4 +0,0 @@ -(executable - (name test) - (public_name test) - (libraries lib)) diff --git a/dune-project b/dune-project new file mode 100644 index 0000000..ada09b2 --- /dev/null +++ b/dune-project @@ -0,0 +1 @@ +(lang dune 3.20) diff --git a/td3/dune b/td3/dune new file mode 100644 index 0000000..ba415f0 --- /dev/null +++ b/td3/dune @@ -0,0 +1,4 @@ +(library + (name td3) + (modules td3) +) diff --git a/td4/dune b/td4/dune new file mode 100644 index 0000000..41b6bea --- /dev/null +++ b/td4/dune @@ -0,0 +1,5 @@ +(library + (name td4) + (modules td4) +) +(env (dev (flags :standard -w -27-32-39))) diff --git a/td5/dune b/td5/dune new file mode 100644 index 0000000..86d6921 --- /dev/null +++ b/td5/dune @@ -0,0 +1,9 @@ +(library + (name td5) + (modules td5) +) +(executable + (name test) + (modules test) + (libraries td5) +) diff --git a/td5/ocaml/dune-project b/td5/ocaml/dune-project deleted file mode 100644 index dbcb208..0000000 --- a/td5/ocaml/dune-project +++ /dev/null @@ -1,26 +0,0 @@ -(lang dune 3.20) - -(name td5) - -(generate_opam_files true) - -(source - (github username/reponame)) - -(authors "Author Name ") - -(maintainers "Maintainer Name ") - -(license LICENSE) - -(documentation https://url/to/documentation) - -(package - (name td5) - (synopsis "A short synopsis") - (description "A longer description") - (depends ocaml) - (tags - ("add topics" "to describe" your project))) - -; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html diff --git a/td5/ocaml/lib/dune b/td5/ocaml/lib/dune deleted file mode 100644 index 6d315a9..0000000 --- a/td5/ocaml/lib/dune +++ /dev/null @@ -1,3 +0,0 @@ -(library - (name lib) - (public_name td5)) diff --git a/td5/ocaml/td5.opam b/td5/ocaml/td5.opam deleted file mode 100644 index a43bbcb..0000000 --- a/td5/ocaml/td5.opam +++ /dev/null @@ -1,32 +0,0 @@ -# This file is generated by dune, edit dune-project instead -opam-version: "2.0" -synopsis: "A short synopsis" -description: "A longer description" -maintainer: ["Maintainer Name "] -authors: ["Author Name "] -license: "LICENSE" -tags: ["add topics" "to describe" "your" "project"] -homepage: "https://github.com/username/reponame" -doc: "https://url/to/documentation" -bug-reports: "https://github.com/username/reponame/issues" -depends: [ - "dune" {>= "3.20"} - "ocaml" - "odoc" {with-doc} -] -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@runtest" {with-test} - "@doc" {with-doc} - ] -] -dev-repo: "git+https://github.com/username/reponame.git" -x-maintenance-intent: ["(latest)"] diff --git a/td5/ocaml/test/dune b/td5/ocaml/test/dune deleted file mode 100644 index d2d6441..0000000 --- a/td5/ocaml/test/dune +++ /dev/null @@ -1,4 +0,0 @@ -(executable - (name test) - (public_name test) - (libraries lib)) diff --git a/td5/ocaml/lib/lib.ml b/td5/td5.ml similarity index 100% rename from td5/ocaml/lib/lib.ml rename to td5/td5.ml diff --git a/td5/ocaml/test/test.ml b/td5/test.ml similarity index 94% rename from td5/ocaml/test/test.ml rename to td5/test.ml index 48493bd..2a99c97 100644 --- a/td5/ocaml/test/test.ml +++ b/td5/test.ml @@ -1,4 +1,4 @@ -open Lib;; +open Td5;; let l = [5; 3; 9; 0; 5; 0];; let sorted = [0; 0; 3; 5; 5; 9];; diff --git a/td6/dune b/td6/dune new file mode 100644 index 0000000..d41fc1f --- /dev/null +++ b/td6/dune @@ -0,0 +1,9 @@ +(library + (name td6) + (modules td6) +) +(executable + (name test) + (modules test) + (libraries td6) +) diff --git a/td6/ocaml/dune-project b/td6/ocaml/dune-project deleted file mode 100644 index 4dddbec..0000000 --- a/td6/ocaml/dune-project +++ /dev/null @@ -1,26 +0,0 @@ -(lang dune 3.20) - -(name td6) - -(generate_opam_files true) - -(source - (github username/reponame)) - -(authors "Author Name ") - -(maintainers "Maintainer Name ") - -(license LICENSE) - -(documentation https://url/to/documentation) - -(package - (name td6) - (synopsis "A short synopsis") - (description "A longer description") - (depends ocaml) - (tags - ("add topics" "to describe" your project))) - -; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html diff --git a/td6/ocaml/lib/dune b/td6/ocaml/lib/dune deleted file mode 100644 index 40894a0..0000000 --- a/td6/ocaml/lib/dune +++ /dev/null @@ -1,3 +0,0 @@ -(library - (name lib) - (public_name td6)) diff --git a/td6/ocaml/lib/lib.ml b/td6/ocaml/lib/lib.ml deleted file mode 100644 index 94097a4..0000000 --- a/td6/ocaml/lib/lib.ml +++ /dev/null @@ -1,3 +0,0 @@ -let radix l = - let r = ref 0 in - let running = ref true in diff --git a/td6/ocaml/td6.opam b/td6/ocaml/td6.opam deleted file mode 100644 index a43bbcb..0000000 --- a/td6/ocaml/td6.opam +++ /dev/null @@ -1,32 +0,0 @@ -# This file is generated by dune, edit dune-project instead -opam-version: "2.0" -synopsis: "A short synopsis" -description: "A longer description" -maintainer: ["Maintainer Name "] -authors: ["Author Name "] -license: "LICENSE" -tags: ["add topics" "to describe" "your" "project"] -homepage: "https://github.com/username/reponame" -doc: "https://url/to/documentation" -bug-reports: "https://github.com/username/reponame/issues" -depends: [ - "dune" {>= "3.20"} - "ocaml" - "odoc" {with-doc} -] -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@runtest" {with-test} - "@doc" {with-doc} - ] -] -dev-repo: "git+https://github.com/username/reponame.git" -x-maintenance-intent: ["(latest)"] diff --git a/td6/ocaml/test/dune b/td6/ocaml/test/dune deleted file mode 100644 index d2d6441..0000000 --- a/td6/ocaml/test/dune +++ /dev/null @@ -1,4 +0,0 @@ -(executable - (name test) - (public_name test) - (libraries lib)) diff --git a/td6/ocaml/test/test.ml b/td6/ocaml/test/test.ml deleted file mode 100644 index b5df65f..0000000 --- a/td6/ocaml/test/test.ml +++ /dev/null @@ -1 +0,0 @@ -open Lib;; diff --git a/td6/td6.ml b/td6/td6.ml new file mode 100644 index 0000000..20b1cc0 --- /dev/null +++ b/td6/td6.ml @@ -0,0 +1,3 @@ +(* let radix l = + let r = ref 0 in + let running = ref true in *) diff --git a/tp4/test/test_tp4.ml b/td6/test.ml similarity index 100% rename from tp4/test/test_tp4.ml rename to td6/test.ml diff --git a/tp4/bin/dune b/tp4/bin/dune deleted file mode 100644 index e2b662a..0000000 --- a/tp4/bin/dune +++ /dev/null @@ -1,15 +0,0 @@ -(executable - (public_name exo1) - (name exo1)) -(executable - (public_name exo2) - (name exo2)) -(executable - (public_name exo3) - (name exo3)) -(executable - (public_name exo4) - (name exo4)) -(executable - (public_name exo5) - (name exo5)) diff --git a/tp4/bin/exo1.ml b/tp4/bin/exo1.ml deleted file mode 100644 index 818b2cf..0000000 --- a/tp4/bin/exo1.ml +++ /dev/null @@ -1,33 +0,0 @@ -let rec somme_liste l = match l with -| [] -> 0 -| a::q -> a + somme_liste q;; - -assert (somme_liste [1; 3; 2] = 6);; - -let rec taille_liste l = match l with -| [] -> 0 -| _::q -> 1 + taille_liste q;; - -assert (taille_liste [1; 3; 2] = 3);; - -let rec pow valeur exposant = match exposant with -| 0 -> 1 -| i -> valeur * (pow valeur (i - 1));; - -assert (pow 4 3 = 64);; - -(* On peut remplacer i - 1 par exposant - 1 car les deux noms coexistent. *) -let rec part_ent_log2 nombre = - if nombre = 0 then failwith "Boum !"; - (* Il est toujours utile de connaître les exceptions tôt. *) - if nombre = 1 then 0 - else 1 + (part_ent_log2 (nombre / 2));; - -assert (part_ent_log2 10 = 3);; - -let rec est_dans_liste element l = match l with - | [] -> false - | a::q -> a = element || est_dans_liste element q;; - -assert (est_dans_liste 2 [1; 3; 2]);; -assert (not (est_dans_liste 4 [1; 3; 2]));; diff --git a/tp4/bin/exo2.ml b/tp4/bin/exo2.ml deleted file mode 100644 index f31723b..0000000 --- a/tp4/bin/exo2.ml +++ /dev/null @@ -1,10 +0,0 @@ - -let biggest l = match l with - | [] -> failwith "Empty list" - | x::q -> List.fold_left - (fun acc a -> max acc a) - x - q -;; - -assert (biggest [0; 7; 4] == 7);; diff --git a/tp4/bin/exo3.ml b/tp4/bin/exo3.ml deleted file mode 100644 index 2aea6f6..0000000 --- a/tp4/bin/exo3.ml +++ /dev/null @@ -1,3 +0,0 @@ -let prod l = List.fold_left (fun acc x -> acc *. x) 1. l;; - -assert (abs_float (prod [1.5; 2.; 3.] -. 9.) <= 1e-14 ); diff --git a/tp4/bin/exo4.ml b/tp4/bin/exo4.ml deleted file mode 100644 index 4f8c035..0000000 --- a/tp4/bin/exo4.ml +++ /dev/null @@ -1,6 +0,0 @@ -let rec is_ordered l = match l with - | a::b::q -> a <= b && is_ordered (b::q) - | _ -> true;; - -assert (is_ordered [1; 5; 6]);; -assert (not (is_ordered [5.6; 7.8; 3.]));; diff --git a/tp4/bin/exo5.ml b/tp4/bin/exo5.ml deleted file mode 100644 index 0c035df..0000000 --- a/tp4/bin/exo5.ml +++ /dev/null @@ -1,18 +0,0 @@ -let rec is_ordered l = match l with - | a::b::q -> a <= b && is_ordered (b::q) - | _ -> true;; -let rec is_rev_ordered l = match l with - | a::b::q -> a >= b && is_ordered (b::q) - | _ -> true;; - -let rec has_ordering l = match l with - | a::b::q -> if a < b then - is_ordered (b::q) - else if a > b then - is_rev_ordered (b::q) - else has_ordering (b::q) - | _ -> true;; - -assert (has_ordering [1; 1; 2; 2; 3]);; -assert (has_ordering [3; 2; 1; 1]);; -assert (not (has_ordering [1; 1; 2; 1]));; diff --git a/tp4/dune b/tp4/dune new file mode 100644 index 0000000..7bcf936 --- /dev/null +++ b/tp4/dune @@ -0,0 +1,9 @@ +(library + (name tp4) + (modules tp4) +) +(executable + (name test) + (modules test) + (libraries tp4) +) diff --git a/tp4/dune-project b/tp4/dune-project deleted file mode 100644 index 2991b88..0000000 --- a/tp4/dune-project +++ /dev/null @@ -1,26 +0,0 @@ -(lang dune 3.20) - -(name tp4) - -(generate_opam_files true) - -(source - (github username/reponame)) - -(authors "Author Name ") - -(maintainers "Maintainer Name ") - -(license LICENSE) - -(documentation https://url/to/documentation) - -(package - (name tp4) - (synopsis "A short synopsis") - (description "A longer description") - (depends ocaml) - (tags - ("add topics" "to describe" your project))) - -; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html diff --git a/tp4/lib/dune b/tp4/lib/dune deleted file mode 100644 index 18ed8b1..0000000 --- a/tp4/lib/dune +++ /dev/null @@ -1,3 +0,0 @@ -(library - (name exo1) -) diff --git a/tp4/test.ml b/tp4/test.ml new file mode 100644 index 0000000..2338283 --- /dev/null +++ b/tp4/test.ml @@ -0,0 +1,23 @@ +open Tp4;; + +assert (somme_liste [1; 3; 2] = 6);; + +assert (taille_liste [1; 3; 2] = 3);; + +assert (pow 4 3 = 64);; + +assert (part_ent_log2 10 = 3);; + +assert (est_dans_liste 2 [1; 3; 2]);; +assert (not (est_dans_liste 4 [1; 3; 2]));; + +assert (biggest [0; 7; 4] == 7);; + +assert (abs_float (prod [1.5; 2.; 3.] -. 9.) <= 1e-14 );; + +assert (is_ordered [1; 5; 6]);; +assert (not (is_ordered [5.6; 7.8; 3.]));; + +assert (has_ordering [1; 1; 2; 2; 3]);; +assert (has_ordering [3; 2; 1; 1]);; +assert (not (has_ordering [1; 1; 2; 1]));; diff --git a/tp4/test/dune b/tp4/test/dune deleted file mode 100644 index a495465..0000000 --- a/tp4/test/dune +++ /dev/null @@ -1,2 +0,0 @@ -(test - (name test_tp4)) diff --git a/tp4/tp4.ml b/tp4/tp4.ml new file mode 100644 index 0000000..04152b9 --- /dev/null +++ b/tp4/tp4.ml @@ -0,0 +1,82 @@ +(* Exercice 1 *) + +let rec somme_liste l = match l with +| [] -> 0 +| a::q -> a + somme_liste q;; + +assert (somme_liste [1; 3; 2] = 6);; + +let rec taille_liste l = match l with +| [] -> 0 +| _::q -> 1 + taille_liste q;; + +assert (taille_liste [1; 3; 2] = 3);; + +let rec pow valeur exposant = match exposant with +| 0 -> 1 +| i -> valeur * (pow valeur (i - 1));; + +assert (pow 4 3 = 64);; + +(* On peut remplacer i - 1 par exposant - 1 car les deux noms coexistent. *) +let rec part_ent_log2 nombre = + if nombre = 0 then failwith "Boum !"; + (* Il est toujours utile de connaître les exceptions tôt. *) + if nombre = 1 then 0 + else 1 + (part_ent_log2 (nombre / 2));; + +assert (part_ent_log2 10 = 3);; + +let rec est_dans_liste element l = match l with + | [] -> false + | a::q -> a = element || est_dans_liste element q;; + +assert (est_dans_liste 2 [1; 3; 2]);; +assert (not (est_dans_liste 4 [1; 3; 2]));; + +(* Exercice 2 *) + +let biggest l = match l with + | [] -> failwith "Empty list" + | x::q -> List.fold_left + (fun acc a -> max acc a) + x + q +;; + +assert (biggest [0; 7; 4] == 7);; + +(* Exercice 3 *) + +let prod l = List.fold_left (fun acc x -> acc *. x) 1. l;; + +assert (abs_float (prod [1.5; 2.; 3.] -. 9.) <= 1e-14 );; + +(* Exercice 4 *) + +let rec is_ordered l = match l with + | a::(b::q) -> a <= b && is_ordered (b::q) + | _ -> true +;; + +assert (is_ordered [1; 5; 6]);; +assert (not (is_ordered [5.6; 7.8; 3.]));; + +(* Exercice 5 *) + +let rec is_rev_ordered l = match l with + | a::b::q -> a >= b && is_rev_ordered (b::q) + | _ -> true +;; + +let rec has_ordering l = match l with + | a::b::q -> if a < b then + is_ordered (b::q) + else if a > b then + is_rev_ordered (b::q) + else has_ordering (b::q) + | _ -> true;; + +assert (has_ordering [1; 1; 2; 2; 3]);; +assert (has_ordering [3; 2; 1; 1]);; +assert (not (has_ordering [1; 1; 2; 1]));; diff --git a/tp4/tp4.opam b/tp4/tp4.opam deleted file mode 100644 index a43bbcb..0000000 --- a/tp4/tp4.opam +++ /dev/null @@ -1,32 +0,0 @@ -# This file is generated by dune, edit dune-project instead -opam-version: "2.0" -synopsis: "A short synopsis" -description: "A longer description" -maintainer: ["Maintainer Name "] -authors: ["Author Name "] -license: "LICENSE" -tags: ["add topics" "to describe" "your" "project"] -homepage: "https://github.com/username/reponame" -doc: "https://url/to/documentation" -bug-reports: "https://github.com/username/reponame/issues" -depends: [ - "dune" {>= "3.20"} - "ocaml" - "odoc" {with-doc} -] -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@runtest" {with-test} - "@doc" {with-doc} - ] -] -dev-repo: "git+https://github.com/username/reponame.git" -x-maintenance-intent: ["(latest)"] diff --git a/tp6/dune b/tp6/dune new file mode 100644 index 0000000..f3add45 --- /dev/null +++ b/tp6/dune @@ -0,0 +1,9 @@ +(library + (name tp6) + (modules tp6) +) +(executable + (name test) + (modules test) + (libraries tp6) +) diff --git a/tp6/dune-project b/tp6/dune-project deleted file mode 100644 index afa291f..0000000 --- a/tp6/dune-project +++ /dev/null @@ -1,26 +0,0 @@ -(lang dune 3.20) - -(name tp6) - -(generate_opam_files true) - -(source - (github username/reponame)) - -(authors "Author Name ") - -(maintainers "Maintainer Name ") - -(license LICENSE) - -(documentation https://url/to/documentation) - -(package - (name tp6) - (synopsis "A short synopsis") - (description "A longer description") - (depends ocaml) - (tags - ("add topics" "to describe" your project))) - -; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html diff --git a/tp6/lib/dune b/tp6/lib/dune deleted file mode 100644 index f518b2b..0000000 --- a/tp6/lib/dune +++ /dev/null @@ -1,3 +0,0 @@ -(library - (name lib) - (public_name tp6)) diff --git a/tp6/test/test_tp6.ml b/tp6/test.ml similarity index 97% rename from tp6/test/test_tp6.ml rename to tp6/test.ml index 59fe078..bf0c2b4 100644 --- a/tp6/test/test_tp6.ml +++ b/tp6/test.ml @@ -1,4 +1,4 @@ -open Lib;; +open Tp6;; assert (correct (Fraction (3, 4)));; assert (correct (Entier 5));; diff --git a/tp6/test/dune b/tp6/test/dune deleted file mode 100644 index 772bb80..0000000 --- a/tp6/test/dune +++ /dev/null @@ -1,4 +0,0 @@ -(executable - (name test_tp6) - (public_name test_tp6) - (libraries lib)) diff --git a/tp6/lib/lib.ml b/tp6/tp6.ml similarity index 100% rename from tp6/lib/lib.ml rename to tp6/tp6.ml diff --git a/tp6/tp6.opam b/tp6/tp6.opam deleted file mode 100644 index a43bbcb..0000000 --- a/tp6/tp6.opam +++ /dev/null @@ -1,32 +0,0 @@ -# This file is generated by dune, edit dune-project instead -opam-version: "2.0" -synopsis: "A short synopsis" -description: "A longer description" -maintainer: ["Maintainer Name "] -authors: ["Author Name "] -license: "LICENSE" -tags: ["add topics" "to describe" "your" "project"] -homepage: "https://github.com/username/reponame" -doc: "https://url/to/documentation" -bug-reports: "https://github.com/username/reponame/issues" -depends: [ - "dune" {>= "3.20"} - "ocaml" - "odoc" {with-doc} -] -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@runtest" {with-test} - "@doc" {with-doc} - ] -] -dev-repo: "git+https://github.com/username/reponame.git" -x-maintenance-intent: ["(latest)"] diff --git a/tp7/dune b/tp7/dune new file mode 100644 index 0000000..8528563 --- /dev/null +++ b/tp7/dune @@ -0,0 +1,17 @@ +(library + (name exo2) + (modules exo2) +) +(library + (name exo5) + (modules exo5) +) +(library + (name exo10) + (modules exo10) +) +(executable + (name test) + (modules test) + (libraries exo2 exo5 exo10) +) diff --git a/tp7/ocaml/exo2/exo2.ml b/tp7/exo2.ml similarity index 100% rename from tp7/ocaml/exo2/exo2.ml rename to tp7/exo2.ml diff --git a/tp7/exo5.ml b/tp7/exo5.ml new file mode 100644 index 0000000..64af0a2 --- /dev/null +++ b/tp7/exo5.ml @@ -0,0 +1,4 @@ +type 'a lc = { + mutable tete : 'a option; + mutable suivant : 'a lc option +};; diff --git a/tp7/ocaml/dune-project b/tp7/ocaml/dune-project deleted file mode 100644 index 3345a78..0000000 --- a/tp7/ocaml/dune-project +++ /dev/null @@ -1,26 +0,0 @@ -(lang dune 3.20) - -(name tp7) - -(generate_opam_files true) - -(source - (github username/reponame)) - -(authors "Author Name ") - -(maintainers "Maintainer Name ") - -(license LICENSE) - -(documentation https://url/to/documentation) - -(package - (name tp7) - (synopsis "A short synopsis") - (description "A longer description") - (depends ocaml) - (tags - ("add topics" "to describe" your project))) - -; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html diff --git a/tp7/ocaml/exo2/dune b/tp7/ocaml/exo2/dune deleted file mode 100644 index 0643996..0000000 --- a/tp7/ocaml/exo2/dune +++ /dev/null @@ -1,3 +0,0 @@ -(library - (name exo2) - (public_name tp7)) diff --git a/tp7/ocaml/test/dune b/tp7/ocaml/test/dune deleted file mode 100644 index d061247..0000000 --- a/tp7/ocaml/test/dune +++ /dev/null @@ -1,4 +0,0 @@ -(executable - (name test) - (public_name test) - (libraries exo2)) diff --git a/tp7/ocaml/test/test.ml b/tp7/ocaml/test/test.ml deleted file mode 100644 index 1c37e0b..0000000 --- a/tp7/ocaml/test/test.ml +++ /dev/null @@ -1 +0,0 @@ -open Exo2;; diff --git a/tp7/ocaml/tp7.opam b/tp7/ocaml/tp7.opam deleted file mode 100644 index a43bbcb..0000000 --- a/tp7/ocaml/tp7.opam +++ /dev/null @@ -1,32 +0,0 @@ -# This file is generated by dune, edit dune-project instead -opam-version: "2.0" -synopsis: "A short synopsis" -description: "A longer description" -maintainer: ["Maintainer Name "] -authors: ["Author Name "] -license: "LICENSE" -tags: ["add topics" "to describe" "your" "project"] -homepage: "https://github.com/username/reponame" -doc: "https://url/to/documentation" -bug-reports: "https://github.com/username/reponame/issues" -depends: [ - "dune" {>= "3.20"} - "ocaml" - "odoc" {with-doc} -] -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@runtest" {with-test} - "@doc" {with-doc} - ] -] -dev-repo: "git+https://github.com/username/reponame.git" -x-maintenance-intent: ["(latest)"] diff --git a/tp7/test.ml b/tp7/test.ml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tp7/test.ml @@ -0,0 +1 @@ +