From: Mart Lubbers Date: Wed, 16 May 2018 18:11:00 +0000 (+0200) Subject: reduction optimization X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=6282a1811ba60fbc186a81037f95f8b5d9f4c8cc;p=lambda.git reduction optimization --- diff --git a/reduce.c b/reduce.c index 9dbf678..83ab536 100644 --- a/reduce.c +++ b/reduce.c @@ -45,7 +45,6 @@ void lambda_reduce(struct lambda *t, struct lambda *total, int *maxdepth) //If the first argument is an abstraction, we apply t1 = t->data.application.expr1; t2 = t->data.application.expr2; - lambda_reduce(t1, total, maxdepth); if(t1->which == lambda_abs){ subst(t1->data.abstraction.ident, t1->data.abstraction.expr, t2, total); (*maxdepth)--; @@ -55,8 +54,6 @@ void lambda_reduce(struct lambda *t, struct lambda *total, int *maxdepth) printf("-> "); lambda_print(total); lambda_reduce(t, total, maxdepth); - } else { - lambda_reduce(t2, total, maxdepth); } break; }