src/HOL/TLA/Inc/Inc.thy
author wenzelm
Sun, 02 Nov 2014 18:21:45 +0100
changeset 58889 5b7a9633cfa8
parent 58310 91ea607a34d8
child 60587 0318b43ee95c
permissions -rw-r--r--
modernized header uniformly as section;
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
58889
5b7a9633cfa8 modernized header uniformly as section;
wenzelm
parents: 58310
diff changeset
     5
section {* Lamport's "increment" example *}
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
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
     8
imports TLA
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 *)
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    48
  InitPhi_def:   "InitPhi == PRED x = # 0 & y = # 0" and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    49
  M1_def:        "M1      == ACT  x$ = Suc<$x> & y$ = $y" and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    50
  M2_def:        "M2      == ACT  y$ = Suc<$y> & x$ = $x" and
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    51
  Phi_def:       "Phi     == TEMP Init InitPhi & [][M1 | M2]_(x,y)
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    52
                                 & WF(M1)_(x,y) & 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 *)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    55
  InitPsi_def:   "InitPsi == PRED pc1 = #a & pc2 = #a
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    56
                                 & x = # 0 & y = # 0 & sem = # 1" and
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    57
  alpha1_def:    "alpha1  == ACT  $pc1 = #a & pc1$ = #b & $sem = Suc<sem$>
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    58
                                 & unchanged(x,y,pc2)" and
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    59
  alpha2_def:    "alpha2  == ACT  $pc2 = #a & pc2$ = #b & $sem = Suc<sem$>
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    60
                                 & unchanged(x,y,pc1)" and
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    61
  beta1_def:     "beta1   == ACT  $pc1 = #b & pc1$ = #g & x$ = Suc<$x>
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    62
                                 & unchanged(y,sem,pc2)" and
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    63
  beta2_def:     "beta2   == ACT  $pc2 = #b & pc2$ = #g & y$ = Suc<$y>
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    64
                                 & unchanged(x,sem,pc1)" and
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    65
  gamma1_def:    "gamma1  == ACT  $pc1 = #g & pc1$ = #a & sem$ = Suc<$sem>
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    66
                                 & unchanged(x,y,pc2)" and
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    67
  gamma2_def:    "gamma2  == ACT  $pc2 = #g & pc2$ = #a & sem$ = Suc<$sem>
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    68
                                 & unchanged(x,y,pc1)" and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    69
  N1_def:        "N1      == ACT  (alpha1 | beta1 | gamma1)" and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    70
  N2_def:        "N2      == ACT  (alpha2 | beta2 | gamma2)" and
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    71
  Psi_def:       "Psi     == TEMP Init InitPsi
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    72
                               & [][N1 | N2]_(x,y,sem,pc1,pc2)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    73
                               & SF(N1)_(x,y,sem,pc1,pc2)
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    74
                               & SF(N2)_(x,y,sem,pc1,pc2)" and
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    75
47968
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    76
  PsiInv1_def:  "PsiInv1  == PRED sem = # 1 & pc1 = #a & pc2 = #a" and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    77
  PsiInv2_def:  "PsiInv2  == PRED sem = # 0 & pc1 = #a & (pc2 = #b | pc2 = #g)" and
3119ad2b5ad3 eliminated old 'axioms';
wenzelm
parents: 42785
diff changeset
    78
  PsiInv3_def:  "PsiInv3  == PRED sem = # 0 & pc2 = #a & (pc1 = #b | pc1 = #g)" and
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    79
  PsiInv_def:   "PsiInv   == PRED (PsiInv1 | PsiInv2 | PsiInv3)"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    89
lemma PsiInv_Init: "|- InitPsi --> PsiInv"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    92
lemma PsiInv_alpha1: "|- alpha1 & $PsiInv --> PsiInv$"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    95
lemma PsiInv_alpha2: "|- alpha2 & $PsiInv --> PsiInv$"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    98
lemma PsiInv_beta1: "|- beta1 & $PsiInv --> PsiInv$"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   101
lemma PsiInv_beta2: "|- beta2 & $PsiInv --> PsiInv$"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   104
lemma PsiInv_gamma1: "|- gamma1 & $PsiInv --> PsiInv$"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   107
lemma PsiInv_gamma2: "|- gamma2 & $PsiInv --> PsiInv$"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   110
lemma PsiInv_stutter: "|- unchanged (x,y,sem,pc1,pc2) & $PsiInv --> PsiInv$"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   113
lemma PsiInv: "|- Psi --> []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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   126
lemma "|- Psi --> []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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   132
lemma Init_sim: "|- Psi --> Init InitPhi"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   135
lemma Step_sim: "|- Psi --> [][M1 | M2]_(x,y)"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   143
         |- Psi --> WF(M1)_(x,y)
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   157
lemma Stuck_at_b: "|- [][(N1 | N2) & ~ beta1]_(x,y,sem,pc1,pc2) --> stable(pc1 = #b)"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   160
lemma N1_enabled_at_g: "|- pc1 = #g --> Enabled (<N1>_(x,y,sem,pc1,pc2))"
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:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   169
  "|- [][(N1 | N2) & ~beta1]_(x,y,sem,pc1,pc2) & SF(N1)_(x,y,sem,pc1,pc2) & []#True  
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   170
    --> (pc1 = #g ~> pc1 = #a)"
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
51717
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 47968
diff changeset
   173
      {* action_simp_tac (@{context} addsimps @{thms Psi_defs}) [] [@{thm squareE}] 1 *})
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   174
   apply (tactic
51717
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 47968
diff changeset
   175
      {* action_simp_tac (@{context} addsimps @{thm angle_def} :: @{thms Psi_defs}) [] [] 1 *})
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   176
  (* reduce |- []A --> <>Enabled B  to  |- A --> Enabled B *)
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 *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   182
lemma N2_enabled_at_g: "|- pc2 = #g --> Enabled (<N2>_(x,y,sem,pc1,pc2))"
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:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   191
  "|- [][(N1 | N2) & ~beta1]_(x,y,sem,pc1,pc2) & SF(N2)_(x,y,sem,pc1,pc2) & []#True  
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   192
    --> (pc2 = #g ~> pc2 = #a)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   193
  apply (rule SF1)
51717
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 47968
diff changeset
   194
  apply (tactic {* action_simp_tac (@{context} addsimps @{thms Psi_defs}) [] [@{thm squareE}] 1 *})
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 47968
diff changeset
   195
  apply (tactic {* action_simp_tac (@{context} addsimps @{thm angle_def} :: @{thms Psi_defs})
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   196
    [] [] 1 *})
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   201
lemma N2_enabled_at_b: "|- pc2 = #b --> Enabled (<N2>_(x,y,sem,pc1,pc2))"
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:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   210
  "|- [][(N1 | N2) & ~beta1]_(x,y,sem,pc1,pc2) & SF(N2)_(x,y,sem,pc1,pc2) & []#True  
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   211
    --> (pc2 = #b ~> pc2 = #g)"
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
51717
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 47968
diff changeset
   214
      {* action_simp_tac (@{context} addsimps @{thms Psi_defs}) [] [@{thm squareE}] 1 *})
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   215
   apply (tactic
51717
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 47968
diff changeset
   216
     {* action_simp_tac (@{context} addsimps @{thm angle_def} :: @{thms Psi_defs}) [] [] 1 *})
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:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   223
  "|- [][(N1 | N2) & ~beta1]_(x,y,sem,pc1,pc2) & SF(N2)_(x,y,sem,pc1,pc2) & []#True  
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   224
    --> (pc2 = #a | pc2 = #b | pc2 = #g ~> pc2 = #a)"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   231
(* Get rid of disjunction on the left-hand side of ~> above. *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   232
lemma N2_live:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   233
  "|- [][(N1 | N2) & ~beta1]_(x,y,sem,pc1,pc2) & SF(N2)_(x,y,sem,pc1,pc2)  
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   234
    --> <>(pc2 = #a)"
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:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   243
  "|- pc2 = #a & (PsiInv & pc1 = #a) --> Enabled (<N1>_(x,y,sem,pc1,pc2))"
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:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   252
  "|- []($PsiInv & [(N1 | N2) & ~beta1]_(x,y,sem,pc1,pc2))       
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   253
         & SF(N1)_(x,y,sem,pc1,pc2) & [] SF(N2)_(x,y,sem,pc1,pc2)   
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   254
         --> (pc1 = #a ~> pc1 = #b)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   255
  apply (rule SF1)
51717
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 47968
diff changeset
   256
  apply (tactic {* action_simp_tac (@{context} addsimps @{thms Psi_defs}) [] [@{thm squareE}] 1 *})
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   257
  apply (tactic
51717
9e7d1c139569 simplifier uses proper Proof.context instead of historic type simpset;
wenzelm
parents: 47968
diff changeset
   258
    {* action_simp_tac (@{context} addsimps (@{thm angle_def} :: @{thms Psi_defs})) [] [] 1 *})
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   266
lemma N1_leadsto_b: "|- []($PsiInv & [(N1 | N2) & ~beta1]_(x,y,sem,pc1,pc2))              
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   267
         & SF(N1)_(x,y,sem,pc1,pc2) & [] SF(N2)_(x,y,sem,pc1,pc2)   
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   268
         --> (pc1 = #b | pc1 = #g | pc1 = #a ~> pc1 = #b)"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   276
lemma N1_live: "|- []($PsiInv & [(N1 | N2) & ~beta1]_(x,y,sem,pc1,pc2))              
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   277
         & SF(N1)_(x,y,sem,pc1,pc2) & [] SF(N2)_(x,y,sem,pc1,pc2)   
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   278
         --> <>(pc1 = #b)"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   284
lemma N1_enabled_at_b: "|- pc1 = #b --> Enabled (<N1>_(x,y,sem,pc1,pc2))"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   294
lemma Fair_M1_lemma: "|- []($PsiInv & [(N1 | N2)]_(x,y,sem,pc1,pc2))    
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   295
         & SF(N1)_(x,y,sem,pc1,pc2) & []SF(N2)_(x,y,sem,pc1,pc2)   
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   296
         --> SF(M1)_(x,y)"
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
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   307
lemma Fair_M1: "|- Psi --> WF(M1)_(x,y)"
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