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";
|
|
11 |
by(Asm_simp_tac 1);
|
|
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))";
|
|
18 |
by(Asm_simp_tac 1);
|
|
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)";
|
|
25 |
bd is_dfaD 1;
|
|
26 |
ba 1;
|
|
27 |
by(Asm_full_simp_tac 1);
|
|
28 |
by(blast_tac (claset() addDs [wti_is_fix_stepD]) 1);
|
|
29 |
qed "dfa_iff_welltyping";
|
|
30 |
|
|
31 |
Goal
|
|
32 |
"x:M ==> replicate n x : listsn n M";
|
|
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);
|
|
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))";
|
|
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);
|
|
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)";
|
|
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 |
bd dfa_iff_welltyping 1;
|
|
58 |
ba 1;
|
|
59 |
be 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 |
br iffI 1;
|
|
63 |
by(Clarify_tac 1);
|
|
64 |
br bexI 1;
|
|
65 |
br conjI 1;
|
|
66 |
ba 2;
|
|
67 |
ba 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 |
br exI 1;
|
|
74 |
br conjI 1;
|
|
75 |
br conjI 2;
|
|
76 |
ba 3;
|
|
77 |
by(Blast_tac 1);
|
|
78 |
by(Force_tac 1);
|
|
79 |
qed "dfa_iff_welltyping0";
|