src/HOL/UNITY/FP.ML
author wenzelm
Fri, 09 Nov 2001 00:09:47 +0100
changeset 12114 a8e860c86252
parent 10834 a7897aebbffc
permissions -rw-r--r--
eliminated old "symbols" syntax, use "xsymbols" instead;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/FP
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     2
    ID:         $Id$
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     5
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     6
Fixed Point of a Program
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     7
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     8
From Misra, "A Logic for Concurrent Programming", 1994
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     9
*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    10
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    11
Goalw [FP_Orig_def, stable_def] "F : stable (FP_Orig F Int B)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    12
by (stac Int_Union2 1);
8334
7896bcbd8641 Added Tanja's Detects and Reachability theories. Also
paulson
parents: 5648
diff changeset
    13
by (blast_tac (claset() addIs [constrains_UN]) 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    14
qed "stable_FP_Orig_Int";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    15
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    16
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    17
val prems = goalw thy [FP_Orig_def, stable_def]
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    18
    "(!!B. F : stable (A Int B)) ==> A <= FP_Orig F";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    19
by (blast_tac (claset() addIs prems) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    20
qed "FP_Orig_weakest";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    21
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    22
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    23
Goal "F : stable (FP F Int B)";
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    24
by (subgoal_tac "FP F Int B = (UN x:B. FP F Int {x})" 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    25
by (Blast_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    26
by (asm_simp_tac (simpset() addsimps [Int_insert_right]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    27
by (rewrite_goals_tac [FP_def, stable_def]);
8334
7896bcbd8641 Added Tanja's Detects and Reachability theories. Also
paulson
parents: 5648
diff changeset
    28
by (rtac constrains_UN 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    29
by (Simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    30
qed "stable_FP_Int";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    31
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    32
Goal "FP F <= FP_Orig F";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    33
by (rtac (stable_FP_Int RS FP_Orig_weakest) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    34
val lemma1 = result();
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    35
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    36
Goalw [FP_Orig_def, FP_def] "FP_Orig F <= FP F";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    37
by (Clarify_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    38
by (dres_inst_tac [("x", "{x}")] spec 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    39
by (asm_full_simp_tac (simpset() addsimps [Int_insert_right]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    40
val lemma2 = result();
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    41
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    42
Goal "FP F = FP_Orig F";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    43
by (rtac ([lemma1,lemma2] MRS equalityI) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    44
qed "FP_equivalence";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    45
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    46
val [prem] = goal thy
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    47
    "(!!B. F : stable (A Int B)) ==> A <= FP F";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    48
by (simp_tac (simpset() addsimps [FP_equivalence, prem RS FP_Orig_weakest]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    49
qed "FP_weakest";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    50
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    51
Goalw [FP_def, stable_def, constrains_def]
10834
a7897aebbffc *** empty log message ***
nipkow
parents: 10797
diff changeset
    52
    "-(FP F) = (UN act: Acts F. -{s. act``{s} <= {s}})";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    53
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    54
qed "Compl_FP";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    55
10834
a7897aebbffc *** empty log message ***
nipkow
parents: 10797
diff changeset
    56
Goal "A - (FP F) = (UN act: Acts F. A - {s. act``{s} <= {s}})";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    57
by (simp_tac (simpset() addsimps [Diff_eq, Compl_FP]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    58
qed "Diff_FP";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    59