src/HOL/UNITY/FP.thy
author haftmann
Sat, 05 Jul 2014 11:01:53 +0200
changeset 57514 bdc2c6b40bf2
parent 37936 1e4c5015a72e
child 58889 5b7a9633cfa8
permissions -rw-r--r--
prefer ac_simps collections over separate name bindings for add and mult
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37936
1e4c5015a72e updated some headers;
wenzelm
parents: 35416
diff changeset
     1
(*  Title:      HOL/UNITY/FP.thy
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     2
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     3
    Copyright   1998  University of Cambridge
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     4
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     5
From Misra, "A Logic for Concurrent Programming", 1994
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     6
*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     7
13798
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13796
diff changeset
     8
header{*Fixed Point of a Program*}
4c1a53627500 conversion to new-style theories and tidying
paulson
parents: 13796
diff changeset
     9
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 15481
diff changeset
    10
theory FP imports UNITY begin
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    11
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 16417
diff changeset
    12
definition FP_Orig :: "'a program => 'a set" where
5648
fe887910e32e specifications as sets of programs
paulson
parents: 4776
diff changeset
    13
    "FP_Orig F == Union{A. ALL B. F : stable (A Int B)}"
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    14
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 16417
diff changeset
    15
definition FP :: "'a program => 'a set" where
5648
fe887910e32e specifications as sets of programs
paulson
parents: 4776
diff changeset
    16
    "FP F == {s. F : stable {s}}"
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    17
13796
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    18
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
    19
apply (simp only: FP_Orig_def stable_def Int_Union2)
13796
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    20
apply (blast intro: constrains_UN)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    21
done
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    22
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    23
lemma FP_Orig_weakest:
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    24
    "(!!B. F : stable (A Int B)) ==> A <= FP_Orig F"
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 13812
diff changeset
    25
by (simp add: FP_Orig_def stable_def, blast)
13796
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 stable_FP_Int: "F : stable (FP F Int B)"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    28
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
    29
prefer 2 apply blast
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    30
apply (simp (no_asm_simp) add: Int_insert_right)
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 13812
diff changeset
    31
apply (simp add: FP_def stable_def)
13796
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    32
apply (rule constrains_UN)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    33
apply (simp (no_asm))
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    34
done
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    35
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    36
lemma FP_equivalence: "FP F = FP_Orig F"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    37
apply (rule equalityI) 
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    38
 apply (rule stable_FP_Int [THEN FP_Orig_weakest])
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 13812
diff changeset
    39
apply (simp add: FP_Orig_def FP_def, clarify)
13796
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    40
apply (drule_tac x = "{x}" in spec)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    41
apply (simp add: Int_insert_right)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    42
done
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    43
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    44
lemma FP_weakest:
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    45
    "(!!B. F : stable (A Int B)) ==> A <= FP F"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    46
by (simp add: FP_equivalence FP_Orig_weakest)
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 Compl_FP: 
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    49
    "-(FP F) = (UN act: Acts F. -{s. act``{s} <= {s}})"
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    50
by (simp add: FP_def stable_def constrains_def, blast)
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 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
    53
by (simp add: Diff_eq Compl_FP)
19f50fa807ae converting more UNITY theories to new-style
paulson
parents: 5648
diff changeset
    54
13812
91713a1915ee converting HOL/UNITY to use unconditional fairness
paulson
parents: 13798
diff changeset
    55
lemma totalize_FP [simp]: "FP (totalize F) = FP F"
91713a1915ee converting HOL/UNITY to use unconditional fairness
paulson
parents: 13798
diff changeset
    56
by (simp add: FP_def)
91713a1915ee converting HOL/UNITY to use unconditional fairness
paulson
parents: 13798
diff changeset
    57
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    58
end