src/HOL/BNF/Tools/bnf_fp_def_sugar.ML
changeset 53569 b4db0ade27bd
parent 53553 d4191bf88529
child 53591 b6e2993fd0d3
equal deleted inserted replaced
53568:f9456284048f 53569:b4db0ade27bd
   540 
   540 
   541 fun define_co_iters fp fpT Cs binding_specs lthy0 =
   541 fun define_co_iters fp fpT Cs binding_specs lthy0 =
   542   let
   542   let
   543     val thy = Proof_Context.theory_of lthy0;
   543     val thy = Proof_Context.theory_of lthy0;
   544 
   544 
       
   545     val maybe_conceal_def_binding = Thm.def_binding
       
   546       #> Config.get lthy0 bnf_note_all = false ? Binding.conceal;
       
   547 
   545     val ((csts, defs), (lthy', lthy)) = lthy0
   548     val ((csts, defs), (lthy', lthy)) = lthy0
   546       |> apfst split_list o fold_map (fn (b, spec) =>
   549       |> apfst split_list o fold_map (fn (b, spec) =>
   547         Specification.definition (SOME (b, NONE, NoSyn), ((Thm.def_binding b, []), spec))
   550         Specification.definition (SOME (b, NONE, NoSyn), ((maybe_conceal_def_binding b, []), spec))
   548         #>> apsnd snd) binding_specs
   551         #>> apsnd snd) binding_specs
   549       ||> `Local_Theory.restore;
   552       ||> `Local_Theory.restore;
   550 
   553 
   551     val phi = Proof_Context.export_morphism lthy lthy';
   554     val phi = Proof_Context.export_morphism lthy lthy';
   552 
   555 
  1248 
  1251 
  1249         val ctr_rhss =
  1252         val ctr_rhss =
  1250           map3 (fn k => fn xs => fn tuple_x => fold_rev Term.lambda xs (ctor $
  1253           map3 (fn k => fn xs => fn tuple_x => fold_rev Term.lambda xs (ctor $
  1251             mk_InN_balanced ctr_sum_prod_T n tuple_x k)) ks xss tuple_xs;
  1254             mk_InN_balanced ctr_sum_prod_T n tuple_x k)) ks xss tuple_xs;
  1252 
  1255 
       
  1256         val maybe_conceal_def_binding = Thm.def_binding
       
  1257           #> Config.get no_defs_lthy bnf_note_all = false ? Binding.conceal;
       
  1258 
  1253         val ((raw_ctrs, raw_ctr_defs), (lthy', lthy)) = no_defs_lthy
  1259         val ((raw_ctrs, raw_ctr_defs), (lthy', lthy)) = no_defs_lthy
  1254           |> apfst split_list o fold_map3 (fn b => fn mx => fn rhs =>
  1260           |> apfst split_list o fold_map3 (fn b => fn mx => fn rhs =>
  1255               Local_Theory.define ((b, mx), ((Thm.def_binding b, []), rhs)) #>> apsnd snd)
  1261               Local_Theory.define ((b, mx), ((maybe_conceal_def_binding b, []), rhs)) #>> apsnd snd)
  1256             ctr_bindings ctr_mixfixes ctr_rhss
  1262             ctr_bindings ctr_mixfixes ctr_rhss
  1257           ||> `Local_Theory.restore;
  1263           ||> `Local_Theory.restore;
  1258 
  1264 
  1259         val phi = Proof_Context.export_morphism lthy lthy';
  1265         val phi = Proof_Context.export_morphism lthy lthy';
  1260 
  1266