reduction optimization
authorMart Lubbers <mart@martlubbers.net>
Wed, 16 May 2018 18:11:00 +0000 (20:11 +0200)
committerMart Lubbers <mart@martlubbers.net>
Wed, 16 May 2018 18:11:00 +0000 (20:11 +0200)
reduce.c

index 9dbf678..83ab536 100644 (file)
--- 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;
        }