src/HOL/UNITY/FP.ML
author paulson
Tue, 21 Sep 1999 11:11:09 +0200
changeset 7547 a72a551b6d79
parent 5648 fe887910e32e
child 8334 7896bcbd8641
permissions -rw-r--r--
new proof of drop_prog_correct for new definition of project_act
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);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    13
by (rtac ball_constrains_UN 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    14
by (Simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    15
qed "stable_FP_Orig_Int";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    16
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    17
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    18
val prems = goalw thy [FP_Orig_def, stable_def]
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    19
    "(!!B. F : stable (A Int B)) ==> A <= FP_Orig F";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    20
by (blast_tac (claset() addIs prems) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    21
qed "FP_Orig_weakest";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    22
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    23
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    24
Goal "F : stable (FP F Int B)";
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    25
by (subgoal_tac "FP F Int B = (UN x:B. FP F Int {x})" 1);
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    26
by (Blast_tac 2);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    27
by (asm_simp_tac (simpset() addsimps [Int_insert_right]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    28
by (rewrite_goals_tac [FP_def, stable_def]);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    29
by (rtac ball_constrains_UN 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    30
by (Simp_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    31
qed "stable_FP_Int";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    32
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    33
Goal "FP F <= FP_Orig F";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    34
by (rtac (stable_FP_Int RS FP_Orig_weakest) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    35
val lemma1 = result();
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    36
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    37
Goalw [FP_Orig_def, FP_def] "FP_Orig F <= FP F";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    38
by (Clarify_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    39
by (dres_inst_tac [("x", "{x}")] spec 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    40
by (asm_full_simp_tac (simpset() addsimps [Int_insert_right]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    41
val lemma2 = result();
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    42
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    43
Goal "FP F = FP_Orig F";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    44
by (rtac ([lemma1,lemma2] MRS equalityI) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    45
qed "FP_equivalence";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    46
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    47
val [prem] = goal thy
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    48
    "(!!B. F : stable (A Int B)) ==> A <= FP F";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    49
by (simp_tac (simpset() addsimps [FP_equivalence, prem RS FP_Orig_weakest]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    50
qed "FP_weakest";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    51
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    52
Goalw [FP_def, stable_def, constrains_def]
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    53
    "-(FP F) = (UN act: Acts F. -{s. act^^{s} <= {s}})";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    54
by (Blast_tac 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    55
qed "Compl_FP";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    56
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5490
diff changeset
    57
Goal "A - (FP F) = (UN act: Acts F. A - {s. act^^{s} <= {s}})";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    58
by (simp_tac (simpset() addsimps [Diff_eq, Compl_FP]) 1);
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    59
qed "Diff_FP";
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    60