Generalizing lambda or expression

26 Views Asked by At

I want to generalize

$$ \underline{or} = \lambda xy. (x \to \underline{true} | y) $$

to $\lambda AB. (A \to (\underline{true} \to ...) | B \to ...)$.

Here's my try:

Cases:

  • If A:

    • If B: $\underline{true} \to Axy \to x$
    • If $\underline{not}$ B: $\underline{true} \to Axy \to x$
  • If $\underline{not}$ A:

    • If B: $Bxy \to x$
    • If $\underline{not}$ B: $Bxy \to y$

So

$$ \underline{or} = \lambda ABxy. (A \to (\underline{true} \to x|x) | (B \to x|y)) = \lambda ABxy. (A \to x | (B \to x|y)) = \lambda ABxy. Ax(Bxy) $$

I forgot to mention that $A,B$ are boolean.

Are the steps seem reasonable? Thanks a bunch!