diff --git a/Algo/Séminaire/Exercices sémaines.md b/Algo/Séminaire/Exercices sémaines.md index 96ac770..dbd4566 100644 --- a/Algo/Séminaire/Exercices sémaines.md +++ b/Algo/Séminaire/Exercices sémaines.md @@ -107,14 +107,24 @@ val or_if: bool -> bool -> bool = (*logical implication*) -if a && b then - true -else if not a && b then - true -else if not a && not b then - true -else - false +# let imply_if a b = + if a then b + else true;; +val imply_if: bool -> bool -> bool = + +(*logical exclusive or*) +let xor a b = + if a then + if b then false else true + else + if b then true else false + +(*logical equivalence = a b*) +let equiv a b = + if a then b + else + if b then false else true (*not b*) + ``` ### Exercise 3.3