lean4-htt/tests/playground/gen.lean
Leonardo de Moura e5950cf710 test(tests/playground/gen): simple lean file generator
@kha
I am using this little program to generate big lean files to test the
new front end. For the output produced for `gen 5000`, the new frontend
is almost 10x slower than the old one.
I used `valgrind --tool=callgrind` to collect profiling data.
The number of closures is too big. For example, `free_closure_obj` was
invoked 38.5 million times. The total number of deallocated objects is around
49.5 million.
2019-03-04 16:19:50 -08:00

5 lines
245 B
Text

def main (xs : list string) : io uint32 :=
let n := xs.head.to_nat in
io.println' "prelude\ninductive bool : Type\n| ff : bool\n| tt : bool\n\n" *>
nat.mrepeat n (λ i, io.println' ("theorem x" ++ to_string i ++ " : bool := bool.tt")) *>
pure 0