repositories
/
lambda.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
233599a
)
reduction optimization
author
Mart Lubbers
<mart@martlubbers.net>
Wed, 16 May 2018 18:11:00 +0000
(20:11 +0200)
committer
Mart Lubbers
<mart@martlubbers.net>
Wed, 16 May 2018 18:11:00 +0000
(20:11 +0200)
reduce.c
patch
|
blob
|
history
diff --git
a/reduce.c
b/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;
}