equal
deleted
inserted
replaced
317 fun add_hol4_type_mapping bthy bconst internal isaconst thy = |
317 fun add_hol4_type_mapping bthy bconst internal isaconst thy = |
318 let |
318 let |
319 val curmaps = HOL4TypeMaps.get thy |
319 val curmaps = HOL4TypeMaps.get thy |
320 val _ = writeln ("Adding tmap " ^ bthy ^ "." ^ bconst ^ " -> " ^ isaconst ^ (if internal then " (*)" else "")) |
320 val _ = writeln ("Adding tmap " ^ bthy ^ "." ^ bconst ^ " -> " ^ isaconst ^ (if internal then " (*)" else "")) |
321 val newmaps = StringPair.update_new ((bthy,bconst),(internal,isaconst)) curmaps |
321 val newmaps = StringPair.update_new ((bthy,bconst),(internal,isaconst)) curmaps |
|
322 (* FIXME avoid handle x *) |
322 handle x => let val (internal, isaconst') = the (StringPair.lookup curmaps (bthy, bconst)) in |
323 handle x => let val (internal, isaconst') = the (StringPair.lookup curmaps (bthy, bconst)) in |
323 warning ("couldn't map type "^bthy^"."^bconst^" to "^isaconst^": already mapped to "^isaconst'); raise x end |
324 warning ("couldn't map type "^bthy^"."^bconst^" to "^isaconst^": already mapped to "^isaconst'); raise x end |
324 val upd_thy = HOL4TypeMaps.put newmaps thy |
325 val upd_thy = HOL4TypeMaps.put newmaps thy |
325 in |
326 in |
326 upd_thy |
327 upd_thy |