From b6db041ec7eec8777e1f381ca5c459dbc78ae009 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 7 Sep 2023 15:03:14 +0200 Subject: [PATCH] vault backup: 2023-09-07 15:03:14 --- Algo/Séminaire/Exercices sémaines.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Algo/Séminaire/Exercices sémaines.md b/Algo/Séminaire/Exercices sémaines.md index b69d044..96ac770 100644 --- a/Algo/Séminaire/Exercices sémaines.md +++ b/Algo/Séminaire/Exercices sémaines.md @@ -92,20 +92,19 @@ let f a b c = ### Exercise 3.2 ```OCaml (*logical and*) -if a == b then - true -else false -let and_if a b = +# let and_if a b = + if a then + b + else false;; +val and_if: bool -> bool -> bool = (*logical or*) -if a && b then - true -else if a && not b then - true -else if not a && b then - true -else - false +# let or_if a b = + if a then true + else b;; + +val or_if: bool -> bool -> bool = + (*logical implication*) if a && b then