-
Notifications
You must be signed in to change notification settings - Fork 5
/
app_n_uconstr.v
48 lines (42 loc) · 1.23 KB
/
app_n_uconstr.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Require Import PerformanceExperiments.Harness.
Fixpoint n_units (n : nat)
:= match n with
| 0 => unit
| S n => unit -> n_units n
end.
Definition goal (n : nat) := n_units n -> unit.
Ltac build_app n f :=
lazymatch n with
| 0 => f
| S ?n => build_app n uconstr:(f tt)
end.
Definition args_of_size (s : size) : list nat
:= match s with
| Sanity => seq 0 3
| SuperFast => List.map (fun x => x * 100) (seq 0 70)
| Fast => List.map (fun x => x * 100) (seq 0 128) (* stack overflow at 12800 *)
| Medium => []
| Slow => []
| VerySlow => []
end.
Ltac mkgoal n := constr:(goal n).
Ltac redgoal _ := vm_compute.
Ltac time_solve_goal0 n :=
let f := fresh "f" in
intro f;
time "build-and-refine"
(restart_timer;
let term := build_app n f in
finish_timing ( "Tactic call build" );
restart_timer;
let term := constr:(term) in
finish_timing ( "Tactic call to_constr" );
restart_timer;
let __ := type of term in
finish_timing ( "Tactic call type_of" );
time "refine" refine term).
Ltac run0 sz := Harness.runtests args_of_size default_describe_goal mkgoal redgoal time_solve_goal0 sz.
(*
Goal True.
run0 SuperFast.
*)