src/HOL/Tools/datatype_package/datatype_rep_proofs.ML
changeset 31723 f5cafe803b55
parent 31668 a616e56a5ec8
child 31737 b3f63611784e
equal deleted inserted replaced
31717:d1f7b6245a75 31723:f5cafe803b55
   181     val intr_ts = maps (fn ((_, (_, _, constrs)), rep_set_name) =>
   181     val intr_ts = maps (fn ((_, (_, _, constrs)), rep_set_name) =>
   182       map (make_intr rep_set_name (length constrs))
   182       map (make_intr rep_set_name (length constrs))
   183         ((1 upto (length constrs)) ~~ constrs)) (descr' ~~ rep_set_names');
   183         ((1 upto (length constrs)) ~~ constrs)) (descr' ~~ rep_set_names');
   184 
   184 
   185     val ({raw_induct = rep_induct, intrs = rep_intrs, ...}, thy2) =
   185     val ({raw_induct = rep_induct, intrs = rep_intrs, ...}, thy2) =
   186         InductivePackage.add_inductive_global (serial_string ())
   186         Inductive.add_inductive_global (serial_string ())
   187           {quiet_mode = #quiet config, verbose = false, kind = Thm.internalK,
   187           {quiet_mode = #quiet config, verbose = false, kind = Thm.internalK,
   188            alt_name = Binding.name big_rec_name, coind = false, no_elim = true, no_ind = false,
   188            alt_name = Binding.name big_rec_name, coind = false, no_elim = true, no_ind = false,
   189            skip_mono = true, fork_mono = false}
   189            skip_mono = true, fork_mono = false}
   190           (map (fn s => ((Binding.name s, UnivT'), NoSyn)) rep_set_names') []
   190           (map (fn s => ((Binding.name s, UnivT'), NoSyn)) rep_set_names') []
   191           (map (fn x => (Attrib.empty_binding, x)) intr_ts) [] thy1;
   191           (map (fn x => (Attrib.empty_binding, x)) intr_ts) [] thy1;
   193     (********************************* typedef ********************************)
   193     (********************************* typedef ********************************)
   194 
   194 
   195     val (typedefs, thy3) = thy2 |>
   195     val (typedefs, thy3) = thy2 |>
   196       parent_path (#flat_names config) |>
   196       parent_path (#flat_names config) |>
   197       fold_map (fn ((((name, mx), tvs), c), name') =>
   197       fold_map (fn ((((name, mx), tvs), c), name') =>
   198           TypedefPackage.add_typedef false (SOME (Binding.name name')) (name, tvs, mx)
   198           Typedef.add_typedef false (SOME (Binding.name name')) (name, tvs, mx)
   199             (Collect $ Const (c, UnivT')) NONE
   199             (Collect $ Const (c, UnivT')) NONE
   200             (rtac exI 1 THEN rtac CollectI 1 THEN
   200             (rtac exI 1 THEN rtac CollectI 1 THEN
   201               QUIET_BREADTH_FIRST (has_fewer_prems 1)
   201               QUIET_BREADTH_FIRST (has_fewer_prems 1)
   202               (resolve_tac rep_intrs 1)))
   202               (resolve_tac rep_intrs 1)))
   203                 (types_syntax ~~ tyvars ~~
   203                 (types_syntax ~~ tyvars ~~