more uniform treatment of package internals;
authorwenzelm
Thu Jan 07 15:53:39 2016 +0100 (2016-01-07)
changeset 62093bd73a2279fcd
parent 62092 9ace5f5bae69
child 62094 7d47cf67516d
more uniform treatment of package internals;
NEWS
src/Doc/Datatypes/Datatypes.thy
src/HOL/Complete_Partial_Order.thy
src/HOL/Finite_Set.thy
src/HOL/Library/Linear_Temporal_Logic_on_Streams.thy
src/HOL/Library/RBT_Impl.thy
src/HOL/Library/Stream.thy
src/HOL/List.thy
src/HOL/Probability/Bochner_Integration.thy
src/HOL/Tools/BNF/bnf_def.ML
src/HOL/Tools/BNF/bnf_fp_def_sugar.ML
src/HOL/Tools/BNF/bnf_fp_util.ML
src/HOL/Tools/BNF/bnf_gfp.ML
src/HOL/Tools/BNF/bnf_lfp.ML
src/HOL/Tools/BNF/bnf_lfp_size.ML
src/HOL/Tools/Function/function_core.ML
src/HOL/Tools/Function/function_lib.ML
src/HOL/Tools/Function/mutual.ML
src/HOL/Tools/Function/partial_function.ML
src/HOL/Tools/Sledgehammer/sledgehammer_fact.ML
src/HOL/Tools/inductive.ML
src/HOL/Transitive_Closure.thy
src/Pure/more_thm.ML
     1.1 --- a/NEWS	Thu Jan 07 15:50:09 2016 +0100
     1.2 +++ b/NEWS	Thu Jan 07 15:53:39 2016 +0100
     1.3 @@ -443,12 +443,17 @@
     1.4  
     1.5  * Inductive definitions ('inductive', 'coinductive', etc.) expose
     1.6  low-level facts of the internal construction only if the option
     1.7 -"inductive_defs" is enabled. This refers to the internal predicate
     1.8 +"inductive_internals" is enabled. This refers to the internal predicate
     1.9  definition and its monotonicity result. Rare INCOMPATIBILITY.
    1.10  
    1.11  * Recursive function definitions ('fun', 'function', 'partial_function')
    1.12  expose low-level facts of the internal construction only if the option
    1.13 -"function_defs" is enabled. Rare INCOMPATIBILITY.
    1.14 +"function_internals" is enabled. Rare INCOMPATIBILITY.
    1.15 +
    1.16 +* BNF datatypes ('datatype', 'codatatype', etc.) expose low-level facts
    1.17 +of the internal construction only if the option "bnf_internals" is
    1.18 +enabled. This supersedes the former option "bnf_note_all". Rare
    1.19 +INCOMPATIBILITY.
    1.20  
    1.21  * Combinator to represent case distinction on products is named
    1.22  "case_prod", uniformly, discontinuing any input aliasses. Very popular
     2.1 --- a/src/Doc/Datatypes/Datatypes.thy	Thu Jan 07 15:50:09 2016 +0100
     2.2 +++ b/src/Doc/Datatypes/Datatypes.thy	Thu Jan 07 15:53:39 2016 +0100
     2.3 @@ -693,9 +693,9 @@
     2.4  the line
     2.5  \<close>
     2.6  
     2.7 -    declare [[bnf_note_all]]
     2.8 +    declare [[bnf_internals]]
     2.9  (*<*)
    2.10 -    declare [[bnf_note_all = false]]
    2.11 +    declare [[bnf_internals = false]]
    2.12  (*>*)
    2.13  
    2.14  text \<open>
     3.1 --- a/src/HOL/Complete_Partial_Order.thy	Thu Jan 07 15:50:09 2016 +0100
     3.2 +++ b/src/HOL/Complete_Partial_Order.thy	Thu Jan 07 15:53:39 2016 +0100
     3.3 @@ -87,7 +87,7 @@
     3.4  
     3.5  subsection \<open>Transfinite iteration of a function\<close>
     3.6  
     3.7 -context notes [[inductive_defs]] begin
     3.8 +context notes [[inductive_internals]] begin
     3.9  
    3.10  inductive_set iterates :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a set"
    3.11  for f :: "'a \<Rightarrow> 'a"
     4.1 --- a/src/HOL/Finite_Set.thy	Thu Jan 07 15:50:09 2016 +0100
     4.2 +++ b/src/HOL/Finite_Set.thy	Thu Jan 07 15:53:39 2016 +0100
     4.3 @@ -12,7 +12,7 @@
     4.4  subsection \<open>Predicate for finite sets\<close>
     4.5  
     4.6  context
     4.7 -  notes [[inductive_defs]]
     4.8 +  notes [[inductive_internals]]
     4.9  begin
    4.10  
    4.11  inductive finite :: "'a set \<Rightarrow> bool"
     5.1 --- a/src/HOL/Library/Linear_Temporal_Logic_on_Streams.thy	Thu Jan 07 15:50:09 2016 +0100
     5.2 +++ b/src/HOL/Library/Linear_Temporal_Logic_on_Streams.thy	Thu Jan 07 15:53:39 2016 +0100
     5.3 @@ -65,7 +65,7 @@
     5.4    "s \<cdot> P \<equiv> HLD s aand nxt P"
     5.5  
     5.6  context
     5.7 -  notes [[inductive_defs]]
     5.8 +  notes [[inductive_internals]]
     5.9  begin
    5.10  
    5.11  inductive ev for \<phi> where
    5.12 @@ -594,7 +594,7 @@
    5.13  text \<open>Strong until\<close>
    5.14  
    5.15  context
    5.16 -  notes [[inductive_defs]]
    5.17 +  notes [[inductive_internals]]
    5.18  begin
    5.19  
    5.20  inductive suntil (infix "suntil" 60) for \<phi> \<psi> where
     6.1 --- a/src/HOL/Library/RBT_Impl.thy	Thu Jan 07 15:50:09 2016 +0100
     6.2 +++ b/src/HOL/Library/RBT_Impl.thy	Thu Jan 07 15:53:39 2016 +0100
     6.3 @@ -1758,9 +1758,7 @@
     6.4    Rep_compare Rep_compare_cases Rep_compare_induct Rep_compare_inject Rep_compare_inverse
     6.5    compare.simps compare.exhaust compare.induct compare.rec compare.simps
     6.6    compare.size compare.case_cong compare.case_cong_weak compare.case
     6.7 -  compare.nchotomy compare.split compare.split_asm rec_compare_def
     6.8 -  compare.eq.refl compare.eq.simps
     6.9 -  compare.EQ_def compare.GT_def compare.LT_def
    6.10 +  compare.nchotomy compare.split compare.split_asm compare.eq.refl compare.eq.simps
    6.11    equal_compare_def
    6.12    skip_red.simps skip_red.cases skip_red.induct 
    6.13    skip_black_def
     7.1 --- a/src/HOL/Library/Stream.thy	Thu Jan 07 15:50:09 2016 +0100
     7.2 +++ b/src/HOL/Library/Stream.thy	Thu Jan 07 15:53:39 2016 +0100
     7.3 @@ -69,7 +69,7 @@
     7.4  subsection \<open>set of streams with elements in some fixed set\<close>
     7.5  
     7.6  context
     7.7 -  notes [[inductive_defs]]
     7.8 +  notes [[inductive_internals]]
     7.9  begin
    7.10  
    7.11  coinductive_set
     8.1 --- a/src/HOL/List.thy	Thu Jan 07 15:50:09 2016 +0100
     8.2 +++ b/src/HOL/List.thy	Thu Jan 07 15:53:39 2016 +0100
     8.3 @@ -5586,7 +5586,7 @@
     8.4  begin
     8.5  
     8.6  context
     8.7 -  notes [[inductive_defs]]
     8.8 +  notes [[inductive_internals]]
     8.9  begin
    8.10  
    8.11  inductive lexordp :: "'a list \<Rightarrow> 'a list \<Rightarrow> bool"
     9.1 --- a/src/HOL/Probability/Bochner_Integration.thy	Thu Jan 07 15:50:09 2016 +0100
     9.2 +++ b/src/HOL/Probability/Bochner_Integration.thy	Thu Jan 07 15:53:39 2016 +0100
     9.3 @@ -887,7 +887,7 @@
     9.4  qed
     9.5  
     9.6  context
     9.7 -  notes [[inductive_defs]]
     9.8 +  notes [[inductive_internals]]
     9.9  begin
    9.10  
    9.11  inductive integrable for M f where
    10.1 --- a/src/HOL/Tools/BNF/bnf_def.ML	Thu Jan 07 15:50:09 2016 +0100
    10.2 +++ b/src/HOL/Tools/BNF/bnf_def.ML	Thu Jan 07 15:53:39 2016 +0100
    10.3 @@ -119,7 +119,7 @@
    10.4    datatype inline_policy = Dont_Inline | Hardly_Inline | Smart_Inline | Do_Inline
    10.5    datatype fact_policy = Dont_Note | Note_Some | Note_All
    10.6  
    10.7 -  val bnf_note_all: bool Config.T
    10.8 +  val bnf_internals: bool Config.T
    10.9    val bnf_timing: bool Config.T
   10.10    val user_policy: fact_policy -> Proof.context -> fact_policy
   10.11    val note_bnf_thms: fact_policy -> (binding -> binding) -> binding -> bnf -> Proof.context ->
   10.12 @@ -725,10 +725,10 @@
   10.13  
   10.14  datatype fact_policy = Dont_Note | Note_Some | Note_All;
   10.15  
   10.16 -val bnf_note_all = Attrib.setup_config_bool @{binding bnf_note_all} (K false);
   10.17 +val bnf_internals = Attrib.setup_config_bool @{binding bnf_internals} (K false);
   10.18  val bnf_timing = Attrib.setup_config_bool @{binding bnf_timing} (K false);
   10.19  
   10.20 -fun user_policy policy ctxt = if Config.get ctxt bnf_note_all then Note_All else policy;
   10.21 +fun user_policy policy ctxt = if Config.get ctxt bnf_internals then Note_All else policy;
   10.22  
   10.23  val smart_max_inline_term_size = 25; (*FUDGE*)
   10.24  
    11.1 --- a/src/HOL/Tools/BNF/bnf_fp_def_sugar.ML	Thu Jan 07 15:50:09 2016 +0100
    11.2 +++ b/src/HOL/Tools/BNF/bnf_fp_def_sugar.ML	Thu Jan 07 15:53:39 2016 +0100
    11.3 @@ -1283,12 +1283,10 @@
    11.4    let
    11.5      val thy = Proof_Context.theory_of lthy0;
    11.6  
    11.7 -    val maybe_conceal_def_binding = Thm.def_binding
    11.8 -      #> not (Config.get lthy0 bnf_note_all) ? Binding.concealed;
    11.9 -
   11.10      val ((cst, (_, def)), (lthy', lthy)) = lthy0
   11.11        |> Local_Theory.open_target |> snd
   11.12 -      |> Local_Theory.define ((b, NoSyn), ((maybe_conceal_def_binding b, []), rhs))
   11.13 +      |> Local_Theory.define
   11.14 +          ((b, NoSyn), ((Thm.make_def_binding (Config.get lthy0 bnf_internals) b, []), rhs))
   11.15        ||> `Local_Theory.close_target;
   11.16  
   11.17      val phi = Proof_Context.export_morphism lthy lthy';
   11.18 @@ -2201,14 +2199,12 @@
   11.19            map2 (fn k => fn xs => fold_rev Term.lambda xs (ctor $ mk_absumprod ctr_absT abs n k xs))
   11.20              ks xss;
   11.21  
   11.22 -        val maybe_conceal_def_binding = Thm.def_binding
   11.23 -          #> not (Config.get no_defs_lthy bnf_note_all) ? Binding.concealed;
   11.24 -
   11.25          val ((raw_ctrs, raw_ctr_defs), (lthy', lthy)) = no_defs_lthy
   11.26            |> Local_Theory.open_target |> snd
   11.27            |> apfst split_list o @{fold_map 3} (fn b => fn mx => fn rhs =>
   11.28 -              Local_Theory.define ((b, mx), ((maybe_conceal_def_binding b, []), rhs)) #>> apsnd snd)
   11.29 -            ctr_bindings ctr_mixfixes ctr_rhss
   11.30 +              Local_Theory.define
   11.31 +                ((b, mx), ((Thm.make_def_binding (Config.get no_defs_lthy bnf_internals) b, []), rhs))
   11.32 +                  #>> apsnd snd) ctr_bindings ctr_mixfixes ctr_rhss
   11.33            ||> `Local_Theory.close_target;
   11.34  
   11.35          val phi = Proof_Context.export_morphism lthy lthy';
    12.1 --- a/src/HOL/Tools/BNF/bnf_fp_util.ML	Thu Jan 07 15:50:09 2016 +0100
    12.2 +++ b/src/HOL/Tools/BNF/bnf_fp_util.ML	Thu Jan 07 15:53:39 2016 +0100
    12.3 @@ -646,7 +646,7 @@
    12.4      val Dss = @{map 3} (uncurry append oo curry swap oo map o nth) livess kill_poss deadss;
    12.5  
    12.6      fun pre_qualify b = Binding.qualify false (Binding.name_of b)
    12.7 -      #> not (Config.get lthy' bnf_note_all) ? Binding.concealed;
    12.8 +      #> not (Config.get lthy' bnf_internals) ? Binding.concealed;
    12.9  
   12.10      val ((pre_bnfs, (deadss, absT_infos)), lthy'') =
   12.11        @{fold_map 4} (fn b => seal_bnf (pre_qualify b) unfold_set' (Binding.prefix_name preN b))
    13.1 --- a/src/HOL/Tools/BNF/bnf_gfp.ML	Thu Jan 07 15:50:09 2016 +0100
    13.2 +++ b/src/HOL/Tools/BNF/bnf_gfp.ML	Thu Jan 07 15:53:39 2016 +0100
    13.3 @@ -66,7 +66,7 @@
    13.4      val m = live - n; (*passive, if 0 don't generate a new BNF*)
    13.5      val ls = 1 upto m;
    13.6  
    13.7 -    val note_all = Config.get lthy bnf_note_all;
    13.8 +    val internals = Config.get lthy bnf_internals;
    13.9      val b_names = map Binding.name_of bs;
   13.10      val b_name = mk_common_name b_names;
   13.11      val b = Binding.name b_name;
   13.12 @@ -76,7 +76,7 @@
   13.13      fun mk_internal_b name = mk_internal_of_b name b;
   13.14      fun mk_internal_bs name = map (mk_internal_of_b name) bs;
   13.15      val external_bs = map2 (Binding.prefix false) b_names bs
   13.16 -      |> not note_all ? map Binding.concealed;
   13.17 +      |> not internals ? map Binding.concealed;
   13.18  
   13.19      val deads = fold (union (op =)) Dss resDs;
   13.20      val names_lthy = fold Variable.declare_typ deads lthy;
   13.21 @@ -2680,7 +2680,7 @@
   13.22            ((Binding.qualify true (Binding.name_of b) (Binding.name thmN), []), [(thms, [])]))
   13.23          bs thmss);
   13.24  
   13.25 -    val lthy' = lthy |> note_all ? snd o Local_Theory.notes (common_notes @ notes @ Jbnf_notes);
   13.26 +    val lthy' = lthy |> internals ? snd o Local_Theory.notes (common_notes @ notes @ Jbnf_notes);
   13.27  
   13.28      val fp_res =
   13.29        {Ts = Ts, bnfs = Jbnfs, ctors = ctors, dtors = dtors, xtor_un_folds = unfolds,
    14.1 --- a/src/HOL/Tools/BNF/bnf_lfp.ML	Thu Jan 07 15:50:09 2016 +0100
    14.2 +++ b/src/HOL/Tools/BNF/bnf_lfp.ML	Thu Jan 07 15:53:39 2016 +0100
    14.3 @@ -36,7 +36,7 @@
    14.4      val ks = 1 upto n;
    14.5      val m = live - n; (*passive, if 0 don't generate a new BNF*)
    14.6  
    14.7 -    val note_all = Config.get lthy bnf_note_all;
    14.8 +    val internals = Config.get lthy bnf_internals;
    14.9      val b_names = map Binding.name_of bs;
   14.10      val b_name = mk_common_name b_names;
   14.11      val b = Binding.name b_name;
   14.12 @@ -46,7 +46,7 @@
   14.13      fun mk_internal_b name = mk_internal_of_b name b;
   14.14      fun mk_internal_bs name = map (mk_internal_of_b name) bs;
   14.15      val external_bs = map2 (Binding.prefix false) b_names bs
   14.16 -      |> not note_all ? map Binding.concealed;
   14.17 +      |> not internals ? map Binding.concealed;
   14.18  
   14.19      val deads = fold (union (op =)) Dss resDs;
   14.20      val names_lthy = fold Variable.declare_typ deads lthy;
   14.21 @@ -1940,7 +1940,7 @@
   14.22            ((Binding.qualify true (Binding.name_of b) (Binding.name thmN), []), [(thms, [])]))
   14.23          bs thmss);
   14.24  
   14.25 -    val lthy' = lthy |> note_all ? snd o Local_Theory.notes (common_notes @ notes @ Ibnf_notes);
   14.26 +    val lthy' = lthy |> internals ? snd o Local_Theory.notes (common_notes @ notes @ Ibnf_notes);
   14.27  
   14.28      val fp_res =
   14.29        {Ts = Ts, bnfs = Ibnfs, ctors = ctors, dtors = dtors, xtor_un_folds = folds,
    15.1 --- a/src/HOL/Tools/BNF/bnf_lfp_size.ML	Thu Jan 07 15:50:09 2016 +0100
    15.2 +++ b/src/HOL/Tools/BNF/bnf_lfp_size.ML	Thu Jan 07 15:53:39 2016 +0100
    15.3 @@ -200,7 +200,7 @@
    15.4          #>> (fn args => fold_rev Term.lambda fs (Term.list_comb (substCnatT recx, args)));
    15.5  
    15.6        val maybe_conceal_def_binding = Thm.def_binding
    15.7 -        #> not (Config.get lthy0 bnf_note_all) ? Binding.concealed;
    15.8 +        #> not (Config.get lthy0 bnf_internals) ? Binding.concealed;
    15.9  
   15.10        val (size_rhss, nested_size_gen_o_mapss) = fold_map mk_size_rhs recs [];
   15.11        val size_Ts = map fastype_of size_rhss;
    16.1 --- a/src/HOL/Tools/Function/function_core.ML	Thu Jan 07 15:50:09 2016 +0100
    16.2 +++ b/src/HOL/Tools/Function/function_core.ML	Thu Jan 07 15:53:39 2016 +0100
    16.3 @@ -499,7 +499,7 @@
    16.4          $ (default $ Bound 0) $ Abs ("y", ranT, G $ Bound 1 $ Bound 0))
    16.5        |> Syntax.check_term lthy
    16.6      val def_binding =
    16.7 -      if Config.get lthy function_defs then (Binding.name fdefname, [])
    16.8 +      if Config.get lthy function_internals then (Binding.name fdefname, [])
    16.9        else Attrib.empty_binding
   16.10    in
   16.11      Local_Theory.define
    17.1 --- a/src/HOL/Tools/Function/function_lib.ML	Thu Jan 07 15:50:09 2016 +0100
    17.2 +++ b/src/HOL/Tools/Function/function_lib.ML	Thu Jan 07 15:53:39 2016 +0100
    17.3 @@ -7,7 +7,7 @@
    17.4  
    17.5  signature FUNCTION_LIB =
    17.6  sig
    17.7 -  val function_defs: bool Config.T
    17.8 +  val function_internals: bool Config.T
    17.9  
   17.10    val plural: string -> string -> 'a list -> string
   17.11  
   17.12 @@ -32,7 +32,7 @@
   17.13  structure Function_Lib: FUNCTION_LIB =
   17.14  struct
   17.15  
   17.16 -val function_defs = Attrib.setup_config_bool @{binding function_defs} (K false)
   17.17 +val function_internals = Attrib.setup_config_bool @{binding function_internals} (K false)
   17.18  
   17.19  
   17.20  (* "The variable" ^ plural " is" "s are" vs *)
    18.1 --- a/src/HOL/Tools/Function/mutual.ML	Thu Jan 07 15:50:09 2016 +0100
    18.2 +++ b/src/HOL/Tools/Function/mutual.ML	Thu Jan 07 15:53:39 2016 +0100
    18.3 @@ -129,7 +129,7 @@
    18.4      fun def ((MutualPart {i=i, i'=i', fvar=(fname, fT), cargTs, f_def, ...}), (_, mixfix)) lthy =
    18.5        let
    18.6          val def_binding =
    18.7 -          if Config.get lthy function_defs then (Binding.name (Thm.def_name fname), [])
    18.8 +          if Config.get lthy function_internals then (Binding.name (Thm.def_name fname), [])
    18.9            else Attrib.empty_binding
   18.10          val ((f, (_, f_defthm)), lthy') =
   18.11            Local_Theory.define
    19.1 --- a/src/HOL/Tools/Function/partial_function.ML	Thu Jan 07 15:50:09 2016 +0100
    19.2 +++ b/src/HOL/Tools/Function/partial_function.ML	Thu Jan 07 15:53:39 2016 +0100
    19.3 @@ -257,7 +257,8 @@
    19.4  
    19.5      val f_def_rhs = curry_n arity (apply_inst lthy fixp F_uc);
    19.6      val f_def_binding =
    19.7 -      if Config.get lthy Function_Lib.function_defs then (Binding.name (Thm.def_name fname), [])
    19.8 +      if Config.get lthy Function_Lib.function_internals
    19.9 +      then (Binding.name (Thm.def_name fname), [])
   19.10        else Attrib.empty_binding;
   19.11      val ((f, (_, f_def)), lthy') = Local_Theory.define
   19.12        ((f_binding, mixfix), (f_def_binding, f_def_rhs)) lthy;
    20.1 --- a/src/HOL/Tools/Sledgehammer/sledgehammer_fact.ML	Thu Jan 07 15:50:09 2016 +0100
    20.2 +++ b/src/HOL/Tools/Sledgehammer/sledgehammer_fact.ML	Thu Jan 07 15:53:39 2016 +0100
    20.3 @@ -83,9 +83,6 @@
    20.4  
    20.5  val backquote = enclose "\<open>" "\<close>"
    20.6  
    20.7 -(* unfolding these can yield really huge terms *)
    20.8 -val risky_defs = @{thms Bit0_def Bit1_def}
    20.9 -
   20.10  fun is_rec_eq lhs = Term.exists_subterm (curry (op =) (head_of lhs))
   20.11  
   20.12  fun is_rec_def (@{const Trueprop} $ t) = is_rec_def t
   20.13 @@ -324,7 +321,6 @@
   20.14          val (rec_defs, nonrec_defs) = specs
   20.15            |> filter (curry (op =) Spec_Rules.Equational o fst)
   20.16            |> maps (snd o snd)
   20.17 -          |> filter_out (member Thm.eq_thm_prop risky_defs)
   20.18            |> List.partition (is_rec_def o Thm.prop_of)
   20.19          val spec_intros = specs
   20.20            |> filter (member (op =) [Spec_Rules.Inductive, Spec_Rules.Co_Inductive] o fst)
    21.1 --- a/src/HOL/Tools/inductive.ML	Thu Jan 07 15:50:09 2016 +0100
    21.2 +++ b/src/HOL/Tools/inductive.ML	Thu Jan 07 15:53:39 2016 +0100
    21.3 @@ -71,7 +71,7 @@
    21.4  signature INDUCTIVE =
    21.5  sig
    21.6    include BASIC_INDUCTIVE
    21.7 -  val inductive_defs: bool Config.T
    21.8 +  val inductive_internals: bool Config.T
    21.9    val select_disj_tac: Proof.context -> int -> int -> int -> tactic
   21.10    type add_ind_def =
   21.11      inductive_flags ->
   21.12 @@ -122,7 +122,7 @@
   21.13  
   21.14  (** misc utilities **)
   21.15  
   21.16 -val inductive_defs = Attrib.setup_config_bool @{binding inductive_defs} (K false);
   21.17 +val inductive_internals = Attrib.setup_config_bool @{binding inductive_internals} (K false);
   21.18  
   21.19  fun message quiet_mode s = if quiet_mode then () else writeln s;
   21.20  
   21.21 @@ -849,16 +849,13 @@
   21.22        else alt_name;
   21.23      val rec_name = Binding.name_of rec_binding;
   21.24  
   21.25 -    val inductive_defs = Config.get lthy inductive_defs;
   21.26 -    fun cond_def_binding b =
   21.27 -      if inductive_defs then Binding.reset_pos (Thm.def_binding b)
   21.28 -      else Binding.empty;
   21.29 +    val internals = Config.get lthy inductive_internals;
   21.30  
   21.31      val ((rec_const, (_, fp_def)), lthy') = lthy
   21.32        |> is_auxiliary ? Proof_Context.concealed
   21.33        |> Local_Theory.define
   21.34          ((rec_binding, case cnames_syn of [(_, mx)] => mx | _ => NoSyn),
   21.35 -         ((cond_def_binding rec_binding, @{attributes [nitpick_unfold]}),
   21.36 +         ((Thm.make_def_binding internals rec_binding, @{attributes [nitpick_unfold]}),
   21.37             fold_rev lambda params
   21.38               (Const (fp_name, (predT --> predT) --> predT) $ fp_fun)))
   21.39        ||> Proof_Context.restore_naming lthy;
   21.40 @@ -874,7 +871,7 @@
   21.41                map Free (Variable.variant_frees lthy' intr_ts (mk_names "x" (length Ts) ~~ Ts));
   21.42            in
   21.43              ((b, mx),
   21.44 -              ((cond_def_binding b, []), fold_rev lambda (params @ xs)
   21.45 +              ((Thm.make_def_binding internals b, []), fold_rev lambda (params @ xs)
   21.46                  (list_comb (rec_const, params @ make_bool_args' bs i @
   21.47                    make_args argTs (xs ~~ Ts)))))
   21.48            end) (cnames_syn ~~ cs)
   21.49 @@ -887,7 +884,7 @@
   21.50      val mono = prove_mono quiet_mode skip_mono predT fp_fun monos ctxt'';
   21.51      val (_, lthy''') = lthy''
   21.52        |> Local_Theory.note
   21.53 -        ((if inductive_defs
   21.54 +        ((if internals
   21.55            then Binding.qualify true rec_name (Binding.name "mono")
   21.56            else Binding.empty, []),
   21.57            Proof_Context.export ctxt'' lthy'' [mono]);
    22.1 --- a/src/HOL/Transitive_Closure.thy	Thu Jan 07 15:50:09 2016 +0100
    22.2 +++ b/src/HOL/Transitive_Closure.thy	Thu Jan 07 15:53:39 2016 +0100
    22.3 @@ -21,7 +21,7 @@
    22.4  \<close>
    22.5  
    22.6  context
    22.7 -  notes [[inductive_defs]]
    22.8 +  notes [[inductive_internals]]
    22.9  begin
   22.10  
   22.11  inductive_set rtrancl :: "('a \<times> 'a) set \<Rightarrow> ('a \<times> 'a) set"  ("(_\<^sup>*)" [1000] 999)
    23.1 --- a/src/Pure/more_thm.ML	Thu Jan 07 15:50:09 2016 +0100
    23.2 +++ b/src/Pure/more_thm.ML	Thu Jan 07 15:53:39 2016 +0100
    23.3 @@ -92,6 +92,7 @@
    23.4    val def_name_optional: string -> string -> string
    23.5    val def_binding: Binding.binding -> Binding.binding
    23.6    val def_binding_optional: Binding.binding -> Binding.binding -> Binding.binding
    23.7 +  val make_def_binding: bool -> Binding.binding -> Binding.binding
    23.8    val has_name_hint: thm -> bool
    23.9    val get_name_hint: thm -> string
   23.10    val put_name_hint: string -> thm -> thm
   23.11 @@ -570,6 +571,9 @@
   23.12  fun def_binding_optional b name =
   23.13    if Binding.is_empty name then def_binding b else name;
   23.14  
   23.15 +fun make_def_binding cond b =
   23.16 +  if cond then Binding.reset_pos (def_binding b) else Binding.empty;
   23.17 +
   23.18  
   23.19  (* unofficial theorem names *)
   23.20