proper grounding of free types produced by reconstruct_proof/infer_type, e.g. relevant for Lattices_Big.semilattice_set.infinite;
authorwenzelm
Mon, 09 Mar 2020 16:58:23 +0100
changeset 71533 d7175626d61e
parent 71532 82fbfccca7dd
child 71534 f10bffaa2bae
proper grounding of free types produced by reconstruct_proof/infer_type, e.g. relevant for Lattices_Big.semilattice_set.infinite;
src/Pure/proofterm.ML
--- a/src/Pure/proofterm.ML	Mon Mar 09 16:12:53 2020 +0100
+++ b/src/Pure/proofterm.ML	Mon Mar 09 16:58:23 2020 +0100
@@ -2049,7 +2049,12 @@
   let
     val hidden = hidden_types term proof;
     val idx = Term.maxidx_term term (maxidx_proof proof ~1) + 1;
-    fun smash T = if member (op =) hidden T then TVar (("'", idx), Type.sort_of_atyp T) else T;
+    fun smash T =
+      if member (op =) hidden T then
+        (case Type.sort_of_atyp T of
+          [] => dummyT
+        | S => TVar (("'", idx), S))
+      else T;
     val smashT = map_atyps smash;
   in map_proof_terms (map_types smashT) smashT proof end;