src/HOL/Tools/BNF/bnf_comp.ML
changeset 60752 b48830b670a1
parent 60728 26ffdb966759
child 60757 c09598a97436
equal deleted inserted replaced
60751:83f04804696c 60752:b48830b670a1
   454     val bnf_wits = mk_wits_of_bnf (replicate nwits Ds) (replicate nwits As) bnf;
   454     val bnf_wits = mk_wits_of_bnf (replicate nwits Ds) (replicate nwits As) bnf;
   455 
   455 
   456     val wits = map (fn t => fold absfree (Term.add_frees t []) t)
   456     val wits = map (fn t => fold absfree (Term.add_frees t []) t)
   457       (map (fn (I, wit) => Term.list_comb (wit, map (nth xs) I)) bnf_wits);
   457       (map (fn (I, wit) => Term.list_comb (wit, map (nth xs) I)) bnf_wits);
   458 
   458 
   459     fun wit_tac _ = mk_simple_wit_tac (wit_thms_of_bnf bnf);
   459     fun wit_tac ctxt = mk_simple_wit_tac ctxt (wit_thms_of_bnf bnf);
   460 
   460 
   461     val (bnf', lthy') =
   461     val (bnf', lthy') =
   462       bnf_def Smart_Inline (K Dont_Note) true qualify tacs wit_tac (SOME (Ds @ killedAs))
   462       bnf_def Smart_Inline (K Dont_Note) true qualify tacs wit_tac (SOME (Ds @ killedAs))
   463         Binding.empty Binding.empty [] ((((((b, T), mapx), sets), bd), wits), SOME rel) lthy;
   463         Binding.empty Binding.empty [] ((((((b, T), mapx), sets), bd), wits), SOME rel) lthy;
   464   in
   464   in
   545     val tacs = zip_axioms map_id0_tac map_comp0_tac map_cong0_tac set_map0_tacs bd_card_order_tac
   545     val tacs = zip_axioms map_id0_tac map_comp0_tac map_cong0_tac set_map0_tacs bd_card_order_tac
   546       bd_cinfinite_tac set_bd_tacs le_rel_OO_tac rel_OO_Grp_tac;
   546       bd_cinfinite_tac set_bd_tacs le_rel_OO_tac rel_OO_Grp_tac;
   547 
   547 
   548     val wits = map snd (mk_wits_of_bnf (replicate nwits Ds) (replicate nwits As) bnf);
   548     val wits = map snd (mk_wits_of_bnf (replicate nwits Ds) (replicate nwits As) bnf);
   549 
   549 
   550     fun wit_tac _ = mk_simple_wit_tac (wit_thms_of_bnf bnf);
   550     fun wit_tac ctxt = mk_simple_wit_tac ctxt (wit_thms_of_bnf bnf);
   551 
   551 
   552     val (bnf', lthy') =
   552     val (bnf', lthy') =
   553       bnf_def Smart_Inline (K Dont_Note) true qualify tacs wit_tac (SOME Ds) Binding.empty
   553       bnf_def Smart_Inline (K Dont_Note) true qualify tacs wit_tac (SOME Ds) Binding.empty
   554         Binding.empty [] ((((((b, T), mapx), sets), bd), wits), SOME rel) lthy;
   554         Binding.empty [] ((((((b, T), mapx), sets), bd), wits), SOME rel) lthy;
   555   in
   555   in
   627     val tacs = zip_axioms map_id0_tac map_comp0_tac map_cong0_tac set_map0_tacs bd_card_order_tac
   627     val tacs = zip_axioms map_id0_tac map_comp0_tac map_cong0_tac set_map0_tacs bd_card_order_tac
   628       bd_cinfinite_tac set_bd_tacs le_rel_OO_tac rel_OO_Grp_tac;
   628       bd_cinfinite_tac set_bd_tacs le_rel_OO_tac rel_OO_Grp_tac;
   629 
   629 
   630     val wits = map snd (mk_wits_of_bnf (replicate nwits Ds) (replicate nwits As) bnf);
   630     val wits = map snd (mk_wits_of_bnf (replicate nwits Ds) (replicate nwits As) bnf);
   631 
   631 
   632     fun wit_tac _ = mk_simple_wit_tac (wit_thms_of_bnf bnf);
   632     fun wit_tac ctxt = mk_simple_wit_tac ctxt (wit_thms_of_bnf bnf);
   633 
   633 
   634     val (bnf', lthy') =
   634     val (bnf', lthy') =
   635       bnf_def Smart_Inline (K Dont_Note) true qualify tacs wit_tac (SOME Ds) Binding.empty
   635       bnf_def Smart_Inline (K Dont_Note) true qualify tacs wit_tac (SOME Ds) Binding.empty
   636         Binding.empty [] ((((((b, T), mapx), sets), bd), wits), SOME rel) lthy;
   636         Binding.empty [] ((((((b, T), mapx), sets), bd), wits), SOME rel) lthy;
   637   in
   637   in
   881     val bnf_wits = map (fn (I, t) =>
   881     val bnf_wits = map (fn (I, t) =>
   882         fold Term.absdummy (map (nth As) I)
   882         fold Term.absdummy (map (nth As) I)
   883           (AbsA $ Term.list_comb (t, map Bound (0 upto length I - 1))))
   883           (AbsA $ Term.list_comb (t, map Bound (0 upto length I - 1))))
   884       (mk_wits_of_bnf (replicate nwits Ds) (replicate nwits As) bnf);
   884       (mk_wits_of_bnf (replicate nwits Ds) (replicate nwits As) bnf);
   885 
   885 
   886     fun wit_tac ctxt = ALLGOALS (dtac ctxt (type_definition RS @{thm type_copy_wit})) THEN
   886     fun wit_tac ctxt =
   887       mk_simple_wit_tac (wit_thms_of_bnf bnf);
   887       ALLGOALS (dtac ctxt (type_definition RS @{thm type_copy_wit})) THEN
       
   888       mk_simple_wit_tac ctxt (wit_thms_of_bnf bnf);
   888 
   889 
   889     val (bnf', lthy') =
   890     val (bnf', lthy') =
   890       bnf_def Hardly_Inline (user_policy Dont_Note) true qualify tacs wit_tac (SOME all_deads)
   891       bnf_def Hardly_Inline (user_policy Dont_Note) true qualify tacs wit_tac (SOME all_deads)
   891         Binding.empty Binding.empty []
   892         Binding.empty Binding.empty []
   892         ((((((b, TA), bnf_map), bnf_sets), bnf_bd'), bnf_wits), SOME bnf_rel) lthy;
   893         ((((((b, TA), bnf_map), bnf_sets), bnf_bd'), bnf_wits), SOME bnf_rel) lthy;