src/Pure/more_thm.ML
changeset 39133 70d3915c92f0
parent 36744 6e1f3d609a68
child 40238 edcdecd55655
equal deleted inserted replaced
39132:ba17ca3acdd3 39133:70d3915c92f0
   346 
   346 
   347 fun add_axiom (b, prop) thy =
   347 fun add_axiom (b, prop) thy =
   348   let
   348   let
   349     val b' = if Binding.is_empty b then Binding.name ("unnamed_axiom_" ^ serial_string ()) else b;
   349     val b' = if Binding.is_empty b then Binding.name ("unnamed_axiom_" ^ serial_string ()) else b;
   350 
   350 
   351     val _ = Sign.no_vars (Syntax.pp_global thy) prop;
   351     val _ = Sign.no_vars (Syntax.init_pretty_global thy) prop;
   352     val (strip, recover, prop') = stripped_sorts thy prop;
   352     val (strip, recover, prop') = stripped_sorts thy prop;
   353     val constraints = map (fn (TFree (_, S), T) => (T, S)) strip;
   353     val constraints = map (fn (TFree (_, S), T) => (T, S)) strip;
   354     val of_sorts = maps (fn (T as TFree (_, S), _) => of_sort (Thm.ctyp_of thy T, S)) strip;
   354     val of_sorts = maps (fn (T as TFree (_, S), _) => of_sort (Thm.ctyp_of thy T, S)) strip;
   355 
   355 
   356     val thy' =
   356     val thy' =
   363       |> fold elim_implies of_sorts;
   363       |> fold elim_implies of_sorts;
   364   in ((axm_name, thm), thy') end;
   364   in ((axm_name, thm), thy') end;
   365 
   365 
   366 fun add_def unchecked overloaded (b, prop) thy =
   366 fun add_def unchecked overloaded (b, prop) thy =
   367   let
   367   let
   368     val _ = Sign.no_vars (Syntax.pp_global thy) prop;
   368     val _ = Sign.no_vars (Syntax.init_pretty_global thy) prop;
   369     val prems = map (Thm.cterm_of thy) (Logic.strip_imp_prems prop);
   369     val prems = map (Thm.cterm_of thy) (Logic.strip_imp_prems prop);
   370     val (_, recover, concl') = stripped_sorts thy (Logic.strip_imp_concl prop);
   370     val (_, recover, concl') = stripped_sorts thy (Logic.strip_imp_concl prop);
   371 
   371 
   372     val thy' = Theory.add_def unchecked overloaded (b, concl') thy;
   372     val thy' = Theory.add_def unchecked overloaded (b, concl') thy;
   373     val axm_name = Sign.full_name thy' b;
   373     val axm_name = Sign.full_name thy' b;