}
break;
case lambda_abs:
- if(strcmp(t1->data.abstraction.ident, ident) != 0)
- subst(ident, t1->data.abstraction.expr, t2, total);
+ if(lambda_ident_eq(t1, ident) == 0){
+ lambda_alpha(t1->data.abstraction.expr, t1);
+ t1->data.abstraction.revision++;
+ printf("α -> ");
+ lambda_print(total);
+ }
+ lambda_beta(ident, t1->data.abstraction.expr, t2, total);
break;
case lambda_app:
- subst(ident, t1->data.application.expr1, t2, total);
- subst(ident, t1->data.application.expr2, t2, total);
+ lambda_beta(ident, t1->data.application.expr1, t2, total);
+ lambda_beta(ident, t1->data.application.expr2, t2, total);
break;
}
-
}
void lambda_reduce(struct lambda *t, struct lambda *total, int *maxdepth)