equal
deleted
inserted
replaced
156 val ind_params = InductivePackage.params_of raw_induct; |
156 val ind_params = InductivePackage.params_of raw_induct; |
157 val raw_induct = atomize_induct ctxt raw_induct; |
157 val raw_induct = atomize_induct ctxt raw_induct; |
158 val elims = map (atomize_induct ctxt) elims; |
158 val elims = map (atomize_induct ctxt) elims; |
159 val monos = InductivePackage.get_monos ctxt; |
159 val monos = InductivePackage.get_monos ctxt; |
160 val eqvt_thms = NominalThmDecls.get_eqvt_thms ctxt; |
160 val eqvt_thms = NominalThmDecls.get_eqvt_thms ctxt; |
161 val _ = (case names \\ foldl (apfst prop_of #> add_term_consts) [] eqvt_thms of |
161 val _ = (case names \\ foldl (apfst prop_of #> OldTerm.add_term_consts) [] eqvt_thms of |
162 [] => () |
162 [] => () |
163 | xs => error ("Missing equivariance theorem for predicate(s): " ^ |
163 | xs => error ("Missing equivariance theorem for predicate(s): " ^ |
164 commas_quote xs)); |
164 commas_quote xs)); |
165 val induct_cases = map fst (fst (RuleCases.get (the |
165 val induct_cases = map fst (fst (RuleCases.get (the |
166 (Induct.lookup_inductP ctxt (hd names))))); |
166 (Induct.lookup_inductP ctxt (hd names))))); |
219 val atomTs = distinct op = (maps (map snd o #2) prems); |
219 val atomTs = distinct op = (maps (map snd o #2) prems); |
220 val atoms = map (fst o dest_Type) atomTs; |
220 val atoms = map (fst o dest_Type) atomTs; |
221 val ind_sort = if null atomTs then HOLogic.typeS |
221 val ind_sort = if null atomTs then HOLogic.typeS |
222 else Sign.certify_sort thy (map (fn a => Sign.intern_class thy |
222 else Sign.certify_sort thy (map (fn a => Sign.intern_class thy |
223 ("fs_" ^ Sign.base_name a)) atoms); |
223 ("fs_" ^ Sign.base_name a)) atoms); |
224 val fs_ctxt_tyname = Name.variant (map fst (term_tfrees raw_induct')) "'n"; |
224 val fs_ctxt_tyname = Name.variant (map fst (OldTerm.term_tfrees raw_induct')) "'n"; |
225 val fs_ctxt_name = Name.variant (add_term_names (raw_induct', [])) "z"; |
225 val fs_ctxt_name = Name.variant (OldTerm.add_term_names (raw_induct', [])) "z"; |
226 val fsT = TFree (fs_ctxt_tyname, ind_sort); |
226 val fsT = TFree (fs_ctxt_tyname, ind_sort); |
227 |
227 |
228 val inductive_forall_def' = Drule.instantiate' |
228 val inductive_forall_def' = Drule.instantiate' |
229 [SOME (ctyp_of thy fsT)] [] inductive_forall_def; |
229 [SOME (ctyp_of thy fsT)] [] inductive_forall_def; |
230 |
230 |