let f = function | 0 , 0 , 0 -> 0 | 0 , 1 , 1 -> 0 | 1 , 0 , 1 -> 0 | 1 , 1 , 0 -> 0 | _ -> 1 for a in 0..1 do for b in 0..1 do for c in 0..1 do printfn "%i xor %i xor %i = %i" a b c (f (a, b, c))