43 'j list * 'i |
43 'j list * 'i |
44 val fold_map9: ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> 'k * 'j) -> |
44 val fold_map9: ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i -> 'j -> 'k * 'j) -> |
45 'a list -> 'b list -> 'c list -> 'd list -> 'e list -> 'f list -> 'g list -> 'h list -> |
45 'a list -> 'b list -> 'c list -> 'd list -> 'e list -> 'f list -> 'g list -> 'h list -> |
46 'i list -> 'j -> 'k list * 'j |
46 'i list -> 'j -> 'k list * 'j |
47 val split_list4: ('a * 'b * 'c * 'd) list -> 'a list * 'b list * 'c list * 'd list |
47 val split_list4: ('a * 'b * 'c * 'd) list -> 'a list * 'b list * 'c list * 'd list |
|
48 val split_list5: ('a * 'b * 'c * 'd * 'e) list -> 'a list * 'b list * 'c list * 'd list * 'e list |
48 val find_indices: ('b * 'a -> bool) -> 'a list -> 'b list -> int list |
49 val find_indices: ('b * 'a -> bool) -> 'a list -> 'b list -> int list |
49 |
50 |
50 val mk_TFreess: int list -> Proof.context -> typ list list * Proof.context |
51 val mk_TFreess: int list -> Proof.context -> typ list list * Proof.context |
51 val mk_Freesss: string -> typ list list list -> Proof.context -> |
52 val mk_Freesss: string -> typ list list list -> Proof.context -> |
52 term list list list * Proof.context |
53 term list list list * Proof.context |
96 val mk_in: term list -> term list -> typ -> term |
97 val mk_in: term list -> term list -> typ -> term |
97 val mk_leq: term -> term -> term |
98 val mk_leq: term -> term -> term |
98 val mk_ordLeq: term -> term -> term |
99 val mk_ordLeq: term -> term -> term |
99 val mk_rel_comp: term * term -> term |
100 val mk_rel_comp: term * term -> term |
100 val mk_rel_compp: term * term -> term |
101 val mk_rel_compp: term * term -> term |
101 val mk_wpull: term -> term -> term -> term -> term -> (term * term) option -> term -> term -> term |
|
102 |
102 |
103 (*parameterized terms*) |
103 (*parameterized terms*) |
104 val mk_nthN: int -> term -> int -> term |
104 val mk_nthN: int -> term -> int -> term |
105 |
105 |
106 (*parameterized thms*) |
106 (*parameterized thms*) |
250 fun split_list4 [] = ([], [], [], []) |
250 fun split_list4 [] = ([], [], [], []) |
251 | split_list4 ((x1, x2, x3, x4) :: xs) = |
251 | split_list4 ((x1, x2, x3, x4) :: xs) = |
252 let val (xs1, xs2, xs3, xs4) = split_list4 xs; |
252 let val (xs1, xs2, xs3, xs4) = split_list4 xs; |
253 in (x1 :: xs1, x2 :: xs2, x3 :: xs3, x4 :: xs4) end; |
253 in (x1 :: xs1, x2 :: xs2, x3 :: xs3, x4 :: xs4) end; |
254 |
254 |
|
255 fun split_list5 [] = ([], [], [], [], []) |
|
256 | split_list5 ((x1, x2, x3, x4, x5) :: xs) = |
|
257 let val (xs1, xs2, xs3, xs4, xs5) = split_list5 xs; |
|
258 in (x1 :: xs1, x2 :: xs2, x3 :: xs3, x4 :: xs4, x5 :: xs5) end; |
|
259 |
255 val parse_binding_colon = parse_binding --| @{keyword ":"}; |
260 val parse_binding_colon = parse_binding --| @{keyword ":"}; |
256 val parse_opt_binding_colon = Scan.optional parse_binding_colon Binding.empty; |
261 val parse_opt_binding_colon = Scan.optional parse_binding_colon Binding.empty; |
257 |
262 |
258 val parse_type_arg_constrained = |
263 val parse_type_arg_constrained = |
259 Parse.type_ident -- Scan.option (@{keyword "::"} |-- Parse.!!! Parse.sort); |
264 Parse.type_ident -- Scan.option (@{keyword "::"} |-- Parse.!!! Parse.sort); |
456 AT --> AT --> HOLogic.boolT) $ (set $ Free ("x", T)) $ A end; |
461 AT --> AT --> HOLogic.boolT) $ (set $ Free ("x", T)) $ A end; |
457 in |
462 in |
458 if length sets > 0 |
463 if length sets > 0 |
459 then HOLogic.mk_Collect ("x", T, foldr1 (HOLogic.mk_conj) (map2 in_single sets As)) |
464 then HOLogic.mk_Collect ("x", T, foldr1 (HOLogic.mk_conj) (map2 in_single sets As)) |
460 else HOLogic.mk_UNIV T |
465 else HOLogic.mk_UNIV T |
461 end; |
|
462 |
|
463 fun mk_wpull A B1 B2 f1 f2 pseudo p1 p2 = |
|
464 let |
|
465 val AT = fastype_of A; |
|
466 val BT1 = fastype_of B1; |
|
467 val BT2 = fastype_of B2; |
|
468 val FT1 = fastype_of f1; |
|
469 val FT2 = fastype_of f2; |
|
470 val PT1 = fastype_of p1; |
|
471 val PT2 = fastype_of p2; |
|
472 val T1 = HOLogic.dest_setT BT1; |
|
473 val T2 = HOLogic.dest_setT BT2; |
|
474 val domP = domain_type PT1; |
|
475 val ranF = range_type FT1; |
|
476 val _ = if is_some pseudo orelse |
|
477 (HOLogic.dest_setT AT = domP andalso |
|
478 domain_type FT1 = T1 andalso |
|
479 domain_type FT2 = T2 andalso |
|
480 domain_type PT2 = domP andalso |
|
481 range_type PT1 = T1 andalso |
|
482 range_type PT2 = T2 andalso |
|
483 range_type FT2 = ranF) |
|
484 then () else raise TYPE ("mk_wpull", [BT1, BT2, FT1, FT2, PT1, PT2], []); |
|
485 in |
|
486 (case pseudo of |
|
487 NONE => Const (@{const_name wpull}, |
|
488 AT --> BT1 --> BT2 --> FT1 --> FT2 --> PT1 --> PT2 --> HOLogic.boolT) $ |
|
489 A $ B1 $ B2 $ f1 $ f2 $ p1 $ p2 |
|
490 | SOME (e1, e2) => Const (@{const_name wppull}, |
|
491 AT --> BT1 --> BT2 --> FT1 --> FT2 --> fastype_of e1 --> fastype_of e2 --> |
|
492 PT1 --> PT2 --> HOLogic.boolT) $ |
|
493 A $ B1 $ B2 $ f1 $ f2 $ e1 $ e2 $ p1 $ p2) |
|
494 end; |
466 end; |
495 |
467 |
496 fun mk_leq t1 t2 = |
468 fun mk_leq t1 t2 = |
497 Const (@{const_name less_eq}, (fastype_of t1) --> (fastype_of t2) --> HOLogic.boolT) $ t1 $ t2; |
469 Const (@{const_name less_eq}, (fastype_of t1) --> (fastype_of t2) --> HOLogic.boolT) $ t1 $ t2; |
498 |
470 |