11479
|
1 |
(* Title: HOL/UNITY/FP.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Sidi O Ehmety, Computer Laboratory
|
|
4 |
Copyright 2001 University of Cambridge
|
|
5 |
|
|
6 |
Fixed Point of a Program
|
|
7 |
|
|
8 |
From Misra, "A Logic for Concurrent Programming", 1994
|
|
9 |
|
|
10 |
Theory ported form HOL.
|
|
11 |
*)
|
|
12 |
|
12195
|
13 |
Goalw [FP_Orig_def] "FP_Orig(F)<=state";
|
11479
|
14 |
by (Blast_tac 1);
|
|
15 |
qed "FP_Orig_type";
|
|
16 |
|
12195
|
17 |
Goalw [st_set_def] "st_set(FP_Orig(F))";
|
|
18 |
by (rtac FP_Orig_type 1);
|
|
19 |
qed "st_set_FP_Orig";
|
|
20 |
AddIffs [st_set_FP_Orig];
|
11479
|
21 |
|
12195
|
22 |
Goalw [FP_def] "FP(F)<=state";
|
11479
|
23 |
by (Blast_tac 1);
|
|
24 |
qed "FP_type";
|
|
25 |
|
12195
|
26 |
Goalw [st_set_def] "st_set(FP(F))";
|
|
27 |
by (rtac FP_type 1);
|
|
28 |
qed "st_set_FP";
|
|
29 |
AddIffs [st_set_FP];
|
11479
|
30 |
|
|
31 |
Goal "Union(B) Int A = (UN C:B. C Int A)";
|
|
32 |
by (Blast_tac 1);
|
|
33 |
qed "Int_Union2";
|
|
34 |
|
12195
|
35 |
Goalw [FP_Orig_def, stable_def] "F:program ==> F:stable(FP_Orig(F) Int B)";
|
11479
|
36 |
by (stac Int_Union2 1);
|
|
37 |
by (blast_tac (claset() addIs [constrains_UN]) 1);
|
|
38 |
qed "stable_FP_Orig_Int";
|
|
39 |
|
12195
|
40 |
Goalw [FP_Orig_def, stable_def, st_set_def]
|
|
41 |
"[| ALL B. F: stable (A Int B); st_set(A) |] ==> A <= FP_Orig(F)";
|
11479
|
42 |
by (Blast_tac 1);
|
12195
|
43 |
qed "FP_Orig_weakest2";
|
|
44 |
|
|
45 |
bind_thm("FP_Orig_weakest", allI RS FP_Orig_weakest2);
|
11479
|
46 |
|
|
47 |
Goal "A Int cons(a, B) = \
|
|
48 |
\ (if a : A then cons(a, cons(a, (A Int B))) else A Int B)";
|
|
49 |
by Auto_tac;
|
|
50 |
qed "Int_cons_right";
|
|
51 |
|
12195
|
52 |
Goal "F:program ==> F : stable (FP(F) Int B)";
|
11479
|
53 |
by (subgoal_tac "FP(F) Int B = (UN x:B. FP(F) Int {x})" 1);
|
|
54 |
by (Blast_tac 2);
|
|
55 |
by (asm_simp_tac (simpset() addsimps [Int_cons_right]) 1);
|
|
56 |
by (rewrite_goals_tac [FP_def, stable_def]);
|
|
57 |
by (rtac constrains_UN 1);
|
|
58 |
by (auto_tac (claset(), simpset() addsimps [cons_absorb]));
|
|
59 |
qed "stable_FP_Int";
|
|
60 |
|
|
61 |
Goal "F:program ==> FP(F) <= FP_Orig(F)";
|
|
62 |
by (rtac (stable_FP_Int RS FP_Orig_weakest) 1);
|
|
63 |
by Auto_tac;
|
12195
|
64 |
qed "FP_subset_FP_Orig";
|
11479
|
65 |
|
12195
|
66 |
Goalw [FP_Orig_def, FP_def] "F:program ==> FP_Orig(F) <= FP(F)";
|
11479
|
67 |
by (Clarify_tac 1);
|
12195
|
68 |
by (dres_inst_tac [("x", "{x}")] spec 1);
|
11479
|
69 |
by (asm_full_simp_tac (simpset() addsimps [Int_cons_right]) 1);
|
12484
|
70 |
by (ftac stableD2 1);
|
12195
|
71 |
by (auto_tac (claset(), simpset() addsimps [cons_absorb, st_set_def]));
|
|
72 |
qed "FP_Orig_subset_FP";
|
11479
|
73 |
|
|
74 |
|
|
75 |
Goal "F:program ==> FP(F) = FP_Orig(F)";
|
12195
|
76 |
by (rtac ([FP_subset_FP_Orig,FP_Orig_subset_FP] MRS equalityI) 1);
|
11479
|
77 |
by (ALLGOALS(assume_tac));
|
|
78 |
qed "FP_equivalence";
|
|
79 |
|
|
80 |
|
12195
|
81 |
Goal "[| ALL B. F : stable(A Int B); F:program; st_set(A) |] ==> A <= FP(F)";
|
11479
|
82 |
by (asm_simp_tac (simpset() addsimps [FP_equivalence, FP_Orig_weakest]) 1);
|
12195
|
83 |
qed "FP_weakest2";
|
|
84 |
bind_thm("FP_weakest", allI RS FP_weakest2);
|
11479
|
85 |
|
12195
|
86 |
Goalw [FP_def, stable_def, constrains_def, st_set_def]
|
|
87 |
"[| F:program; st_set(A) |] ==> A-FP(F) = (UN act:Acts(F). A-{s:state. act``{s} <= {s}})";
|
11479
|
88 |
by (Blast_tac 1);
|
|
89 |
qed "Diff_FP";
|
|
90 |
|