Example #1
0
 // And = a => b => a(b)(False)
 public static Boolean And(this Boolean a, Boolean b) => ChurchBoolean.And(a)(b);
Example #2
0
 // IsNotHalting = f => If(IsHalting(f)(f))(_ => Sequence(Ω())(False))(_ => True)
 internal Boolean IsNotHalting <T>
     (ω <T> f) =>
 ChurchBoolean <Boolean> .If(this.IsHalting(new Func <ω <T>, T>(f))(f))
     (_ => Sequence <T, Boolean>(OmegaCombinators <T> .Ω(__ => __))(False))
     (_ => True);
Example #3
0
 // Factorial = factorial => numeral => If(numeral.IsZero())(_ => One)(_ => factorial(numeral.Decrease()));
 public static Func <NumeralWrapper, NumeralWrapper> Factorial(Func <NumeralWrapper, NumeralWrapper> factorial) => numeral =>
 ChurchBoolean <NumeralWrapper> .If(numeral.IsZero())
     (_ => NumeralWrapper.One)
     (_ => factorial(numeral.Decrease()));