12 auto& world = f->world();
14 world.DLOG(
"f: {} : {}", f, f->type());
15 auto f_ty = f->type()->as<
Pi>();
16 auto T = f_ty->
dom(0);
17 auto U = f_ty->dom(1)->as<
Pi>()->dom();
18 world.DLOG(
"T: {}", T);
19 world.DLOG(
"U: {}", U);
21 auto Uf = world.mut_lam(T, world.type())->set(
"Uf");
22 world.DLOG(
"Uf: {} : {}", Uf, Uf->type());
24 const Def* rewritten_codom;
26 if (
auto f_ty_sig = f_ty->dom()->isa_mut<
Sigma>()) {
27 auto dom_var = f_ty_sig->var((
nat_t)0);
28 world.DLOG(
"dom_var: {}", dom_var);
29 auto closed_dom_var = Uf->var();
30 rewritten_codom =
rewrite(U, f_ty_sig, closed_dom_var);
34 Uf->
set(
true, rewritten_codom);
38 world.DLOG(
"axiom app: {} : {}", ax_app, ax_app->type());
40 return world.app(ax_app, f);