src/HOL/Tools/Lifting/lifting_util.ML
changeset 67710 cc2db3239932
parent 67709 3c9e0b4709e7
child 67712 350f0579d343
equal deleted inserted replaced
67709:3c9e0b4709e7 67710:cc2db3239932
    28   val same_type_constrs: typ * typ -> bool
    28   val same_type_constrs: typ * typ -> bool
    29   val Targs: typ -> typ list
    29   val Targs: typ -> typ list
    30   val Tname: typ -> string
    30   val Tname: typ -> string
    31   val is_rel_fun: term -> bool
    31   val is_rel_fun: term -> bool
    32   val relation_types: typ -> typ * typ
    32   val relation_types: typ -> typ * typ
    33   val mk_HOL_eq: thm -> thm
       
    34   val safe_HOL_meta_eq: thm -> thm
    33   val safe_HOL_meta_eq: thm -> thm
    35   val map_interrupt: ('a -> 'b option) -> 'a list -> 'b list option
    34   val map_interrupt: ('a -> 'b option) -> 'a list -> 'b list option
    36   val conceal_naming_result: (local_theory -> 'a * local_theory) -> local_theory -> 'a * local_theory
    35   val conceal_naming_result: (local_theory -> 'a * local_theory) -> local_theory -> 'a * local_theory
    37 end
    36 end
    38 
    37 
   120 fun relation_types typ = 
   119 fun relation_types typ = 
   121   case strip_type typ of
   120   case strip_type typ of
   122     ([typ1, typ2], @{typ bool}) => (typ1, typ2)
   121     ([typ1, typ2], @{typ bool}) => (typ1, typ2)
   123     | _ => error "relation_types: not a relation"
   122     | _ => error "relation_types: not a relation"
   124 
   123 
   125 fun mk_HOL_eq r = r RS @{thm meta_eq_to_obj_eq}
   124 fun safe_HOL_meta_eq r = HOLogic.mk_obj_eq r handle Thm.THM _ => r
   126 
       
   127 fun safe_HOL_meta_eq r = mk_HOL_eq r handle Thm.THM _ => r
       
   128 
   125 
   129 fun map_interrupt f l =
   126 fun map_interrupt f l =
   130   let
   127   let
   131     fun map_interrupt' _ [] l = SOME (rev l)
   128     fun map_interrupt' _ [] l = SOME (rev l)
   132      | map_interrupt' f (x::xs) l = (case f x of
   129      | map_interrupt' f (x::xs) l = (case f x of