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