Functional Programming & Proofs


Trees and languages

  1. How to define boolean's set in F# ?
  2. (match_with)
    How to define standard booleans' operators (not, and, etc.) ?
type Bool = True | False;;

let Not b = 
  match b with
  | True  -> False
  | False -> True;;

let And b1 b2 = 
  match b1 with
  | True  -> b2
  | _     -> False;;

not False;;
And True (Not False);;

let (<&>) b1 b2 = And b1 b2;;
True <&> (Not False);;

3 - 10