This PR changes the implementation of `trace.Compiler.result` to use the decls as they are provided rather than looking them up in the LCNF mono environment extension, which was seemingly done to save the trouble of re-normalizing fvar IDs before printing the decl. This means that the `._closed` decls created by the `extractClosed` pass will now be included in the output, which was definitely confusing before if you didn't know what was happening.
28 lines
889 B
Text
28 lines
889 B
Text
[Compiler.result] size: 9
|
||
def g._redArg (n : Nat) (a : lcAny) (f : lcAny → lcAny) : lcAny :=
|
||
let zero := 0;
|
||
let isZero := Nat.decEq n zero;
|
||
cases isZero : lcAny
|
||
| Bool.true =>
|
||
return a
|
||
| Bool.false =>
|
||
let one := 1;
|
||
let n.1 := Nat.sub n one;
|
||
let _x.2 := g._redArg n.1 a f;
|
||
let _x.3 := f _x.2;
|
||
return _x.3
|
||
[Compiler.result] size: 1
|
||
def g (α : ◾) (n : Nat) (a : lcAny) (b : lcAny) (f : lcAny → lcAny) : lcAny :=
|
||
let _x.1 := g._redArg n a f;
|
||
return _x.1
|
||
[Compiler.result] size: 1
|
||
def h._closed_0 : Nat → Nat :=
|
||
let _x.1 := double;
|
||
return _x.1
|
||
[Compiler.result] size: 4
|
||
def h (n : Nat) (a : Nat) : Nat :=
|
||
let _x.1 := h._closed_0;
|
||
let _x.2 := g._redArg n a _x.1;
|
||
let _x.3 := g._redArg a n _x.1;
|
||
let _x.4 := Nat.add _x.2 _x.3;
|
||
return _x.4
|