let inter =
let yes = Some(Yes) in (* avoid repetitive creation of constants. *)
let no = Some(No) in
let x = Some(X) in
fun a b -> match a, b with
| No, X -> no
| Yes, X -> yes
| X, No -> no
| X, Yes -> yes
| No, No -> no
| X, X -> x
| Yes,Yes -> yes
| No, Yes -> None
| Yes, No -> None