equal
deleted
inserted
replaced
444 | find_typeSubs (t1 $ t2) = (case find_typeSubs t1 of SOME x => SOME x | NONE => find_typeSubs t2) |
444 | find_typeSubs (t1 $ t2) = (case find_typeSubs t1 of SOME x => SOME x | NONE => find_typeSubs t2) |
445 val typeSubs = (case find_typeSubs t of |
445 val typeSubs = (case find_typeSubs t of |
446 SOME x => x |
446 SOME x => x |
447 | NONE => raise Type.TYPE_MATCH (* no match found - perhaps due to sort constraints *)) |
447 | NONE => raise Type.TYPE_MATCH (* no match found - perhaps due to sort constraints *)) |
448 in |
448 in |
449 map_term_types |
449 map_types |
450 (map_type_tvar |
450 (map_type_tvar |
451 (fn v => |
451 (fn v => |
452 case Type.lookup (typeSubs, v) of |
452 case Type.lookup (typeSubs, v) of |
453 NONE => |
453 NONE => |
454 (* schematic type variable not instantiated *) |
454 (* schematic type variable not instantiated *) |
459 end |
459 end |
460 (* applies a type substitution 'typeSubs' for all type variables in a *) |
460 (* applies a type substitution 'typeSubs' for all type variables in a *) |
461 (* term 't' *) |
461 (* term 't' *) |
462 (* (Term.sort * Term.typ) Term.Vartab.table -> Term.term -> Term.term *) |
462 (* (Term.sort * Term.typ) Term.Vartab.table -> Term.term -> Term.term *) |
463 fun monomorphic_term typeSubs t = |
463 fun monomorphic_term typeSubs t = |
464 map_term_types (map_type_tvar |
464 map_types (map_type_tvar |
465 (fn v => |
465 (fn v => |
466 case Type.lookup (typeSubs, v) of |
466 case Type.lookup (typeSubs, v) of |
467 NONE => |
467 NONE => |
468 (* schematic type variable not instantiated *) |
468 (* schematic type variable not instantiated *) |
469 error "" |
469 error "" |