src/HOL/UNITY/FP.thy
author haftmann
Fri, 17 Jun 2005 16:12:49 +0200
changeset 16417 9bc16273c2d4
parent 15481 fc075ae929e4
child 35416 d8d7d1b785af
permissions -rw-r--r--
migrated theory headers to new format
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
From Misra, "A Logic for Concurrent Programming", 1994
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     7
*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     8
13798
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13796
diff changeset
     9
header{*Fixed Point of a Program*}
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13796
diff changeset
    10
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 15481
diff changeset
    11
theory FP imports UNITY begin
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)"
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 13812
diff changeset
    22
apply (simp only: FP_Orig_def stable_def Int_Union2)
13796
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    23
apply (blast intro: constrains_UN)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    24
done
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    25
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    26
lemma FP_Orig_weakest:
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    27
    "(!!B. F : stable (A Int B)) ==> A <= FP_Orig F"
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 13812
diff changeset
    28
by (simp add: FP_Orig_def stable_def, blast)
13796
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    29
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    30
lemma stable_FP_Int: "F : stable (FP F Int B)"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    31
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
    32
prefer 2 apply blast
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    33
apply (simp (no_asm_simp) add: Int_insert_right)
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 13812
diff changeset
    34
apply (simp add: FP_def stable_def)
13796
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    35
apply (rule constrains_UN)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    36
apply (simp (no_asm))
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    37
done
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    38
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    39
lemma FP_equivalence: "FP F = FP_Orig F"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    40
apply (rule equalityI) 
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    41
 apply (rule stable_FP_Int [THEN FP_Orig_weakest])
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 13812
diff changeset
    42
apply (simp add: FP_Orig_def FP_def, clarify)
13796
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    43
apply (drule_tac x = "{x}" in spec)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    44
apply (simp add: Int_insert_right)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    45
done
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    46
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    47
lemma FP_weakest:
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    48
    "(!!B. F : stable (A Int B)) ==> A <= FP F"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    49
by (simp add: FP_equivalence FP_Orig_weakest)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    50
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    51
lemma Compl_FP: 
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    52
    "-(FP F) = (UN act: Acts F. -{s. act``{s} <= {s}})"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    53
by (simp add: FP_def stable_def constrains_def, blast)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    54
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    55
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
    56
by (simp add: Diff_eq Compl_FP)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    57
13812
91713a1915ee converting HOL/UNITY to use unconditional fairness
paulson
parents: 13798
diff changeset
    58
lemma totalize_FP [simp]: "FP (totalize F) = FP F"
91713a1915ee converting HOL/UNITY to use unconditional fairness
paulson
parents: 13798
diff changeset
    59
by (simp add: FP_def)
91713a1915ee converting HOL/UNITY to use unconditional fairness
paulson
parents: 13798
diff changeset
    60
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    61
end