2570
|
1 |
(* Title: HOLCF/Dnat.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Franz Regensburger
|
|
4 |
Copyright 1993, 1995 Technische Universitaet Muenchen
|
|
5 |
|
|
6 |
*)
|
|
7 |
|
|
8 |
open Dnat;
|
|
9 |
|
|
10 |
(* ------------------------------------------------------------------------- *)
|
|
11 |
(* expand fixed point properties *)
|
|
12 |
(* ------------------------------------------------------------------------- *)
|
|
13 |
|
|
14 |
bind_thm ("iterator_def2", fix_prover2 Dnat.thy iterator_def
|
|
15 |
"iterator = (LAM n f x. case n of dzero => x | \
|
|
16 |
\ dsucc`m => f`(iterator`m`f`x))");
|
|
17 |
|
|
18 |
(* ------------------------------------------------------------------------- *)
|
|
19 |
(* recursive properties *)
|
|
20 |
(* ------------------------------------------------------------------------- *)
|
|
21 |
|
|
22 |
qed_goal "iterator1" Dnat.thy "iterator`UU`f`x = UU"
|
|
23 |
(fn prems =>
|
|
24 |
[
|
|
25 |
(rtac (iterator_def2 RS ssubst) 1),
|
|
26 |
(simp_tac (HOLCF_ss addsimps dnat.rews) 1)
|
|
27 |
]);
|
|
28 |
|
|
29 |
qed_goal "iterator2" Dnat.thy "iterator`dzero`f`x = x"
|
|
30 |
(fn prems =>
|
|
31 |
[
|
|
32 |
(rtac (iterator_def2 RS ssubst) 1),
|
|
33 |
(simp_tac (HOLCF_ss addsimps dnat.rews) 1)
|
|
34 |
]);
|
|
35 |
|
|
36 |
qed_goal "iterator3" Dnat.thy
|
|
37 |
"n~=UU ==> iterator`(dsucc`n)`f`x = f`(iterator`n`f`x)"
|
|
38 |
(fn prems =>
|
|
39 |
[
|
|
40 |
(cut_facts_tac prems 1),
|
|
41 |
(rtac trans 1),
|
|
42 |
(rtac (iterator_def2 RS ssubst) 1),
|
|
43 |
(asm_simp_tac (HOLCF_ss addsimps dnat.rews) 1),
|
|
44 |
(rtac refl 1)
|
|
45 |
]);
|
|
46 |
|
|
47 |
val iterator_rews =
|
|
48 |
[iterator1, iterator2, iterator3];
|
|
49 |
|
3842
|
50 |
val dnat_flat = prove_goal Dnat.thy "!x y::dnat. x<<y --> x=UU | x=y"
|
3324
|
51 |
(fn _ => [
|
2570
|
52 |
(rtac allI 1),
|
|
53 |
(res_inst_tac [("x","x")] dnat.ind 1),
|
|
54 |
(fast_tac HOL_cs 1),
|
|
55 |
(rtac allI 1),
|
4044
|
56 |
(res_inst_tac [("x","y")] dnat.casedist 1),
|
2570
|
57 |
(fast_tac (HOL_cs addSIs [UU_I]) 1),
|
|
58 |
(Asm_simp_tac 1),
|
4098
|
59 |
(asm_simp_tac (simpset() addsimps dnat.dist_les) 1),
|
2570
|
60 |
(rtac allI 1),
|
4044
|
61 |
(res_inst_tac [("x","y")] dnat.casedist 1),
|
2570
|
62 |
(fast_tac (HOL_cs addSIs [UU_I]) 1),
|
4098
|
63 |
(asm_simp_tac (simpset() addsimps dnat.dist_les) 1),
|
|
64 |
(asm_simp_tac (simpset() addsimps dnat.rews) 1),
|
2570
|
65 |
(strip_tac 1),
|
|
66 |
(subgoal_tac "d<<da" 1),
|
|
67 |
(etac allE 1),
|
|
68 |
(dtac mp 1),
|
|
69 |
(atac 1),
|
|
70 |
(etac disjE 1),
|
|
71 |
(contr_tac 1),
|
|
72 |
(Asm_simp_tac 1),
|
|
73 |
(resolve_tac dnat.inverts 1),
|
|
74 |
(REPEAT (atac 1))]);
|
|
75 |
|