pub fn is_odd() -> Term
Expand description

Applied to a Church-encoded number it produces a lambda-encoded boolean, indicating whether its argument is odd.

IS_ODD ≡ λx.x NOT FALSE ≡ λ 1 NOT FALSE

Example

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

assert_eq!(beta(app(is_odd(), 0.into_church()), NOR, 0), false.into());
assert_eq!(beta(app(is_odd(), 1.into_church()), NOR, 0), true.into());
assert_eq!(beta(app(is_odd(), 2.into_church()), NOR, 0), false.into());
assert_eq!(beta(app(is_odd(), 3.into_church()), NOR, 0), true.into());