src/HOL/Tools/BNF/bnf_def.ML
changeset 59580 cbc38731d42f
parent 59281 1b4dc8a9f7d9
child 59621 291934bac95e
equal deleted inserted replaced
59579:d8fff0b94c53 59580:cbc38731d42f
  1225               let
  1225               let
  1226                 val ranTs = map (fn AT => mk_sumT (AT, HOLogic.unitT)) As';
  1226                 val ranTs = map (fn AT => mk_sumT (AT, HOLogic.unitT)) As';
  1227                 val funTs = map (fn T => bdT --> T) ranTs;
  1227                 val funTs = map (fn T => bdT --> T) ranTs;
  1228                 val ran_bnfT = mk_bnf_T ranTs Calpha;
  1228                 val ran_bnfT = mk_bnf_T ranTs Calpha;
  1229                 val (revTs, Ts) = `rev (bd_bnfT :: funTs);
  1229                 val (revTs, Ts) = `rev (bd_bnfT :: funTs);
  1230                 val cTs = map (SOME o certifyT lthy) [ran_bnfT, Library.foldr1 HOLogic.mk_prodT Ts];
  1230                 val cTs = map (SOME o Proof_Context.ctyp_of lthy) [ran_bnfT, Library.foldr1 HOLogic.mk_prodT Ts];
  1231                 val tinst = fold (fn T => fn t => HOLogic.mk_split (Term.absdummy T t)) (tl revTs)
  1231                 val tinst = fold (fn T => fn t => HOLogic.mk_split (Term.absdummy T t)) (tl revTs)
  1232                   (Term.absdummy (hd revTs) (Term.list_comb (mk_bnf_map bdTs ranTs,
  1232                   (Term.absdummy (hd revTs) (Term.list_comb (mk_bnf_map bdTs ranTs,
  1233                     map Bound (live - 1 downto 0)) $ Bound live));
  1233                     map Bound (live - 1 downto 0)) $ Bound live));
  1234                 val cts = [NONE, SOME (certify lthy tinst)];
  1234                 val cts = [NONE, SOME (Proof_Context.cterm_of lthy tinst)];
  1235               in
  1235               in
  1236                 Drule.instantiate' cTs cts @{thm surj_imp_ordLeq}
  1236                 Drule.instantiate' cTs cts @{thm surj_imp_ordLeq}
  1237               end);
  1237               end);
  1238             val bd = mk_cexp
  1238             val bd = mk_cexp
  1239               (if live = 0 then ctwo
  1239               (if live = 0 then ctwo
  1344         val in_rel = Lazy.lazy mk_in_rel;
  1344         val in_rel = Lazy.lazy mk_in_rel;
  1345 
  1345 
  1346         fun mk_rel_flip () =
  1346         fun mk_rel_flip () =
  1347           let
  1347           let
  1348             val rel_conversep_thm = Lazy.force rel_conversep;
  1348             val rel_conversep_thm = Lazy.force rel_conversep;
  1349             val cts = map (SOME o certify lthy) Rs;
  1349             val cts = map (SOME o Proof_Context.cterm_of lthy) Rs;
  1350             val rel_conversep_thm' = cterm_instantiate_pos cts rel_conversep_thm;
  1350             val rel_conversep_thm' = cterm_instantiate_pos cts rel_conversep_thm;
  1351           in
  1351           in
  1352             unfold_thms lthy @{thms conversep_iff} (rel_conversep_thm' RS @{thm predicate2_eqD})
  1352             unfold_thms lthy @{thms conversep_iff} (rel_conversep_thm' RS @{thm predicate2_eqD})
  1353             |> singleton (Proof_Context.export names_lthy pre_names_lthy)
  1353             |> singleton (Proof_Context.export names_lthy pre_names_lthy)
  1354           end;
  1354           end;