src/HOL/Import/proof_kernel.ML
changeset 19349 36e537f89585
parent 19264 61e775c03ed8
child 19686 83611262823e
equal deleted inserted replaced
19348:f2283f334e42 19349:36e537f89585
  2092 		      | _ => raise ERR "new_type_definition" "Bad type definition theorem"
  2092 		      | _ => raise ERR "new_type_definition" "Bad type definition theorem"
  2093 	    val tfrees = term_tfrees c
  2093 	    val tfrees = term_tfrees c
  2094 	    val tnames = map fst tfrees
  2094 	    val tnames = map fst tfrees
  2095 	    val tsyn = mk_syn thy tycname
  2095 	    val tsyn = mk_syn thy tycname
  2096 	    val typ = (tycname,tnames,tsyn)
  2096 	    val typ = (tycname,tnames,tsyn)
  2097 	    val (thy',typedef_info) = TypedefPackage.add_typedef_i false (SOME thmname) typ c NONE (rtac th2 1) thy	    
  2097 	    val (typedef_info, thy') = TypedefPackage.add_typedef_i false (SOME thmname) typ c NONE (rtac th2 1) thy	    
  2098             val _ = ImportRecorder.add_typedef (SOME thmname) typ c NONE th2
  2098             val _ = ImportRecorder.add_typedef (SOME thmname) typ c NONE th2
  2099 				      
  2099 				      
  2100 	    val th3 = (#type_definition typedef_info) RS typedef_hol2hol4
  2100 	    val th3 = (#type_definition typedef_info) RS typedef_hol2hol4
  2101 
  2101 
  2102 	    val fulltyname = Sign.intern_type thy' tycname
  2102 	    val fulltyname = Sign.intern_type thy' tycname
  2185 		      | _ => raise ERR "type_introduction" "Bad type definition theorem"
  2185 		      | _ => raise ERR "type_introduction" "Bad type definition theorem"
  2186 	    val tfrees = term_tfrees c
  2186 	    val tfrees = term_tfrees c
  2187 	    val tnames = sort string_ord (map fst tfrees)
  2187 	    val tnames = sort string_ord (map fst tfrees)
  2188 	    val tsyn = mk_syn thy tycname
  2188 	    val tsyn = mk_syn thy tycname
  2189 	    val typ = (tycname,tnames,tsyn)
  2189 	    val typ = (tycname,tnames,tsyn)
  2190 	    val (thy', typedef_info) = TypedefPackage.add_typedef_i false NONE typ c (SOME(rep_name,abs_name)) (rtac th2 1) thy
  2190 	    val (typedef_info, thy') = TypedefPackage.add_typedef_i false NONE typ c (SOME(rep_name,abs_name)) (rtac th2 1) thy
  2191 	    val _ = ImportRecorder.add_typedef NONE typ c (SOME(rep_name,abs_name)) th2
  2191 	    val _ = ImportRecorder.add_typedef NONE typ c (SOME(rep_name,abs_name)) th2
  2192 	    val fulltyname = Sign.intern_type thy' tycname
  2192 	    val fulltyname = Sign.intern_type thy' tycname
  2193 	    val aty = Type (fulltyname, map mk_vartype tnames)
  2193 	    val aty = Type (fulltyname, map mk_vartype tnames)
  2194 	    val abs_ty = tT --> aty
  2194 	    val abs_ty = tT --> aty
  2195 	    val rep_ty = aty --> tT
  2195 	    val rep_ty = aty --> tT