src/HOL/TLA/Inc/Inc.thy
author wenzelm
Wed, 11 Oct 2017 20:46:38 +0200
changeset 66842 7ded55dd2a55
parent 66453 cc19f7ca2ed6
child 69597 ff784d5a5bfb
permissions -rw-r--r--
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41589
bbd861837ebc tuned headers;
wenzelm
parents: 26342
diff changeset
     1
(*  Title:      HOL/TLA/Inc/Inc.thy
bbd861837ebc tuned headers;
wenzelm
parents: 26342
diff changeset
     2
    Author:     Stephan Merz, University of Munich
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     3
*)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     4
60592
c9bd1d902f04 isabelle update_cartouches;
wenzelm
parents: 60591
diff changeset
     5
section \<open>Lamport's "increment" example\<close>
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
     6
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
     7
theory Inc
66453
cc19f7ca2ed6 session-qualified theory imports: isabelle imports -U -i -d '~~/src/Benchmarks' -a;
wenzelm
parents: 60592
diff changeset
     8
imports "HOL-TLA.TLA"
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
     9
begin
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    10
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    11
(* program counter as an enumeration type *)
58310
91ea607a34d8 updated news
blanchet
parents: 58249
diff changeset
    12
datatype pcount = a | b | g
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    13
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    14
axiomatization
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    15
  (* program variables *)
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    16
  x :: "nat stfun" and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    17
  y :: "nat stfun" and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    18
  sem :: "nat stfun" and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    19
  pc1 :: "pcount stfun" and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    20
  pc2 :: "pcount stfun" and
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    21
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    22
  (* names of actions and predicates *)
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    23
  M1 :: action and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    24
  M2 :: action and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    25
  N1 :: action and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    26
  N2 :: action and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    27
  alpha1 :: action and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    28
  alpha2 :: action and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    29
  beta1 :: action and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    30
  beta2 :: action and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    31
  gamma1 :: action and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    32
  gamma2 :: action and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    33
  InitPhi :: stpred and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    34
  InitPsi :: stpred and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    35
  PsiInv :: stpred and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    36
  PsiInv1 :: stpred and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    37
  PsiInv2 :: stpred and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    38
  PsiInv3 :: stpred and
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    39
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    40
  (* temporal formulas *)
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    41
  Phi :: temporal and
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    42
  Psi :: temporal
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    43
where
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    44
  (* the "base" variables, required to compute enabledness predicates *)
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    45
  Inc_base:      "basevars (x, y, sem, pc1, pc2)" and
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    46
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    47
  (* definitions for high-level program *)
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    48
  InitPhi_def:   "InitPhi == PRED x = # 0 \<and> y = # 0" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    49
  M1_def:        "M1      == ACT  x$ = Suc<$x> \<and> y$ = $y" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    50
  M2_def:        "M2      == ACT  y$ = Suc<$y> \<and> x$ = $x" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    51
  Phi_def:       "Phi     == TEMP Init InitPhi \<and> \<box>[M1 \<or> M2]_(x,y)
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    52
                                 \<and> WF(M1)_(x,y) \<and> WF(M2)_(x,y)" and
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    53
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    54
  (* definitions for low-level program *)
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    55
  InitPsi_def:   "InitPsi == PRED pc1 = #a \<and> pc2 = #a
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    56
                                 \<and> x = # 0 \<and> y = # 0 \<and> sem = # 1" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    57
  alpha1_def:    "alpha1  == ACT  $pc1 = #a \<and> pc1$ = #b \<and> $sem = Suc<sem$>
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    58
                                 \<and> unchanged(x,y,pc2)" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    59
  alpha2_def:    "alpha2  == ACT  $pc2 = #a \<and> pc2$ = #b \<and> $sem = Suc<sem$>
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    60
                                 \<and> unchanged(x,y,pc1)" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    61
  beta1_def:     "beta1   == ACT  $pc1 = #b \<and> pc1$ = #g \<and> x$ = Suc<$x>
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    62
                                 \<and> unchanged(y,sem,pc2)" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    63
  beta2_def:     "beta2   == ACT  $pc2 = #b \<and> pc2$ = #g \<and> y$ = Suc<$y>
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    64
                                 \<and> unchanged(x,sem,pc1)" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    65
  gamma1_def:    "gamma1  == ACT  $pc1 = #g \<and> pc1$ = #a \<and> sem$ = Suc<$sem>
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    66
                                 \<and> unchanged(x,y,pc2)" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    67
  gamma2_def:    "gamma2  == ACT  $pc2 = #g \<and> pc2$ = #a \<and> sem$ = Suc<$sem>
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    68
                                 \<and> unchanged(x,y,pc1)" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    69
  N1_def:        "N1      == ACT  (alpha1 \<or> beta1 \<or> gamma1)" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    70
  N2_def:        "N2      == ACT  (alpha2 \<or> beta2 \<or> gamma2)" and
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    71
  Psi_def:       "Psi     == TEMP Init InitPsi
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    72
                               \<and> \<box>[N1 \<or> N2]_(x,y,sem,pc1,pc2)
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    73
                               \<and> SF(N1)_(x,y,sem,pc1,pc2)
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    74
                               \<and> SF(N2)_(x,y,sem,pc1,pc2)" and
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    75
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    76
  PsiInv1_def:  "PsiInv1  == PRED sem = # 1 \<and> pc1 = #a \<and> pc2 = #a" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    77
  PsiInv2_def:  "PsiInv2  == PRED sem = # 0 \<and> pc1 = #a \<and> (pc2 = #b \<or> pc2 = #g)" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    78
  PsiInv3_def:  "PsiInv3  == PRED sem = # 0 \<and> pc2 = #a \<and> (pc1 = #b \<or> pc1 = #g)" and
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    79
  PsiInv_def:   "PsiInv   == PRED (PsiInv1 \<or> PsiInv2 \<or> PsiInv3)"
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    80
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    81
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    82
lemmas PsiInv_defs = PsiInv_def PsiInv1_def PsiInv2_def PsiInv3_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    83
lemmas Psi_defs = Psi_def InitPsi_def N1_def N2_def alpha1_def alpha2_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    84
  beta1_def beta2_def gamma1_def gamma2_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    85
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    86
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    87
(*** Invariant proof for Psi: "manual" proof proves individual lemmas ***)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    88
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
    89
lemma PsiInv_Init: "\<turnstile> InitPsi \<longrightarrow> PsiInv"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    90
  by (auto simp: InitPsi_def PsiInv_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    91
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    92
lemma PsiInv_alpha1: "\<turnstile> alpha1 \<and> $PsiInv \<longrightarrow> PsiInv$"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    93
  by (auto simp: alpha1_def PsiInv_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    94
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    95
lemma PsiInv_alpha2: "\<turnstile> alpha2 \<and> $PsiInv \<longrightarrow> PsiInv$"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    96
  by (auto simp: alpha2_def PsiInv_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    97
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
    98
lemma PsiInv_beta1: "\<turnstile> beta1 \<and> $PsiInv \<longrightarrow> PsiInv$"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    99
  by (auto simp: beta1_def PsiInv_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   100
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   101
lemma PsiInv_beta2: "\<turnstile> beta2 \<and> $PsiInv \<longrightarrow> PsiInv$"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   102
  by (auto simp: beta2_def PsiInv_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   103
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   104
lemma PsiInv_gamma1: "\<turnstile> gamma1 \<and> $PsiInv \<longrightarrow> PsiInv$"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   105
  by (auto simp: gamma1_def PsiInv_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   106
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   107
lemma PsiInv_gamma2: "\<turnstile> gamma2 \<and> $PsiInv \<longrightarrow> PsiInv$"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   108
  by (auto simp: gamma2_def PsiInv_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   109
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   110
lemma PsiInv_stutter: "\<turnstile> unchanged (x,y,sem,pc1,pc2) \<and> $PsiInv \<longrightarrow> PsiInv$"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   111
  by (auto simp: PsiInv_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   112
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   113
lemma PsiInv: "\<turnstile> Psi \<longrightarrow> \<box>PsiInv"
42769
053b4b487085 proper method_setup;
wenzelm
parents: 41589
diff changeset
   114
  apply (invariant simp: Psi_def)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   115
   apply (force simp: PsiInv_Init [try_rewrite] Init_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   116
  apply (auto intro: PsiInv_alpha1 [try_rewrite] PsiInv_alpha2 [try_rewrite]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   117
    PsiInv_beta1 [try_rewrite] PsiInv_beta2 [try_rewrite] PsiInv_gamma1 [try_rewrite]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   118
    PsiInv_gamma2 [try_rewrite] PsiInv_stutter [try_rewrite]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   119
    simp add: square_def N1_def N2_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   120
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   121
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   122
(* Automatic proof works too, but it make take a while on a slow machine.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   123
   More realistic examples require user guidance anyway.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   124
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   125
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   126
lemma "\<turnstile> Psi \<longrightarrow> \<box>PsiInv"
42769
053b4b487085 proper method_setup;
wenzelm
parents: 41589
diff changeset
   127
  by (auto_invariant simp: PsiInv_defs Psi_defs)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   128
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   129
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   130
(**** Step simulation ****)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   131
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   132
lemma Init_sim: "\<turnstile> Psi \<longrightarrow> Init InitPhi"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   133
  by (auto simp: InitPhi_def Psi_def InitPsi_def Init_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   134
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   135
lemma Step_sim: "\<turnstile> Psi \<longrightarrow> \<box>[M1 \<or> M2]_(x,y)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   136
  by (auto simp: square_def M1_def M2_def Psi_defs elim!: STL4E [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   137
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   138
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   139
(**** Proof of fairness ****)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   140
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   141
(*
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   142
   The goal is to prove Fair_M1 far below, which asserts
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   143
         \<turnstile> Psi \<longrightarrow> WF(M1)_(x,y)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   144
   (the other fairness condition is symmetrical).
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   145
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   146
   The strategy is to use WF2 (with beta1 as the helpful action). Proving its
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   147
   temporal premise needs two auxiliary lemmas:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   148
   1. Stuck_at_b: control can only proceed at pc1 = b by executing beta1
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   149
   2. N1_live: the first component will eventually reach b
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   150
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   151
   Lemma 1 is easy, lemma 2 relies on the invariant, the strong fairness
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   152
   of the semaphore, and needs auxiliary lemmas that ensure that the second
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   153
   component will eventually release the semaphore. Most of the proofs of
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   154
   the auxiliary lemmas are very similar.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   155
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   156
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   157
lemma Stuck_at_b: "\<turnstile> \<box>[(N1 \<or> N2) \<and> \<not> beta1]_(x,y,sem,pc1,pc2) \<longrightarrow> stable(pc1 = #b)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   158
  by (auto elim!: Stable squareE simp: Psi_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   159
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   160
lemma N1_enabled_at_g: "\<turnstile> pc1 = #g \<longrightarrow> Enabled (<N1>_(x,y,sem,pc1,pc2))"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   161
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   162
  apply (rule_tac F = gamma1 in enabled_mono)
42785
15ec9b3c14cc proper method_setup "enabled";
wenzelm
parents: 42769
diff changeset
   163
   apply (enabled Inc_base)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   164
  apply (force simp: gamma1_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   165
  apply (force simp: angle_def gamma1_def N1_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   166
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   167
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   168
lemma g1_leadsto_a1:
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   169
  "\<turnstile> \<box>[(N1 \<or> N2) \<and> \<not>beta1]_(x,y,sem,pc1,pc2) \<and> SF(N1)_(x,y,sem,pc1,pc2) \<and> \<box>#True  
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   170
    \<longrightarrow> (pc1 = #g \<leadsto> pc1 = #a)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   171
  apply (rule SF1)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   172
    apply (tactic
60592
c9bd1d902f04 isabelle update_cartouches;
wenzelm
parents: 60591
diff changeset
   173
      \<open>action_simp_tac (@{context} addsimps @{thms Psi_defs}) [] [@{thm squareE}] 1\<close>)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   174
   apply (tactic
60592
c9bd1d902f04 isabelle update_cartouches;
wenzelm
parents: 60591
diff changeset
   175
      \<open>action_simp_tac (@{context} addsimps @{thm angle_def} :: @{thms Psi_defs}) [] [] 1\<close>)
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   176
  (* reduce \<turnstile> \<box>A \<longrightarrow> \<diamond>Enabled B  to  \<turnstile> A \<longrightarrow> Enabled B *)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   177
  apply (auto intro!: InitDmd_gen [temp_use] N1_enabled_at_g [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   178
    dest!: STL2_gen [temp_use] simp: Init_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   179
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   180
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   181
(* symmetrical for N2, and similar for beta2 *)
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   182
lemma N2_enabled_at_g: "\<turnstile> pc2 = #g \<longrightarrow> Enabled (<N2>_(x,y,sem,pc1,pc2))"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   183
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   184
  apply (rule_tac F = gamma2 in enabled_mono)
42785
15ec9b3c14cc proper method_setup "enabled";
wenzelm
parents: 42769
diff changeset
   185
  apply (enabled Inc_base)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   186
   apply (force simp: gamma2_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   187
  apply (force simp: angle_def gamma2_def N2_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   188
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   189
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   190
lemma g2_leadsto_a2:
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   191
  "\<turnstile> \<box>[(N1 \<or> N2) \<and> \<not>beta1]_(x,y,sem,pc1,pc2) \<and> SF(N2)_(x,y,sem,pc1,pc2) \<and> \<box>#True  
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   192
    \<longrightarrow> (pc2 = #g \<leadsto> pc2 = #a)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   193
  apply (rule SF1)
60592
c9bd1d902f04 isabelle update_cartouches;
wenzelm
parents: 60591
diff changeset
   194
  apply (tactic \<open>action_simp_tac (@{context} addsimps @{thms Psi_defs}) [] [@{thm squareE}] 1\<close>)
c9bd1d902f04 isabelle update_cartouches;
wenzelm
parents: 60591
diff changeset
   195
  apply (tactic \<open>action_simp_tac (@{context} addsimps @{thm angle_def} :: @{thms Psi_defs})
c9bd1d902f04 isabelle update_cartouches;
wenzelm
parents: 60591
diff changeset
   196
    [] [] 1\<close>)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   197
  apply (auto intro!: InitDmd_gen [temp_use] N2_enabled_at_g [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   198
    dest!: STL2_gen [temp_use] simp add: Init_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   199
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   200
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   201
lemma N2_enabled_at_b: "\<turnstile> pc2 = #b \<longrightarrow> Enabled (<N2>_(x,y,sem,pc1,pc2))"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   202
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   203
  apply (rule_tac F = beta2 in enabled_mono)
42785
15ec9b3c14cc proper method_setup "enabled";
wenzelm
parents: 42769
diff changeset
   204
   apply (enabled Inc_base)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   205
   apply (force simp: beta2_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   206
  apply (force simp: angle_def beta2_def N2_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   207
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   208
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   209
lemma b2_leadsto_g2:
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   210
  "\<turnstile> \<box>[(N1 \<or> N2) \<and> \<not>beta1]_(x,y,sem,pc1,pc2) \<and> SF(N2)_(x,y,sem,pc1,pc2) \<and> \<box>#True  
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   211
    \<longrightarrow> (pc2 = #b \<leadsto> pc2 = #g)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   212
  apply (rule SF1)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   213
    apply (tactic
60592
c9bd1d902f04 isabelle update_cartouches;
wenzelm
parents: 60591
diff changeset
   214
      \<open>action_simp_tac (@{context} addsimps @{thms Psi_defs}) [] [@{thm squareE}] 1\<close>)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   215
   apply (tactic
60592
c9bd1d902f04 isabelle update_cartouches;
wenzelm
parents: 60591
diff changeset
   216
     \<open>action_simp_tac (@{context} addsimps @{thm angle_def} :: @{thms Psi_defs}) [] [] 1\<close>)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   217
  apply (auto intro!: InitDmd_gen [temp_use] N2_enabled_at_b [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   218
    dest!: STL2_gen [temp_use] simp: Init_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   219
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   220
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   221
(* Combine above lemmas: the second component will eventually reach pc2 = a *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   222
lemma N2_leadsto_a:
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   223
  "\<turnstile> \<box>[(N1 \<or> N2) \<and> \<not>beta1]_(x,y,sem,pc1,pc2) \<and> SF(N2)_(x,y,sem,pc1,pc2) \<and> \<box>#True  
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   224
    \<longrightarrow> (pc2 = #a \<or> pc2 = #b \<or> pc2 = #g \<leadsto> pc2 = #a)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   225
  apply (auto intro!: LatticeDisjunctionIntro [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   226
    apply (rule LatticeReflexivity [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   227
   apply (rule LatticeTransitivity [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   228
  apply (auto intro!: b2_leadsto_g2 [temp_use] g2_leadsto_a2 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   229
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   230
60587
0318b43ee95c more symbols;
wenzelm
parents: 58889
diff changeset
   231
(* Get rid of disjunction on the left-hand side of \<leadsto> above. *)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   232
lemma N2_live:
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   233
  "\<turnstile> \<box>[(N1 \<or> N2) \<and> \<not>beta1]_(x,y,sem,pc1,pc2) \<and> SF(N2)_(x,y,sem,pc1,pc2)  
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   234
    \<longrightarrow> \<diamond>(pc2 = #a)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   235
  apply (auto simp: Init_defs intro!: N2_leadsto_a [temp_use, THEN [2] leadsto_init [temp_use]])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   236
  apply (case_tac "pc2 (st1 sigma)")
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   237
    apply auto
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   238
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   239
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   240
(* Now prove that the first component will eventually reach pc1 = b from pc1 = a *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   241
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   242
lemma N1_enabled_at_both_a:
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   243
  "\<turnstile> pc2 = #a \<and> (PsiInv \<and> pc1 = #a) \<longrightarrow> Enabled (<N1>_(x,y,sem,pc1,pc2))"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   244
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   245
  apply (rule_tac F = alpha1 in enabled_mono)
42785
15ec9b3c14cc proper method_setup "enabled";
wenzelm
parents: 42769
diff changeset
   246
  apply (enabled Inc_base)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   247
   apply (force simp: alpha1_def PsiInv_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   248
  apply (force simp: angle_def alpha1_def N1_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   249
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   250
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   251
lemma a1_leadsto_b1:
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   252
  "\<turnstile> \<box>($PsiInv \<and> [(N1 \<or> N2) \<and> \<not>beta1]_(x,y,sem,pc1,pc2))       
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   253
         \<and> SF(N1)_(x,y,sem,pc1,pc2) \<and> \<box> SF(N2)_(x,y,sem,pc1,pc2)   
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   254
         \<longrightarrow> (pc1 = #a \<leadsto> pc1 = #b)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   255
  apply (rule SF1)
60592
c9bd1d902f04 isabelle update_cartouches;
wenzelm
parents: 60591
diff changeset
   256
  apply (tactic \<open>action_simp_tac (@{context} addsimps @{thms Psi_defs}) [] [@{thm squareE}] 1\<close>)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   257
  apply (tactic
60592
c9bd1d902f04 isabelle update_cartouches;
wenzelm
parents: 60591
diff changeset
   258
    \<open>action_simp_tac (@{context} addsimps (@{thm angle_def} :: @{thms Psi_defs})) [] [] 1\<close>)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   259
  apply (clarsimp intro!: N1_enabled_at_both_a [THEN DmdImpl [temp_use]])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   260
  apply (auto intro!: BoxDmd2_simple [temp_use] N2_live [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   261
    simp: split_box_conj more_temp_simps)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   262
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   263
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   264
(* Combine the leadsto properties for N1: it will arrive at pc1 = b *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   265
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   266
lemma N1_leadsto_b: "\<turnstile> \<box>($PsiInv \<and> [(N1 \<or> N2) \<and> \<not>beta1]_(x,y,sem,pc1,pc2))              
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   267
         \<and> SF(N1)_(x,y,sem,pc1,pc2) \<and> \<box> SF(N2)_(x,y,sem,pc1,pc2)   
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   268
         \<longrightarrow> (pc1 = #b \<or> pc1 = #g \<or> pc1 = #a \<leadsto> pc1 = #b)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   269
  apply (auto intro!: LatticeDisjunctionIntro [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   270
    apply (rule LatticeReflexivity [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   271
   apply (rule LatticeTransitivity [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   272
    apply (auto intro!: a1_leadsto_b1 [temp_use] g1_leadsto_a1 [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   273
      simp: split_box_conj)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   274
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   275
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   276
lemma N1_live: "\<turnstile> \<box>($PsiInv \<and> [(N1 \<or> N2) \<and> \<not>beta1]_(x,y,sem,pc1,pc2))              
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   277
         \<and> SF(N1)_(x,y,sem,pc1,pc2) \<and> \<box> SF(N2)_(x,y,sem,pc1,pc2)   
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   278
         \<longrightarrow> \<diamond>(pc1 = #b)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   279
  apply (auto simp: Init_defs intro!: N1_leadsto_b [temp_use, THEN [2] leadsto_init [temp_use]])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   280
  apply (case_tac "pc1 (st1 sigma)")
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   281
    apply auto
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   282
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   283
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   284
lemma N1_enabled_at_b: "\<turnstile> pc1 = #b \<longrightarrow> Enabled (<N1>_(x,y,sem,pc1,pc2))"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   285
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   286
  apply (rule_tac F = beta1 in enabled_mono)
42785
15ec9b3c14cc proper method_setup "enabled";
wenzelm
parents: 42769
diff changeset
   287
   apply (enabled Inc_base)
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   288
   apply (force simp: beta1_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   289
  apply (force simp: angle_def beta1_def N1_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   290
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   291
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   292
(* Now assemble the bits and pieces to prove that Psi is fair. *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   293
60591
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   294
lemma Fair_M1_lemma: "\<turnstile> \<box>($PsiInv \<and> [(N1 \<or> N2)]_(x,y,sem,pc1,pc2))    
e0b77517f9a9 more symbols;
wenzelm
parents: 60588
diff changeset
   295
         \<and> SF(N1)_(x,y,sem,pc1,pc2) \<and> \<box>SF(N2)_(x,y,sem,pc1,pc2)   
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   296
         \<longrightarrow> SF(M1)_(x,y)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   297
  apply (rule_tac B = beta1 and P = "PRED pc1 = #b" in SF2)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   298
   (* action premises *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   299
     apply (force simp: angle_def M1_def beta1_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   300
  apply (force simp: angle_def Psi_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   301
  apply (force elim!: N1_enabled_at_b [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   302
    (* temporal premise: use previous lemmas and simple TL *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   303
  apply (force intro!: DmdStable [temp_use] N1_live [temp_use] Stuck_at_b [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   304
    elim: STL4E [temp_use] simp: square_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   305
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   306
60588
750c533459b1 more symbols;
wenzelm
parents: 60587
diff changeset
   307
lemma Fair_M1: "\<turnstile> Psi \<longrightarrow> WF(M1)_(x,y)"
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   308
  by (auto intro!: SFImplWF [temp_use] Fair_M1_lemma [temp_use] PsiInv [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   309
    simp: Psi_def split_box_conj [temp_use] more_temp_simps)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   310
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   311
end