src/HOL/UNITY/FP.thy
author paulson
Thu, 30 Jan 2003 10:35:56 +0100
changeset 13796 19f50fa807ae
parent 5648 fe887910e32e
child 13798 4c1a53627500
permissions -rw-r--r--
converting more UNITY theories to new-style
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
13796
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    11
theory FP = UNITY:
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    12
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    13
constdefs
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    14
5648
fe887910e32e specifications as sets of programs
paulson
parents: 4776
diff changeset
    15
  FP_Orig :: "'a program => 'a set"
fe887910e32e specifications as sets of programs
paulson
parents: 4776
diff changeset
    16
    "FP_Orig F == Union{A. ALL B. F : stable (A Int B)}"
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    17
5648
fe887910e32e specifications as sets of programs
paulson
parents: 4776
diff changeset
    18
  FP :: "'a program => 'a set"
fe887910e32e specifications as sets of programs
paulson
parents: 4776
diff changeset
    19
    "FP F == {s. F : stable {s}}"
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    20
13796
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    21
lemma stable_FP_Orig_Int: "F : stable (FP_Orig F Int B)"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    22
apply (unfold FP_Orig_def stable_def)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    23
apply (subst Int_Union2)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    24
apply (blast intro: constrains_UN)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    25
done
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    26
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    27
lemma FP_Orig_weakest:
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    28
    "(!!B. F : stable (A Int B)) ==> A <= FP_Orig F"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    29
by (unfold FP_Orig_def stable_def, blast)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    30
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    31
lemma stable_FP_Int: "F : stable (FP F Int B)"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    32
apply (subgoal_tac "FP F Int B = (UN x:B. FP F Int {x}) ")
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    33
prefer 2 apply blast
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    34
apply (simp (no_asm_simp) add: Int_insert_right)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    35
apply (unfold FP_def stable_def)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    36
apply (rule constrains_UN)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    37
apply (simp (no_asm))
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    38
done
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    39
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    40
lemma FP_equivalence: "FP F = FP_Orig F"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    41
apply (rule equalityI) 
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    42
 apply (rule stable_FP_Int [THEN FP_Orig_weakest])
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    43
apply (unfold FP_Orig_def FP_def, clarify)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    44
apply (drule_tac x = "{x}" in spec)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    45
apply (simp add: Int_insert_right)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    46
done
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    47
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    48
lemma FP_weakest:
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    49
    "(!!B. F : stable (A Int B)) ==> A <= FP F"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    50
by (simp add: FP_equivalence FP_Orig_weakest)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    51
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    52
lemma Compl_FP: 
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    53
    "-(FP F) = (UN act: Acts F. -{s. act``{s} <= {s}})"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    54
by (simp add: FP_def stable_def constrains_def, blast)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    55
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    56
lemma Diff_FP: "A - (FP F) = (UN act: Acts F. A - {s. act``{s} <= {s}})"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    57
by (simp add: Diff_eq Compl_FP)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    58
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    59
end