src/HOL/BNF/Tools/bnf_util.ML
changeset 51757 7babcb61aa5c
parent 49835 31f32ec4d766
child 51758 55963309557b
equal deleted inserted replaced
51756:b0bae7bd236c 51757:7babcb61aa5c
    41   val fold_map7: ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i * 'h) ->
    41   val fold_map7: ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i * 'h) ->
    42     'a list -> 'b list -> 'c list -> 'd list -> 'e list -> 'f list -> 'g list -> 'h -> 'i list * 'h
    42     'a list -> 'b list -> 'c list -> 'd list -> 'e list -> 'f list -> 'g list -> 'h -> 'i list * 'h
    43   val splice: 'a list -> 'a list -> 'a list
    43   val splice: 'a list -> 'a list -> 'a list
    44   val transpose: 'a list list -> 'a list list
    44   val transpose: 'a list list -> 'a list list
    45   val seq_conds: (bool -> 'a -> 'b) -> int -> int -> 'a list -> 'b list
    45   val seq_conds: (bool -> 'a -> 'b) -> int -> int -> 'a list -> 'b list
       
    46   val pad_list: 'a -> int -> 'a list -> 'a list
    46 
    47 
    47   val mk_fresh_names: Proof.context -> int -> string -> string list * Proof.context
    48   val mk_fresh_names: Proof.context -> int -> string -> string list * Proof.context
    48   val mk_TFrees: int -> Proof.context -> typ list * Proof.context
    49   val mk_TFrees: int -> Proof.context -> typ list * Proof.context
    49   val mk_TFreess: int list -> Proof.context -> typ list list * Proof.context
    50   val mk_TFreess: int list -> Proof.context -> typ list list * Proof.context
    50   val mk_TFrees': sort list -> Proof.context -> typ list * Proof.context
    51   val mk_TFrees': sort list -> Proof.context -> typ list * Proof.context
   614   else
   615   else
   615     let val (negs, pos) = split_last (take k xs) in
   616     let val (negs, pos) = split_last (take k xs) in
   616       map (f false) negs @ [f true pos]
   617       map (f false) negs @ [f true pos]
   617     end;
   618     end;
   618 
   619 
       
   620 fun pad_list x n xs = xs @ replicate (n - length xs) x;
       
   621 
   619 fun mk_unabs_def n = funpow n (fn thm => thm RS fun_cong);
   622 fun mk_unabs_def n = funpow n (fn thm => thm RS fun_cong);
   620 
   623 
   621 fun is_triv_implies thm =
   624 fun is_triv_implies thm =
   622   op aconv (Logic.dest_implies (Thm.prop_of thm))
   625   op aconv (Logic.dest_implies (Thm.prop_of thm))
   623   handle TERM _ => false;
   626   handle TERM _ => false;