let inter =
  let yes = Some(Yesin   (* avoid repetitive creation of constants. *)
  let no = Some(Noin
  let x = Some(Xin
  fun a b -> match a, b with
    | NoX -> no
    | YesX -> yes
    | XNo -> no
    | XYes -> yes
    | NoNo -> no
    | XX -> x
    | Yes,Yes -> yes
    | NoYes -> None
    | YesNo -> None