aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-03-28 09:28:00 +0100
committerPierre-Marie Pédrot2020-04-03 19:32:13 +0200
commitb5f2b861a3d391716e976469a1a100536550bef8 (patch)
tree0ffa7c9b0c116f0cc7a592f4a05f4a0ce080d8f1 /kernel
parentc20139f870430d856d6b891a7129ee72d7b54ff4 (diff)
Be cleverer and do not hopelessly rezip a term when not needed.
A quick analysis showed that most of the calls to whd do not lead to a term which further triggers reduction, so there is no point in refolding a potentiall huge term for no reason.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cClosure.ml2
-rw-r--r--kernel/cClosure.mli4
2 files changed, 6 insertions, 0 deletions
diff --git a/kernel/cClosure.ml b/kernel/cClosure.ml
index 1316dfe069..c31cdae6f5 100644
--- a/kernel/cClosure.ml
+++ b/kernel/cClosure.ml
@@ -678,6 +678,8 @@ let rec zip m stk =
let fapp_stack (m,stk) = zip m stk
+let term_of_process c stk = term_of_fconstr (zip c stk)
+
(*********************************************************************)
(* The assertions in the functions below are granted because they are
diff --git a/kernel/cClosure.mli b/kernel/cClosure.mli
index 9e94248113..79092813bc 100644
--- a/kernel/cClosure.mli
+++ b/kernel/cClosure.mli
@@ -227,6 +227,10 @@ val kni: clos_infos -> clos_tab -> fconstr -> stack -> fconstr * stack
val knr: clos_infos -> clos_tab -> fconstr -> stack -> fconstr * stack
val kl : clos_infos -> clos_tab -> fconstr -> constr
+val zip : fconstr -> stack -> fconstr
+
+val term_of_process : fconstr -> stack -> constr
+
val to_constr : lift -> fconstr -> constr
(** End of cbn debug section i*)