make double-sure that internal proof boxes are exported, e.g. in Pure;
authorwenzelm
Fri, 01 Nov 2019 16:36:17 +0100
changeset 70982 71d1971d67ad
parent 70981 a802d42c00bc
child 70983 52a62342c9ce
make double-sure that internal proof boxes are exported, e.g. in Pure;
src/Pure/proofterm.ML
--- a/src/Pure/proofterm.ML	Fri Nov 01 15:47:31 2019 +0100
+++ b/src/Pure/proofterm.ML	Fri Nov 01 16:36:17 2019 +0100
@@ -2095,14 +2095,15 @@
       | export_boxes (Abst (_, _, prf)) = export_boxes prf
       | export_boxes (prf1 %% prf2) = export_boxes prf1 #> export_boxes prf2
       | export_boxes (prf % _) = export_boxes prf
-      | export_boxes (PThm ({serial = i, name = "", ...}, thm_body)) =
+      | export_boxes (PThm ({serial = i, ...}, thm_body)) =
           (fn boxes =>
             if Inttab.defined boxes i then boxes
             else
               let
-                val prf = thm_body_proof_raw thm_body;
-                val boxes' = Inttab.update (i, thm_body_export_proof thm_body) boxes;
-              in export_boxes prf boxes' end)
+                val prf' = thm_body_proof_raw thm_body;
+                val export = thm_body_export_proof thm_body;
+                val boxes' = boxes |> not (Lazy.is_finished export) ? Inttab.update (i, export);
+              in export_boxes prf' boxes' end)
       | export_boxes _ = I;
     val boxes = (proof, Inttab.empty) |-> export_boxes |> Inttab.dest;
   in List.app (Lazy.force o #2) boxes end;