Merge branch 'cleaning_again_example_sin_cos' into 'master'
[why3.git] / stdlib / bool.mlw
blobc45377f9691ad8b879049a7d34e5ba386ba72dae
2 (** {1 Booleans} *)
4 (** {2 Basic theory of Booleans} *)
6 module Bool
8   let function andb (x y : bool) : bool =
9     match x with
10     | True -> y
11     | False -> False
12     end
14   let function orb (x y : bool) : bool =
15     match x with
16     | False -> y
17     | True -> True
18     end
20   let function notb (x : bool) : bool =
21     match x with
22     | False -> True
23     | True  -> False
24     end
26   let function xorb (x y : bool) : bool =
27     match x with
28     | False -> y
29     | True -> notb y
30     end
32   let function implb (x y : bool) : bool =
33     match x with
34     | False -> True
35     | True -> y
36     end
38 end
40 (** {2 Operator if-then-else} *)
42 module Ite
44   let function ite (b:bool) (x y : 'a) : 'a =
45     match b with
46     | True  -> x
47     | False -> y
48     end
50 end