src/HOL/BNF/Tools/bnf_util.ML
changeset 51903 126f8d11f873
parent 51894 7c43b8df0f5d
child 52079 291bb1f4af29
equal deleted inserted replaced
51902:1ab4214a08f9 51903:126f8d11f873
    44     'a list -> 'b list -> 'c list -> 'd list -> 'e list -> 'f list -> 'g list -> 'h list -> 'i ->
    44     'a list -> 'b list -> 'c list -> 'd list -> 'e list -> 'f list -> 'g list -> 'h list -> 'i ->
    45     'j list * 'i
    45     'j list * 'i
    46   val fold_map9: ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> 'k * 'j) ->
    46   val fold_map9: ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> 'k * 'j) ->
    47     'a list -> 'b list -> 'c list -> 'd list -> 'e list -> 'f list -> 'g list -> 'h list ->
    47     'a list -> 'b list -> 'c list -> 'd list -> 'e list -> 'f list -> 'g list -> 'h list ->
    48     'i list -> 'j -> 'k list * 'j
    48     'i list -> 'j -> 'k list * 'j
       
    49   val split_list4: ('a * 'b * 'c * 'd) list -> 'a list * 'b list * 'c list * 'd list
    49   val splice: 'a list -> 'a list -> 'a list
    50   val splice: 'a list -> 'a list -> 'a list
    50   val transpose: 'a list list -> 'a list list
    51   val transpose: 'a list list -> 'a list list
    51   val unsort: ('a * 'b -> bool) -> 'b list -> 'c list -> 'a list -> 'c list
    52   val unsort: ('a * 'b -> bool) -> 'b list -> 'c list -> 'a list -> 'c list
    52   val seq_conds: (bool -> 'a -> 'b) -> int -> int -> 'a list -> 'b list
    53   val seq_conds: (bool -> 'a -> 'b) -> int -> int -> 'a list -> 'b list
    53   val pad_list: 'a -> int -> 'a list -> 'a list
    54   val pad_list: 'a -> int -> 'a list -> 'a list
   303     let
   304     let
   304       val (x, acc') = f x1 x2 x3 x4 x5 x6 x7 x8 x9 acc;
   305       val (x, acc') = f x1 x2 x3 x4 x5 x6 x7 x8 x9 acc;
   305       val (xs, acc'') = fold_map9 f x1s x2s x3s x4s x5s x6s x7s x8s x9s acc';
   306       val (xs, acc'') = fold_map9 f x1s x2s x3s x4s x5s x6s x7s x8s x9s acc';
   306     in (x :: xs, acc'') end
   307     in (x :: xs, acc'') end
   307   | fold_map9 _ _ _ _ _ _ _ _ _ _ _ = raise ListPair.UnequalLengths;
   308   | fold_map9 _ _ _ _ _ _ _ _ _ _ _ = raise ListPair.UnequalLengths;
       
   309 
       
   310 fun split_list4 [] = ([], [], [], [])
       
   311   | split_list4 ((x1, x2, x3, x4) :: xs) =
       
   312     let val (xs1, xs2, xs3, xs4) = split_list4 xs;
       
   313     in (x1 :: xs1, x2 :: xs2, x3 :: xs3, x4 :: xs4) end;
   308 
   314 
   309 (*stolen from ~~/src/HOL/Tools/SMT/smt_utils.ML*)
   315 (*stolen from ~~/src/HOL/Tools/SMT/smt_utils.ML*)
   310 fun certify ctxt = Thm.cterm_of (Proof_Context.theory_of ctxt);
   316 fun certify ctxt = Thm.cterm_of (Proof_Context.theory_of ctxt);
   311 fun certifyT ctxt = Thm.ctyp_of (Proof_Context.theory_of ctxt);
   317 fun certifyT ctxt = Thm.ctyp_of (Proof_Context.theory_of ctxt);
   312 
   318