equal
deleted
inserted
replaced
8 val dlo_conv : Proof.context -> cterm -> thm |
8 val dlo_conv : Proof.context -> cterm -> thm |
9 end |
9 end |
10 |
10 |
11 structure LangfordQE :LANGFORD_QE = |
11 structure LangfordQE :LANGFORD_QE = |
12 struct |
12 struct |
13 |
|
14 val dest_set = |
|
15 let |
|
16 fun h acc ct = |
|
17 case term_of ct of |
|
18 Const (@{const_name Set.empty}, _) => acc |
|
19 | Const (@{const_name insert}, _) $ _ $ t => h (Thm.dest_arg1 ct :: acc) (Thm.dest_arg ct) |
|
20 in h [] end; |
|
21 |
13 |
22 fun prove_finite cT u = |
14 fun prove_finite cT u = |
23 let val [th0,th1] = map (instantiate' [SOME cT] []) @{thms "finite.intros"} |
15 let val [th0,th1] = map (instantiate' [SOME cT] []) @{thms "finite.intros"} |
24 fun ins x th = |
16 fun ins x th = |
25 implies_elim (instantiate' [] [(SOME o Thm.dest_arg o Thm.dest_arg) |
17 implies_elim (instantiate' [] [(SOME o Thm.dest_arg o Thm.dest_arg) |
42 fun proveneF S = |
34 fun proveneF S = |
43 let val (a,A) = Thm.dest_comb S |>> Thm.dest_arg |
35 let val (a,A) = Thm.dest_comb S |>> Thm.dest_arg |
44 val cT = ctyp_of_term a |
36 val cT = ctyp_of_term a |
45 val ne = instantiate' [SOME cT] [SOME a, SOME A] |
37 val ne = instantiate' [SOME cT] [SOME a, SOME A] |
46 @{thm insert_not_empty} |
38 @{thm insert_not_empty} |
47 val f = prove_finite cT (dest_set S) |
39 val f = prove_finite cT (HOLogic.dest_set S) |
48 in (ne, f) end |
40 in (ne, f) end |
49 |
41 |
50 val qe = case (term_of L, term_of U) of |
42 val qe = case (term_of L, term_of U) of |
51 (Const (@{const_name Set.empty}, _),_) => |
43 (Const (@{const_name Set.empty}, _),_) => |
52 let |
44 let |