7626
|
1 |
(* Title: HOL/BCV/DFAandWTI.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Tobias Nipkow
|
|
4 |
Copyright 1999 TUM
|
|
5 |
*)
|
|
6 |
|
|
7 |
Goalw [wti_is_fix_step_def]
|
|
8 |
"[| wti_is_fix_step step wti succs n L; \
|
|
9 |
\ sos : listsn n (option L); p < n |] ==> \
|
|
10 |
\ wti p sos = stable step succs p sos";
|
7961
|
11 |
by (Asm_simp_tac 1);
|
7626
|
12 |
qed "wti_is_fix_stepD";
|
|
13 |
|
|
14 |
Goalw [is_dfa_def]
|
|
15 |
"[| is_dfa dfa step succs n L; sos : listsn n (option L) |] ==> \
|
|
16 |
\ dfa sos = (? tos : listsn (size sos) (option L). \
|
|
17 |
\ sos <= tos & (!p < size tos. stable step succs p tos))";
|
7961
|
18 |
by (Asm_simp_tac 1);
|
7626
|
19 |
qed "is_dfaD";
|
|
20 |
|
|
21 |
Goalw [welltyping_def]
|
|
22 |
"[| wti_is_fix_step step wti succs n L; is_dfa dfa step succs n L; \
|
|
23 |
\ sos : listsn n (option L) |] ==> \
|
|
24 |
\ dfa sos = (? tos : listsn n (option L). sos <= tos & welltyping wti tos)";
|
7961
|
25 |
by (dtac is_dfaD 1);
|
|
26 |
by (assume_tac 1);
|
|
27 |
by (Asm_full_simp_tac 1);
|
|
28 |
by (blast_tac (claset() addDs [wti_is_fix_stepD]) 1);
|
7626
|
29 |
qed "dfa_iff_welltyping";
|
|
30 |
|
|
31 |
Goal
|
|
32 |
"x:M ==> replicate n x : listsn n M";
|
7961
|
33 |
by (induct_tac "n" 1);
|
|
34 |
by (Simp_tac 1);
|
|
35 |
by (asm_simp_tac (simpset() addsimps [in_listsn_Suc_iff,Bex_def]) 1);
|
7626
|
36 |
qed "replicate_in_listsn";
|
|
37 |
Addsimps [replicate_in_listsn];
|
|
38 |
|
|
39 |
Goal "!ys. replicate n x <= ys = (length ys = n & (!y:set ys. x <= y))";
|
7961
|
40 |
by (induct_tac "n" 1);
|
|
41 |
by (Force_tac 1);
|
|
42 |
by (asm_full_simp_tac (simpset() addsimps [Cons_le_iff,length_Suc_conv]) 1);
|
|
43 |
by (Force_tac 1);
|
7626
|
44 |
qed_spec_mp "replicate_le_conv";
|
|
45 |
AddIffs [replicate_le_conv];
|
|
46 |
|
|
47 |
Goal
|
|
48 |
"[| wti_is_fix_step step wti succs n L; is_dfa dfa step succs n L; \
|
|
49 |
\ 0 < n; init : (option L) |] ==> \
|
|
50 |
\ dfa (init # replicate (n-1) None) = \
|
|
51 |
\ (? tos : listsn n (option L). init <= tos!0 & welltyping wti tos)";
|
7961
|
52 |
by (subgoal_tac "? m. n = m+1" 1);
|
|
53 |
by (res_inst_tac [("x","n-1")] exI 2);
|
|
54 |
by (arith_tac 2);
|
|
55 |
by (Clarify_tac 1);
|
|
56 |
by (Asm_full_simp_tac 1);
|
|
57 |
by (dtac dfa_iff_welltyping 1);
|
|
58 |
by (assume_tac 1);
|
|
59 |
by (etac trans 2);
|
|
60 |
by (asm_simp_tac (simpset() addsimps [in_listsn_Suc_iff,Bex_def]) 1);
|
|
61 |
by (asm_full_simp_tac (simpset() addsimps [Cons_le_iff]) 1);
|
|
62 |
by (rtac iffI 1);
|
|
63 |
by (Clarify_tac 1);
|
|
64 |
by (rtac bexI 1);
|
|
65 |
by (rtac conjI 1);
|
|
66 |
by (assume_tac 2);
|
|
67 |
by (assume_tac 2);
|
|
68 |
by (Asm_simp_tac 1);
|
|
69 |
by (Clarify_tac 1);
|
|
70 |
by (asm_full_simp_tac (simpset() addsimps [in_listsn_Suc_iff,Bex_def]) 1);
|
|
71 |
by (Clarify_tac 1);
|
|
72 |
by (asm_full_simp_tac (simpset() addsimps []) 1);
|
|
73 |
by (rtac exI 1);
|
|
74 |
by (rtac conjI 1);
|
|
75 |
by (rtac conjI 2);
|
|
76 |
by (assume_tac 3);
|
|
77 |
by (Blast_tac 1);
|
|
78 |
by (Force_tac 1);
|
7626
|
79 |
qed "dfa_iff_welltyping0";
|