2019 |
2019 |
2020 val thy1 = List.foldr (fn(name,thy)=> |
2020 val thy1 = List.foldr (fn(name,thy)=> |
2021 snd (get_defname thyname name thy)) thy1 names |
2021 snd (get_defname thyname name thy)) thy1 names |
2022 fun new_name name = fst (get_defname thyname name thy1) |
2022 fun new_name name = fst (get_defname thyname name thy1) |
2023 val names' = map (fn name => (new_name name,name,false)) names |
2023 val names' = map (fn name => (new_name name,name,false)) names |
2024 val (thy',res) = SpecificationPackage.add_specification NONE |
2024 val (thy',res) = Choice_Specification.add_specification NONE |
2025 names' |
2025 names' |
2026 (thy1,th) |
2026 (thy1,th) |
2027 val _ = ImportRecorder.add_specification names' th |
2027 val _ = ImportRecorder.add_specification names' th |
2028 val res' = Thm.unvarify res |
2028 val res' = Thm.unvarify res |
2029 val hth = HOLThm(rens,res') |
2029 val hth = HOLThm(rens,res') |
2089 val tfrees = OldTerm.term_tfrees c |
2089 val tfrees = OldTerm.term_tfrees c |
2090 val tnames = map fst tfrees |
2090 val tnames = map fst tfrees |
2091 val tsyn = mk_syn thy tycname |
2091 val tsyn = mk_syn thy tycname |
2092 val typ = (tycname,tnames,tsyn) |
2092 val typ = (tycname,tnames,tsyn) |
2093 val ((_, typedef_info), thy') = |
2093 val ((_, typedef_info), thy') = |
2094 TypedefPackage.add_typedef false (SOME (Binding.name thmname)) |
2094 Typedef.add_typedef false (SOME (Binding.name thmname)) |
2095 (Binding.name tycname, tnames, tsyn) c NONE (rtac th2 1) thy |
2095 (Binding.name tycname, tnames, tsyn) c NONE (rtac th2 1) thy |
2096 val _ = ImportRecorder.add_typedef (SOME thmname) typ c NONE th2 |
2096 val _ = ImportRecorder.add_typedef (SOME thmname) typ c NONE th2 |
2097 |
2097 |
2098 val th3 = (#type_definition typedef_info) RS typedef_hol2hol4 |
2098 val th3 = (#type_definition typedef_info) RS typedef_hol2hol4 |
2099 |
2099 |
2177 val tfrees = OldTerm.term_tfrees c |
2177 val tfrees = OldTerm.term_tfrees c |
2178 val tnames = sort string_ord (map fst tfrees) |
2178 val tnames = sort string_ord (map fst tfrees) |
2179 val tsyn = mk_syn thy tycname |
2179 val tsyn = mk_syn thy tycname |
2180 val typ = (tycname,tnames,tsyn) |
2180 val typ = (tycname,tnames,tsyn) |
2181 val ((_, typedef_info), thy') = |
2181 val ((_, typedef_info), thy') = |
2182 TypedefPackage.add_typedef false NONE (Binding.name tycname,tnames,tsyn) c |
2182 Typedef.add_typedef false NONE (Binding.name tycname,tnames,tsyn) c |
2183 (SOME(Binding.name rep_name,Binding.name abs_name)) (rtac th2 1) thy |
2183 (SOME(Binding.name rep_name,Binding.name abs_name)) (rtac th2 1) thy |
2184 val _ = ImportRecorder.add_typedef NONE typ c (SOME(rep_name,abs_name)) th2 |
2184 val _ = ImportRecorder.add_typedef NONE typ c (SOME(rep_name,abs_name)) th2 |
2185 val fulltyname = Sign.intern_type thy' tycname |
2185 val fulltyname = Sign.intern_type thy' tycname |
2186 val aty = Type (fulltyname, map mk_vartype tnames) |
2186 val aty = Type (fulltyname, map mk_vartype tnames) |
2187 val abs_ty = tT --> aty |
2187 val abs_ty = tT --> aty |