pow

Function pow 

Source
pub fn pow() -> Term
Expand description

Applied to two Church-encoded numbers it raises the first one to the power of the second one.

POW ≡ λab.IS_ZERO b ONE (b a) ≡ λ λ IS_ZERO 1 ONE (1 2)

§Example

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

assert_eq!(beta(app!(pow(), 3.into_church(), 0.into_church()), NOR, 0), 1.into_church());
assert_eq!(beta(app!(pow(), 2.into_church(), 1.into_church()), NOR, 0), 2.into_church());
assert_eq!(beta(app!(pow(), 2.into_church(), 3.into_church()), NOR, 0), 8.into_church());