src/HOL/UNITY/FP.ML
author oheimb
Mon, 21 Sep 1998 23:25:27 +0200
changeset 5526 e7617b57a3e6
parent 5490 85855f65d0c6
child 5648 fe887910e32e
permissions -rw-r--r--
*** empty log message ***
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
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    11
Goalw [FP_Orig_def, stable_def] "stable Acts (FP_Orig Acts 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]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    19
    "(!!B. stable Acts (A Int B)) ==> A <= FP_Orig Acts";
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
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    24
Goal "stable Acts (FP Acts Int B)";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    25
by (subgoal_tac "FP Acts Int B = (UN x:B. FP Acts Int {x})" 1);
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
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    33
Goal "FP Acts <= FP_Orig Acts";
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
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    37
Goalw [FP_Orig_def, FP_def] "FP_Orig Acts <= FP Acts";
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
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    43
Goal "FP Acts = FP_Orig Acts";
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
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    48
    "(!!B. stable Acts (A Int B)) ==> A <= FP Acts";
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]
5490
85855f65d0c6 From Compl(A) to -A
paulson
parents: 5232
diff changeset
    53
    "-(FP Acts) = (UN act:Acts. -{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
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4776
diff changeset
    57
Goal "A - (FP Acts) = (UN act:Acts. 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