src/Pure/Isar/specification.ML
changeset 78055 2d60172c0ade
parent 74338 534b231ce041
child 78469 53b59fa42696
--- a/src/Pure/Isar/specification.ML	Mon May 15 15:14:19 2023 +0200
+++ b/src/Pure/Isar/specification.ML	Mon May 15 16:18:23 2023 +0200
@@ -259,21 +259,19 @@
     val ((lhs, (_, raw_th)), lthy2) = lthy
       |> Local_Theory.define_internal ((b, mx), ((Binding.suffix_name "_raw" name, []), rhs));
 
-    val th = prove lthy2 raw_th;
-    val lthy3 = lthy2 |> Spec_Rules.add name Spec_Rules.equational [lhs] [th];
+    val ([(def_name, [th])], lthy3) = lthy2
+      |> Local_Theory.notes [((name, atts), [([prove lthy2 raw_th], [])])];
 
-    val ([(def_name, [th'])], lthy4) = lthy3
-      |> Local_Theory.notes [((name, atts), [([th], [])])];
+    val lthy4 = lthy3
+      |> Spec_Rules.add name Spec_Rules.equational [lhs] [th]
+      |> Code.declare_default_eqns [(th, true)];
 
-    val lthy5 = lthy4
-      |> Code.declare_default_eqns [(th', true)];
-
-    val lhs' = Morphism.term (Local_Theory.target_morphism lthy5) lhs;
+    val lhs' = Morphism.term (Local_Theory.target_morphism lthy4) lhs;
 
     val _ =
-      Proof_Display.print_consts int (Position.thread_data ()) lthy5
+      Proof_Display.print_consts int (Position.thread_data ()) lthy4
         (Frees.defined (Frees.build (Frees.add_frees lhs'))) [(x, T)];
-  in ((lhs, (def_name, th')), lthy5) end;
+  in ((lhs, (def_name, th)), lthy4) end;
 
 fun definition xs ys As B = gen_def check_spec_open (K I) xs ys As B false;
 val definition_cmd = gen_def read_spec_open Attrib.check_src;