ChurchN(value: number | bigint): SKIExpression
Creates a Church-encoded numeral from an integer.
Church numerals represent natural numbers as functions that apply another function a specified number of times. For example, Church numeral 2 applies a function f twice: f(f(x)).
This implementation uses an optimized factorization hierarchy algorithm that prioritizes operations by efficiency:
- Exponentiation (application) - highest priority
- Multiplication (composition) - medium priority
- Successor (addition) - lowest priority
an extensionally equivalent Church numeral as an SKI expression