equal
deleted
inserted
replaced
14 |
14 |
15 Goalw [Valid_def] "p <= {s. (f s):q} ==> Valid p (Basic f) q"; |
15 Goalw [Valid_def] "p <= {s. (f s):q} ==> Valid p (Basic f) q"; |
16 by (Auto_tac); |
16 by (Auto_tac); |
17 qed "BasicRule"; |
17 qed "BasicRule"; |
18 |
18 |
19 Goalw [Valid_def] "[| Valid P c1 Q; Valid Q c2 R |] ==> Valid P (c1;c2) R"; |
19 Goalw [Valid_def] "Valid P c1 Q ==> Valid Q c2 R ==> Valid P (c1;c2) R"; |
20 by (Asm_simp_tac 1); |
20 by (Asm_simp_tac 1); |
21 by (Blast_tac 1); |
21 by (Blast_tac 1); |
22 qed "SeqRule"; |
22 qed "SeqRule"; |
23 |
23 |
24 Goalw [Valid_def] |
24 Goalw [Valid_def] |
25 "[| p <= {s. (s:b --> s:w) & (s~:b --> s:w')}; \ |
25 "p <= {s. (s:b --> s:w) & (s~:b --> s:w')} \ |
26 \ Valid w c1 q; Valid w' c2 q |] \ |
26 \ ==> Valid w c1 q ==> Valid w' c2 q \ |
27 \ ==> Valid p (Cond b c1 c2) q"; |
27 \ ==> Valid p (Cond b c1 c2) q"; |
28 by (Asm_simp_tac 1); |
28 by (Asm_simp_tac 1); |
29 by (Blast_tac 1); |
29 by (Blast_tac 1); |
30 qed "CondRule"; |
30 qed "CondRule"; |
31 |
31 |
36 by (Simp_tac 1); |
36 by (Simp_tac 1); |
37 by (Blast_tac 1); |
37 by (Blast_tac 1); |
38 val lemma = result() RS spec RS spec RS mp RS mp; |
38 val lemma = result() RS spec RS spec RS mp RS mp; |
39 |
39 |
40 Goalw [Valid_def] |
40 Goalw [Valid_def] |
41 "[| p <= i; Valid (i Int b) c i; i Int (-b) <= q |] \ |
41 "p <= i ==> Valid (i Int b) c i ==> i Int (-b) <= q \ |
42 \ ==> Valid p (While b i c) q"; |
42 \ ==> Valid p (While b j c) q"; |
43 by (Asm_simp_tac 1); |
43 by (Asm_simp_tac 1); |
44 by (Clarify_tac 1); |
44 by (Clarify_tac 1); |
45 by (dtac lemma 1); |
45 by (dtac lemma 1); |
46 by (assume_tac 2); |
46 by (assume_tac 2); |
47 by (Blast_tac 1); |
47 by (Blast_tac 1); |
48 by (Blast_tac 1); |
48 by (Blast_tac 1); |
|
49 qed "WhileRule'"; |
|
50 |
|
51 Goal |
|
52 "p <= i ==> Valid (i Int b) c i ==> i Int (-b) <= q \ |
|
53 \ ==> Valid p (While b i c) q"; |
|
54 by (rtac WhileRule' 1); |
|
55 by (ALLGOALS assume_tac); |
49 qed "WhileRule"; |
56 qed "WhileRule"; |
50 |
57 |
51 (*** The tactics ***) |
58 (*** The tactics ***) |
52 |
59 |
53 (*****************************************************************************) |
60 (*****************************************************************************) |