Function lambda_calculus::data::num::church::max

source ·
pub fn max() -> Term
Expand description

Applied to two Church-encoded numbers it returns the greater one.

MAX ≡ λaλb.(LEQ a b) b a ≡ λ λ (LEQ 2 1) 1 2

Example

use lambda_calculus::data::num::church::max;
use lambda_calculus::*;

assert_eq!(beta(app!(max(), 4.into_church(), 3.into_church()), NOR, 0), 4.into_church());