fix(kernel/instantiate): bug in new head_beta_reduce

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-02-17 16:53:03 -08:00
parent d17990ed78
commit 565dbe1700

View file

@ -96,6 +96,7 @@ expr head_beta_reduce(expr const & t) {
expr const & f = app_fn(*it); expr const & f = app_fn(*it);
args.push_back(app_arg(*it)); args.push_back(app_arg(*it));
if (is_lambda(f)) { if (is_lambda(f)) {
std::reverse(args.begin(), args.end());
return apply_beta(f, args.size(), args.data()); return apply_beta(f, args.size(), args.data());
} else { } else {
lean_assert(is_app(f)); lean_assert(is_app(f));