pub fn to_scott() -> Term
Expand description

Applied to a Church-encoded number it produces the equivalent Scott-encoded number.

TO_SCOTT ≡ λn.n SUCC ZERO ≡ λ 1 SUCC ZERO

Example

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

assert_eq!(beta(app(to_scott(), 0.into_church()), NOR, 0), 0.into_scott());
assert_eq!(beta(app(to_scott(), 1.into_church()), NOR, 0), 1.into_scott());
assert_eq!(beta(app(to_scott(), 2.into_church()), NOR, 0), 2.into_scott());