samedi 2 décembre 2017

Encode if-branch and recursion in eager evaluation

As far as I know, in eager evaluation we cannot encode the if-branch and recursion the same way as in normal-order evaluation.

For example, in lambda calculus if-branch and factorial(fac) can be encoded

if e1 e2 e3 = e1 e2 e3
fac = Y(λf.λn. if n=0 1 n*f(n-1))
Y = λf.(λx. f(xx))(λx. f(xx))

Can we encode the if-branch and recursion in eager evaluation? If we can i like to know how should we encode if-branch and factorial in eager evaluation using lambda calculus.

if e1 e2 e3 = ???
fac = ???

Aucun commentaire:

Enregistrer un commentaire