src/HOL/TLA/Memory/MemoryImplementation.thy
author wenzelm
Thu, 23 Jul 2009 18:44:09 +0200
changeset 32149 ef59550a55d3
parent 27208 5fe899199f85
child 36866 426d5781bb25
permissions -rw-r--r--
renamed simpset_of to global_simpset_of, and local_simpset_of to simpset_of -- same for claset and clasimpset;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     1
(*
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     2
    File:        MemoryImplementation.thy
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
     3
    ID:          $Id$
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     4
    Author:      Stephan Merz
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     5
    Copyright:   1997 University of Munich
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
     6
*)
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     7
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
     8
header {* RPC-Memory example: Memory implementation *}
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     9
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    10
theory MemoryImplementation
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    11
imports Memory RPC MemClerk
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    12
begin
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    13
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    14
datatype histState = histA | histB
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    15
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    16
types
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    17
  histType  = "(PrIds => histState) stfun"     (* the type of the history variable *)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    18
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    19
consts
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    20
  (* the specification *)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    21
     (* channel (external) *)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    22
  memCh         :: "memChType"
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    23
     (* internal variables *)
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    24
  mm            :: "memType"
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    25
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    26
  (* the state variables of the implementation *)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    27
     (* channels *)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    28
  (* same interface channel memCh *)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    29
  crCh          :: "rpcSndChType"
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    30
  rmCh          :: "rpcRcvChType"
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    31
     (* internal variables *)
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    32
  (* identity refinement mapping for mm -- simply reused *)
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    33
  rst           :: "rpcStType"
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    34
  cst           :: "mClkStType"
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    35
  ires          :: "resType"
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    36
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    37
constdefs
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    38
  (* auxiliary predicates *)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    39
  MVOKBARF      :: "Vals => bool"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    40
     "MVOKBARF v == (v : MemVal) | (v = OK) | (v = BadArg) | (v = RPCFailure)"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    41
  MVOKBA        :: "Vals => bool"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    42
     "MVOKBA v   == (v : MemVal) | (v = OK) | (v = BadArg)"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    43
  MVNROKBA      :: "Vals => bool"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    44
     "MVNROKBA v == (v : MemVal) | (v = NotAResult) | (v = OK) | (v = BadArg)"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    45
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    46
  (* tuples of state functions changed by the various components *)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    47
  e             :: "PrIds => (bit * memOp) stfun"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    48
     "e p == PRED (caller memCh!p)"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    49
  c             :: "PrIds => (mClkState * (bit * Vals) * (bit * rpcOp)) stfun"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    50
     "c p == PRED (cst!p, rtrner memCh!p, caller crCh!p)"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    51
  r             :: "PrIds => (rpcState * (bit * Vals) * (bit * memOp)) stfun"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    52
     "r p == PRED (rst!p, rtrner crCh!p, caller rmCh!p)"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    53
  m             :: "PrIds => ((bit * Vals) * Vals) stfun"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    54
     "m p == PRED (rtrner rmCh!p, ires!p)"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    55
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    56
  (* the environment action *)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    57
  ENext         :: "PrIds => action"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    58
     "ENext p == ACT (? l. #l : #MemLoc & Call memCh p #(read l))"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    59
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    60
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    61
  (* specification of the history variable *)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    62
  HInit         :: "histType => PrIds => stpred"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    63
     "HInit rmhist p == PRED rmhist!p = #histA"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    64
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    65
  HNext         :: "histType => PrIds => action"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    66
     "HNext rmhist p == ACT (rmhist!p)$ =
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    67
                     (if (MemReturn rmCh ires p | RPCFail crCh rmCh rst p)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    68
                      then #histB
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    69
                      else if (MClkReply memCh crCh cst p)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    70
                           then #histA
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    71
                           else $(rmhist!p))"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    72
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    73
  HistP         :: "histType => PrIds => temporal"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    74
     "HistP rmhist p == TEMP Init HInit rmhist p
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    75
                           & [][HNext rmhist p]_(c p,r p,m p, rmhist!p)"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    76
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    77
  Hist          :: "histType => temporal"
9517
f58863b1406a tuned version by Stephan Merz (unbatchified etc.);
wenzelm
parents: 6255
diff changeset
    78
      "Hist rmhist == TEMP (ALL p. HistP rmhist p)"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    79
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    80
  (* the implementation *)
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    81
  IPImp          :: "PrIds => temporal"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    82
     "IPImp p == TEMP (  Init ~Calling memCh p & [][ENext p]_(e p)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    83
                       & MClkIPSpec memCh crCh cst p
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    84
                       & RPCIPSpec crCh rmCh rst p
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    85
                       & RPSpec rmCh mm ires p
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    86
                       & (ALL l. #l : #MemLoc --> MSpec rmCh mm ires l))"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    87
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    88
  ImpInit        :: "PrIds => stpred"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    89
      "ImpInit p == PRED (  ~Calling memCh p
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    90
                          & MClkInit crCh cst p
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    91
                          & RPCInit rmCh rst p
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    92
                          & PInit ires p)"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    93
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    94
  ImpNext        :: "PrIds => action"
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    95
      "ImpNext p == ACT  [ENext p]_(e p)
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    96
                       & [MClkNext memCh crCh cst p]_(c p)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
    97
                       & [RPCNext crCh rmCh rst p]_(r p)
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    98
                       & [RNext rmCh mm ires p]_(m p)"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    99
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   100
  ImpLive        :: "PrIds => temporal"
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   101
      "ImpLive p == TEMP  WF(MClkFwd memCh crCh cst p)_(c p)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   102
                        & SF(MClkReply memCh crCh cst p)_(c p)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   103
                        & WF(RPCNext crCh rmCh rst p)_(r p)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   104
                        & WF(RNext rmCh mm ires p)_(m p)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   105
                        & WF(MemReturn rmCh ires p)_(m p)"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   106
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   107
  Implementation :: "temporal"
9517
f58863b1406a tuned version by Stephan Merz (unbatchified etc.);
wenzelm
parents: 6255
diff changeset
   108
      "Implementation == TEMP ( (ALL p. Init (~Calling memCh p) & [][ENext p]_(e p))
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   109
                               & MClkISpec memCh crCh cst
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   110
                               & RPCISpec crCh rmCh rst
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   111
                               & IRSpec rmCh mm ires)"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   112
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   113
  (* the predicate S describes the states of the implementation.
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   114
     slight simplification: two "histState" parameters instead of a
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   115
     (one- or two-element) set.
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   116
     NB: The second conjunct of the definition in the paper is taken care of by
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   117
     the type definitions. The last conjunct is asserted separately as the memory
24180
9f818139951b tuned ML setup;
wenzelm
parents: 21624
diff changeset
   118
     invariant MemInv, proved in Memory.thy. *)
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   119
  S :: "histType => bool => bool => bool => mClkState => rpcState => histState => histState => PrIds => stpred"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   120
      "S rmhist ecalling ccalling rcalling cs rs hs1 hs2 p == PRED
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   121
                Calling memCh p = #ecalling
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   122
              & Calling crCh p  = #ccalling
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   123
              & (#ccalling --> arg<crCh!p> = MClkRelayArg<arg<memCh!p>>)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   124
              & (~ #ccalling & cst!p = #clkB --> MVOKBARF<res<crCh!p>>)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   125
              & Calling rmCh p  = #rcalling
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   126
              & (#rcalling --> arg<rmCh!p> = RPCRelayArg<arg<crCh!p>>)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   127
              & (~ #rcalling --> ires!p = #NotAResult)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   128
              & (~ #rcalling & rst!p = #rpcB --> MVOKBA<res<rmCh!p>>)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   129
              & cst!p = #cs
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   130
              & rst!p = #rs
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   131
              & (rmhist!p = #hs1 | rmhist!p = #hs2)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   132
              & MVNROKBA<ires!p>"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   133
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   134
  (* predicates S1 -- S6 define special instances of S *)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   135
  S1            :: "histType => PrIds => stpred"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   136
      "S1 rmhist p == S rmhist False False False clkA rpcA histA histA p"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   137
  S2            :: "histType => PrIds => stpred"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   138
      "S2 rmhist p == S rmhist True False False clkA rpcA histA histA p"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   139
  S3            :: "histType => PrIds => stpred"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   140
      "S3 rmhist p == S rmhist True True False clkB rpcA histA histB p"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   141
  S4            :: "histType => PrIds => stpred"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   142
      "S4 rmhist p == S rmhist True True True clkB rpcB histA histB p"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   143
  S5            :: "histType => PrIds => stpred"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   144
      "S5 rmhist p == S rmhist True True False clkB rpcB histB histB p"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   145
  S6            :: "histType => PrIds => stpred"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   146
      "S6 rmhist p == S rmhist True False False clkB rpcA histB histB p"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   147
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   148
  (* The invariant asserts that the system is always in one of S1 - S6, for every p *)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   149
  ImpInv         :: "histType => PrIds => stpred"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   150
      "ImpInv rmhist p == PRED (  S1 rmhist p | S2 rmhist p | S3 rmhist p
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   151
                                | S4 rmhist p | S5 rmhist p | S6 rmhist p)"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   152
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   153
  resbar        :: "histType => resType"        (* refinement mapping *)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   154
      "resbar rmhist s p ==
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   155
                  (if (S1 rmhist p s | S2 rmhist p s)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   156
                   then ires s p
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   157
                   else if S3 rmhist p s
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   158
                   then if rmhist s p = histA
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   159
                        then ires s p else MemFailure
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   160
                   else if S4 rmhist p s
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   161
                   then if (rmhist s p = histB & ires s p = NotAResult)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   162
                        then MemFailure else ires s p
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   163
                   else if S5 rmhist p s
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   164
                   then res (rmCh s p)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   165
                   else if S6 rmhist p s
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   166
                   then if res (crCh s p) = RPCFailure
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   167
                        then MemFailure else res (crCh s p)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
   168
                   else NotAResult)" (* dummy value *)
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   169
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   170
axioms
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
   171
  (* the "base" variables: everything except resbar and hist (for any index) *)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   172
  MI_base:       "basevars (caller memCh!p,
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   173
                           (rtrner memCh!p, caller crCh!p, cst!p),
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   174
                           (rtrner crCh!p, caller rmCh!p, rst!p),
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   175
                           (mm!l, rtrner rmCh!p, ires!p))"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 11703
diff changeset
   176
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   177
(*
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   178
    The main theorem is theorem "Implementation" at the end of this file,
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   179
    which shows that the composition of a reliable memory, an RPC component, and
24180
9f818139951b tuned ML setup;
wenzelm
parents: 21624
diff changeset
   180
    a memory clerk implements an unreliable memory. The files "MIsafe.thy" and
9f818139951b tuned ML setup;
wenzelm
parents: 21624
diff changeset
   181
    "MIlive.thy" contain lower-level lemmas for the safety and liveness parts.
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   182
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   183
    Steps are (roughly) numbered as in the hand proof.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   184
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   185
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   186
(* --------------------------- automatic prover --------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   187
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   188
declare if_weak_cong [cong del]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   189
24180
9f818139951b tuned ML setup;
wenzelm
parents: 21624
diff changeset
   190
ML {* val MI_css = (@{claset}, @{simpset}) *}
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   191
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   192
(* A more aggressive variant that tries to solve subgoals by assumption
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   193
   or contradiction during the simplification.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   194
   THIS IS UNSAFE, BECAUSE IT DOESN'T RECORD THE CHOICES!!
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   195
   (but it can be a lot faster than MI_css)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   196
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   197
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   198
ML {*
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   199
val MI_fast_css =
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   200
  let
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   201
    val (cs,ss) = MI_css
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   202
  in
24180
9f818139951b tuned ML setup;
wenzelm
parents: 21624
diff changeset
   203
    (cs addSEs [temp_use @{thm squareE}],
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   204
      ss addSSolver (mk_solver "" (fn thms => assume_tac ORELSE' (etac notE))))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   205
  end;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   206
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   207
val temp_elim = make_elim o temp_use;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   208
*}
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   209
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   210
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   211
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   212
(****************************** The history variable ******************************)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   213
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   214
section "History variable"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   215
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   216
lemma HistoryLemma: "|- Init(ALL p. ImpInit p) & [](ALL p. ImpNext p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   217
         --> (EEX rmhist. Init(ALL p. HInit rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   218
                          & [](ALL p. [HNext rmhist p]_(c p, r p, m p, rmhist!p)))"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   219
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   220
  apply (rule historyI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   221
      apply assumption+
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   222
  apply (rule MI_base)
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   223
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "HInit_def"]) [] [] 1 *})
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   224
   apply (erule fun_cong)
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   225
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "HNext_def"])
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   226
    [thm "busy_squareI"] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   227
  apply (erule fun_cong)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   228
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   229
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   230
lemma History: "|- Implementation --> (EEX rmhist. Hist rmhist)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   231
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   232
  apply (rule HistoryLemma [temp_use, THEN eex_mono])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   233
    prefer 3
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   234
    apply (force simp: Hist_def HistP_def Init_def all_box [try_rewrite]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   235
      split_box_conj [try_rewrite])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   236
   apply (auto simp: Implementation_def MClkISpec_def RPCISpec_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   237
     IRSpec_def MClkIPSpec_def RPCIPSpec_def RPSpec_def ImpInit_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   238
     Init_def ImpNext_def c_def r_def m_def all_box [temp_use] split_box_conj [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   239
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   240
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   241
(******************************** The safety part *********************************)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   242
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   243
section "The safety part"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   244
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   245
(* ------------------------- Include lower-level lemmas ------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   246
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   247
(* RPCFailure notin MemVals U {OK,BadArg} *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   248
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   249
lemma MVOKBAnotRF: "MVOKBA x ==> x ~= RPCFailure"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   250
  apply (unfold MVOKBA_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   251
  apply auto
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   252
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   253
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   254
(* NotAResult notin MemVals U {OK,BadArg,RPCFailure} *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   255
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   256
lemma MVOKBARFnotNR: "MVOKBARF x ==> x ~= NotAResult"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   257
  apply (unfold MVOKBARF_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   258
  apply auto
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   259
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   260
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   261
(* ================ Si's are mutually exclusive ================================ *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   262
(* Si and Sj are mutually exclusive for i # j. This helps to simplify the big
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   263
   conditional in the definition of resbar when doing the step-simulation proof.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   264
   We prove a weaker result, which suffices for our purposes:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   265
   Si implies (not Sj), for j<i.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   266
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   267
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   268
(* --- not used ---
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   269
Goal "|- S1 rmhist p --> S1 rmhist p & ~S2 rmhist p & ~S3 rmhist p &
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   270
                         ~S4 rmhist p & ~S5 rmhist p & ~S6 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   271
by (auto_tac (MI_css addsimps2 [S_def, S1_def, S2_def,
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   272
                                S3_def, S4_def, S5_def, S6_def]));
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   273
qed "S1_excl";
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   274
*)
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 S2_excl: "|- S2 rmhist p --> S2 rmhist p & ~S1 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   277
  by (auto simp: S_def S1_def S2_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   278
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   279
lemma S3_excl: "|- S3 rmhist p --> S3 rmhist p & ~S1 rmhist p & ~S2 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   280
  by (auto simp: S_def S1_def S2_def S3_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   281
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   282
lemma S4_excl: "|- S4 rmhist p --> S4 rmhist p & ~S1 rmhist p & ~S2 rmhist p & ~S3 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   283
  by (auto simp: S_def S1_def S2_def S3_def S4_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   284
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   285
lemma S5_excl: "|- S5 rmhist p --> S5 rmhist p & ~S1 rmhist p & ~S2 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   286
                         & ~S3 rmhist p & ~S4 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   287
  by (auto simp: S_def S1_def S2_def S3_def S4_def S5_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   288
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   289
lemma S6_excl: "|- S6 rmhist p --> S6 rmhist p & ~S1 rmhist p & ~S2 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   290
                         & ~S3 rmhist p & ~S4 rmhist p & ~S5 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   291
  by (auto simp: S_def S1_def S2_def S3_def S4_def S5_def S6_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   292
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   293
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   294
(* ==================== Lemmas about the environment ============================== *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   295
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   296
lemma Envbusy: "|- $(Calling memCh p) --> ~ENext p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   297
  by (auto simp: ENext_def Call_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   298
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   299
(* ==================== Lemmas about the implementation's states ==================== *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   300
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   301
(* The following series of lemmas are used in establishing the implementation's
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   302
   next-state relation (Step 1.2 of the proof in the paper). For each state Si, we
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   303
   determine which component actions are possible and what state they result in.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   304
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   305
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   306
(* ------------------------------ State S1 ---------------------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   307
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   308
lemma S1Env: "|- ENext p & $(S1 rmhist p) & unchanged (c p, r p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   309
         --> (S2 rmhist p)$"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   310
  by (force simp: ENext_def Call_def c_def r_def m_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   311
    caller_def rtrner_def MVNROKBA_def S_def S1_def S2_def Calling_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   312
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   313
lemma S1ClerkUnch: "|- [MClkNext memCh crCh cst p]_(c p) & $(S1 rmhist p) --> unchanged (c p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   314
  by (tactic {* auto_tac (MI_fast_css addSDs2 [temp_use (thm "MClkidle")]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   315
    addsimps2 [thm "S_def", thm "S1_def"]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   316
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   317
lemma S1RPCUnch: "|- [RPCNext crCh rmCh rst p]_(r p) & $(S1 rmhist p) --> unchanged (r p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   318
  by (tactic {* auto_tac (MI_fast_css addSDs2 [temp_use (thm "RPCidle")]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   319
    addsimps2 [thm "S_def", thm "S1_def"]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   320
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   321
lemma S1MemUnch: "|- [RNext rmCh mm ires p]_(m p) & $(S1 rmhist p) --> unchanged (m p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   322
  by (tactic {* auto_tac (MI_fast_css addSDs2 [temp_use (thm "Memoryidle")]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   323
    addsimps2 [thm "S_def", thm "S1_def"]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   324
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   325
lemma S1Hist: "|- [HNext rmhist p]_(c p,r p,m p,rmhist!p) & $(S1 rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   326
         --> unchanged (rmhist!p)"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   327
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "HNext_def", thm "S_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   328
    thm "S1_def", thm "MemReturn_def", thm "RPCFail_def", thm "MClkReply_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   329
    thm "Return_def"]) [] [temp_use (thm "squareE")] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   330
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   331
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   332
(* ------------------------------ State S2 ---------------------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   333
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   334
lemma S2EnvUnch: "|- [ENext p]_(e p) & $(S2 rmhist p) --> unchanged (e p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   335
  by (auto dest!: Envbusy [temp_use] simp: S_def S2_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   336
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   337
lemma S2Clerk: "|- MClkNext memCh crCh cst p & $(S2 rmhist p) --> MClkFwd memCh crCh cst p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   338
  by (auto simp: MClkNext_def MClkRetry_def MClkReply_def S_def S2_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   339
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   340
lemma S2Forward: "|- $(S2 rmhist p) & MClkFwd memCh crCh cst p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   341
         & unchanged (e p, r p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   342
         --> (S3 rmhist p)$"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   343
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "MClkFwd_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   344
    thm "Call_def", thm "e_def", thm "r_def", thm "m_def", thm "caller_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   345
    thm "rtrner_def", thm "S_def", thm "S2_def", thm "S3_def", thm "Calling_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   346
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   347
lemma S2RPCUnch: "|- [RPCNext crCh rmCh rst p]_(r p) & $(S2 rmhist p) --> unchanged (r p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   348
  by (auto simp: S_def S2_def dest!: RPCidle [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   349
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   350
lemma S2MemUnch: "|- [RNext rmCh mm ires p]_(m p) & $(S2 rmhist p) --> unchanged (m p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   351
  by (auto simp: S_def S2_def dest!: Memoryidle [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   352
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   353
lemma S2Hist: "|- [HNext rmhist p]_(c p,r p,m p,rmhist!p) & $(S2 rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   354
         --> unchanged (rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   355
  by (tactic {* auto_tac (MI_fast_css addsimps2 [thm "HNext_def", thm "MemReturn_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   356
    thm "RPCFail_def", thm "MClkReply_def", thm "Return_def", thm "S_def", thm "S2_def"]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   357
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   358
(* ------------------------------ State S3 ---------------------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   359
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   360
lemma S3EnvUnch: "|- [ENext p]_(e p) & $(S3 rmhist p) --> unchanged (e p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   361
  by (auto dest!: Envbusy [temp_use] simp: S_def S3_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   362
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   363
lemma S3ClerkUnch: "|- [MClkNext memCh crCh cst p]_(c p) & $(S3 rmhist p) --> unchanged (c p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   364
  by (auto dest!: MClkbusy [temp_use] simp: square_def S_def S3_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   365
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   366
lemma S3LegalRcvArg: "|- S3 rmhist p --> IsLegalRcvArg<arg<crCh!p>>"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   367
  by (auto simp: IsLegalRcvArg_def MClkRelayArg_def S_def S3_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   368
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   369
lemma S3RPC: "|- RPCNext crCh rmCh rst p & $(S3 rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   370
         --> RPCFwd crCh rmCh rst p | RPCFail crCh rmCh rst p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   371
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   372
  apply (frule S3LegalRcvArg [action_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   373
  apply (auto simp: RPCNext_def RPCReject_def RPCReply_def S_def S3_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   374
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   375
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   376
lemma S3Forward: "|- RPCFwd crCh rmCh rst p & HNext rmhist p & $(S3 rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   377
         & unchanged (e p, c p, m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   378
         --> (S4 rmhist p)$ & unchanged (rmhist!p)"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   379
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "RPCFwd_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   380
    thm "HNext_def", thm "MemReturn_def", thm "RPCFail_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   381
    thm "MClkReply_def", thm "Return_def", thm "Call_def", thm "e_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   382
    thm "c_def", thm "m_def", thm "caller_def", thm "rtrner_def", thm "S_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   383
    thm "S3_def", thm "S4_def", thm "Calling_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   384
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   385
lemma S3Fail: "|- RPCFail crCh rmCh rst p & $(S3 rmhist p) & HNext rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   386
         & unchanged (e p, c p, m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   387
         --> (S6 rmhist p)$"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   388
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "HNext_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   389
    thm "RPCFail_def", thm "Return_def", thm "e_def", thm "c_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   390
    thm "m_def", thm "caller_def", thm "rtrner_def", thm "MVOKBARF_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   391
    thm "S_def", thm "S3_def", thm "S6_def", thm "Calling_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   392
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   393
lemma S3MemUnch: "|- [RNext rmCh mm ires p]_(m p) & $(S3 rmhist p) --> unchanged (m p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   394
  by (auto simp: S_def S3_def dest!: Memoryidle [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   395
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   396
lemma S3Hist: "|- HNext rmhist p & $(S3 rmhist p) & unchanged (r p) --> unchanged (rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   397
  by (auto simp: HNext_def MemReturn_def RPCFail_def MClkReply_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   398
    Return_def r_def rtrner_def S_def S3_def Calling_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   399
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   400
(* ------------------------------ State S4 ---------------------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   401
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   402
lemma S4EnvUnch: "|- [ENext p]_(e p) & $(S4 rmhist p) --> unchanged (e p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   403
  by (auto simp: S_def S4_def dest!: Envbusy [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   404
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   405
lemma S4ClerkUnch: "|- [MClkNext memCh crCh cst p]_(c p) & $(S4 rmhist p) --> unchanged (c p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   406
  by (auto simp: S_def S4_def dest!: MClkbusy [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   407
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   408
lemma S4RPCUnch: "|- [RPCNext crCh rmCh rst p]_(r p) & $(S4 rmhist p) --> unchanged (r p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   409
  by (tactic {* auto_tac (MI_fast_css addsimps2 [thm "S_def", thm "S4_def"]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   410
    addSDs2 [temp_use (thm "RPCbusy")]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   411
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   412
lemma S4ReadInner: "|- ReadInner rmCh mm ires p l & $(S4 rmhist p) & unchanged (e p, c p, r p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   413
         & HNext rmhist p & $(MemInv mm l)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   414
         --> (S4 rmhist p)$ & unchanged (rmhist!p)"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   415
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "ReadInner_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   416
    thm "GoodRead_def", thm "BadRead_def", thm "HNext_def", thm "MemReturn_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   417
    thm "RPCFail_def", thm "MClkReply_def", thm "Return_def", thm "e_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   418
    thm "c_def", thm "r_def", thm "rtrner_def", thm "caller_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   419
    thm "MVNROKBA_def", thm "S_def", thm "S4_def", thm "RdRequest_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   420
    thm "Calling_def", thm "MemInv_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   421
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   422
lemma S4Read: "|- Read rmCh mm ires p & $(S4 rmhist p) & unchanged (e p, c p, r p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   423
         & HNext rmhist p & (!l. $MemInv mm l)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   424
         --> (S4 rmhist p)$ & unchanged (rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   425
  by (auto simp: Read_def dest!: S4ReadInner [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   426
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   427
lemma S4WriteInner: "|- WriteInner rmCh mm ires p l v & $(S4 rmhist p) & unchanged (e p, c p, r p)           & HNext rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   428
         --> (S4 rmhist p)$ & unchanged (rmhist!p)"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   429
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "WriteInner_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   430
    thm "GoodWrite_def", thm "BadWrite_def", thm "HNext_def", thm "MemReturn_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   431
    thm "RPCFail_def", thm "MClkReply_def", thm "Return_def", thm "e_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   432
    thm "c_def", thm "r_def", thm "rtrner_def", thm "caller_def", thm "MVNROKBA_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   433
    thm "S_def", thm "S4_def", thm "WrRequest_def", thm "Calling_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   434
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   435
lemma S4Write: "|- Write rmCh mm ires p l & $(S4 rmhist p) & unchanged (e p, c p, r p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   436
         & (HNext rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   437
         --> (S4 rmhist p)$ & unchanged (rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   438
  by (auto simp: Write_def dest!: S4WriteInner [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   439
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   440
lemma WriteS4: "|- $ImpInv rmhist p & Write rmCh mm ires p l --> $S4 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   441
  by (auto simp: Write_def WriteInner_def ImpInv_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   442
    WrRequest_def S_def S1_def S2_def S3_def S4_def S5_def S6_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   443
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   444
lemma S4Return: "|- MemReturn rmCh ires p & $S4 rmhist p & unchanged (e p, c p, r p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   445
         & HNext rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   446
         --> (S5 rmhist p)$"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   447
  by (auto simp: HNext_def MemReturn_def Return_def e_def c_def r_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   448
    rtrner_def caller_def MVNROKBA_def MVOKBA_def S_def S4_def S5_def Calling_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   449
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   450
lemma S4Hist: "|- HNext rmhist p & $S4 rmhist p & (m p)$ = $(m p) --> (rmhist!p)$ = $(rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   451
  by (auto simp: HNext_def MemReturn_def RPCFail_def MClkReply_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   452
    Return_def m_def rtrner_def S_def S4_def Calling_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   453
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   454
(* ------------------------------ State S5 ---------------------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   455
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   456
lemma S5EnvUnch: "|- [ENext p]_(e p) & $(S5 rmhist p) --> unchanged (e p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   457
  by (auto simp: S_def S5_def dest!: Envbusy [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   458
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   459
lemma S5ClerkUnch: "|- [MClkNext memCh crCh cst p]_(c p) & $(S5 rmhist p) --> unchanged (c p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   460
  by (auto simp: S_def S5_def dest!: MClkbusy [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   461
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   462
lemma S5RPC: "|- RPCNext crCh rmCh rst p & $(S5 rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   463
         --> RPCReply crCh rmCh rst p | RPCFail crCh rmCh rst p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   464
  by (auto simp: RPCNext_def RPCReject_def RPCFwd_def S_def S5_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   465
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   466
lemma S5Reply: "|- RPCReply crCh rmCh rst p & $(S5 rmhist p) & unchanged (e p, c p, m p,rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   467
       --> (S6 rmhist p)$"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   468
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "RPCReply_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   469
    thm "Return_def", thm "e_def", thm "c_def", thm "m_def", thm "MVOKBA_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   470
    thm "MVOKBARF_def", thm "caller_def", thm "rtrner_def", thm "S_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   471
    thm "S5_def", thm "S6_def", thm "Calling_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   472
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   473
lemma S5Fail: "|- RPCFail crCh rmCh rst p & $(S5 rmhist p) & unchanged (e p, c p, m p,rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   474
         --> (S6 rmhist p)$"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   475
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "RPCFail_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   476
    thm "Return_def", thm "e_def", thm "c_def", thm "m_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   477
    thm "MVOKBARF_def", thm "caller_def", thm "rtrner_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   478
    thm "S_def", thm "S5_def", thm "S6_def", thm "Calling_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   479
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   480
lemma S5MemUnch: "|- [RNext rmCh mm ires p]_(m p) & $(S5 rmhist p) --> unchanged (m p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   481
  by (auto simp: S_def S5_def dest!: Memoryidle [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   482
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   483
lemma S5Hist: "|- [HNext rmhist p]_(c p, r p, m p, rmhist!p) & $(S5 rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   484
         --> (rmhist!p)$ = $(rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   485
  by (tactic {* auto_tac (MI_fast_css addsimps2 [thm "HNext_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   486
    thm "MemReturn_def", thm "RPCFail_def", thm "MClkReply_def", thm "Return_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   487
    thm "S_def", thm "S5_def"]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   488
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   489
(* ------------------------------ State S6 ---------------------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   490
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   491
lemma S6EnvUnch: "|- [ENext p]_(e p) & $(S6 rmhist p) --> unchanged (e p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   492
  by (auto simp: S_def S6_def dest!: Envbusy [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   493
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   494
lemma S6Clerk: "|- MClkNext memCh crCh cst p & $(S6 rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   495
         --> MClkRetry memCh crCh cst p | MClkReply memCh crCh cst p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   496
  by (auto simp: MClkNext_def MClkFwd_def S_def S6_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   497
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   498
lemma S6Retry: "|- MClkRetry memCh crCh cst p & HNext rmhist p & $S6 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   499
         & unchanged (e p,r p,m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   500
         --> (S3 rmhist p)$ & unchanged (rmhist!p)"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   501
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "HNext_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   502
    thm "MClkReply_def", thm "MClkRetry_def", thm "Call_def", thm "Return_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   503
    thm "e_def", thm "r_def", thm "m_def", thm "caller_def", thm "rtrner_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   504
    thm "S_def", thm "S6_def", thm "S3_def", thm "Calling_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   505
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   506
lemma S6Reply: "|- MClkReply memCh crCh cst p & HNext rmhist p & $S6 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   507
         & unchanged (e p,r p,m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   508
         --> (S1 rmhist p)$"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   509
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "HNext_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   510
    thm "MemReturn_def", thm "RPCFail_def", thm "Return_def", thm "MClkReply_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   511
    thm "e_def", thm "r_def", thm "m_def", thm "caller_def", thm "rtrner_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   512
    thm "S_def", thm "S6_def", thm "S1_def", thm "Calling_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   513
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   514
lemma S6RPCUnch: "|- [RPCNext crCh rmCh rst p]_(r p) & $S6 rmhist p --> unchanged (r p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   515
  by (auto simp: S_def S6_def dest!: RPCidle [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   516
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   517
lemma S6MemUnch: "|- [RNext rmCh mm ires p]_(m p) & $(S6 rmhist p) --> unchanged (m p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   518
  by (auto simp: S_def S6_def dest!: Memoryidle [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   519
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   520
lemma S6Hist: "|- HNext rmhist p & $S6 rmhist p & (c p)$ = $(c p) --> (rmhist!p)$ = $(rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   521
  by (auto simp: HNext_def MClkReply_def Return_def c_def rtrner_def S_def S6_def Calling_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   522
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   523
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   524
section "Correctness of predicate-action diagram"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   525
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   526
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   527
(* ========== Step 1.1 ================================================= *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   528
(* The implementation's initial condition implies the state predicate S1 *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   529
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   530
lemma Step1_1: "|- ImpInit p & HInit rmhist p --> S1 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   531
  by (tactic {* auto_tac (MI_fast_css addsimps2 [thm "MVNROKBA_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   532
    thm "MClkInit_def", thm "RPCInit_def", thm "PInit_def", thm "HInit_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   533
    thm "ImpInit_def", thm "S_def", thm "S1_def"]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   534
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   535
(* ========== Step 1.2 ================================================== *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   536
(* Figure 16 is a predicate-action diagram for the implementation. *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   537
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   538
lemma Step1_2_1: "|- [HNext rmhist p]_(c p,r p,m p, rmhist!p) & ImpNext p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   539
         & ~unchanged (e p, c p, r p, m p, rmhist!p)  & $S1 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   540
         --> (S2 rmhist p)$ & ENext p & unchanged (c p, r p, m p)"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   541
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "ImpNext_def"]) []
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   542
      (map temp_elim [thm "S1ClerkUnch", thm "S1RPCUnch", thm "S1MemUnch", thm "S1Hist"]) 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   543
   apply (tactic {* auto_tac (MI_fast_css addSIs2 [temp_use (thm "S1Env")]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   544
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   545
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   546
lemma Step1_2_2: "|- [HNext rmhist p]_(c p,r p,m p, rmhist!p) & ImpNext p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   547
         & ~unchanged (e p, c p, r p, m p, rmhist!p) & $S2 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   548
         --> (S3 rmhist p)$ & MClkFwd memCh crCh cst p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   549
             & unchanged (e p, r p, m p, rmhist!p)"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   550
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "ImpNext_def"]) []
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   551
    (map temp_elim [thm "S2EnvUnch", thm "S2RPCUnch", thm "S2MemUnch", thm "S2Hist"]) 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   552
   apply (tactic {* auto_tac (MI_fast_css addSIs2 [temp_use (thm "S2Clerk"),
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   553
     temp_use (thm "S2Forward")]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   554
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   555
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   556
lemma Step1_2_3: "|- [HNext rmhist p]_(c p,r p,m p, rmhist!p) & ImpNext p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   557
         & ~unchanged (e p, c p, r p, m p, rmhist!p) & $S3 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   558
         --> ((S4 rmhist p)$ & RPCFwd crCh rmCh rst p & unchanged (e p, c p, m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   559
             | ((S6 rmhist p)$ & RPCFail crCh rmCh rst p & unchanged (e p, c p, m p))"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   560
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "ImpNext_def"]) []
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   561
    (map temp_elim [thm "S3EnvUnch", thm "S3ClerkUnch", thm "S3MemUnch"]) 1 *})
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   562
  apply (tactic {* action_simp_tac @{simpset} []
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   563
    (thm "squareE" :: map temp_elim [thm "S3RPC", thm "S3Forward", thm "S3Fail"]) 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   564
   apply (auto dest!: S3Hist [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   565
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   566
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   567
lemma Step1_2_4: "|- [HNext rmhist p]_(c p,r p,m p, rmhist!p) & ImpNext p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   568
              & ~unchanged (e p, c p, r p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   569
              & $S4 rmhist p & (!l. $(MemInv mm l))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   570
         --> ((S4 rmhist p)$ & Read rmCh mm ires p & unchanged (e p, c p, r p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   571
             | ((S4 rmhist p)$ & (? l. Write rmCh mm ires p l) & unchanged (e p, c p, r p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   572
             | ((S5 rmhist p)$ & MemReturn rmCh ires p & unchanged (e p, c p, r p))"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   573
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "ImpNext_def"]) []
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   574
    (map temp_elim [thm "S4EnvUnch", thm "S4ClerkUnch", thm "S4RPCUnch"]) 1 *})
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   575
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "RNext_def"]) []
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   576
    (thm "squareE" :: map temp_elim [thm "S4Read", thm "S4Write", thm "S4Return"]) 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   577
  apply (auto dest!: S4Hist [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   578
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   579
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   580
lemma Step1_2_5: "|- [HNext rmhist p]_(c p,r p,m p, rmhist!p) & ImpNext p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   581
              & ~unchanged (e p, c p, r p, m p, rmhist!p) & $S5 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   582
         --> ((S6 rmhist p)$ & RPCReply crCh rmCh rst p & unchanged (e p, c p, m p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   583
             | ((S6 rmhist p)$ & RPCFail crCh rmCh rst p & unchanged (e p, c p, m p))"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   584
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "ImpNext_def"]) []
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   585
    (map temp_elim [thm "S5EnvUnch", thm "S5ClerkUnch", thm "S5MemUnch", thm "S5Hist"]) 1 *})
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   586
  apply (tactic {* action_simp_tac @{simpset} [] [thm "squareE", temp_elim (thm "S5RPC")] 1 *})
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   587
   apply (tactic {* auto_tac (MI_fast_css addSDs2
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   588
     [temp_use (thm "S5Reply"), temp_use (thm "S5Fail")]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   589
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   590
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   591
lemma Step1_2_6: "|- [HNext rmhist p]_(c p,r p,m p, rmhist!p) & ImpNext p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   592
              & ~unchanged (e p, c p, r p, m p, rmhist!p) & $S6 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   593
         --> ((S1 rmhist p)$ & MClkReply memCh crCh cst p & unchanged (e p, r p, m p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   594
             | ((S3 rmhist p)$ & MClkRetry memCh crCh cst p & unchanged (e p,r p,m p,rmhist!p))"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   595
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "ImpNext_def"]) []
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   596
    (map temp_elim [thm "S6EnvUnch", thm "S6RPCUnch", thm "S6MemUnch"]) 1 *})
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   597
  apply (tactic {* action_simp_tac @{simpset} []
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   598
    (thm "squareE" :: map temp_elim [thm "S6Clerk", thm "S6Retry", thm "S6Reply"]) 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   599
     apply (auto dest: S6Hist [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   600
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   601
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   602
(* --------------------------------------------------------------------------
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   603
   Step 1.3: S1 implies the barred initial condition.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   604
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   605
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   606
section "Initialization (Step 1.3)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   607
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   608
lemma Step1_3: "|- S1 rmhist p --> PInit (resbar rmhist) p"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   609
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "resbar_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   610
    thm "PInit_def", thm "S_def", thm "S1_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   611
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   612
(* ----------------------------------------------------------------------
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   613
   Step 1.4: Implementation's next-state relation simulates specification's
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   614
             next-state relation (with appropriate substitutions)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   615
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   616
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   617
section "Step simulation (Step 1.4)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   618
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   619
lemma Step1_4_1: "|- ENext p & $S1 rmhist p & (S2 rmhist p)$ & unchanged (c p, r p, m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   620
         --> unchanged (rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   621
  by (tactic {* auto_tac (MI_fast_css addsimps2 [thm "c_def", thm "r_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   622
    thm "m_def", thm "resbar_def"]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   623
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   624
lemma Step1_4_2: "|- MClkFwd memCh crCh cst p & $S2 rmhist p & (S3 rmhist p)$
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   625
         & unchanged (e p, r p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   626
         --> unchanged (rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   627
  by (tactic {* action_simp_tac
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   628
    (@{simpset} addsimps [thm "MClkFwd_def", thm "e_def", thm "r_def", thm "m_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   629
    thm "resbar_def", thm "S_def", thm "S2_def", thm "S3_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   630
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   631
lemma Step1_4_3a: "|- RPCFwd crCh rmCh rst p & $S3 rmhist p & (S4 rmhist p)$
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   632
         & unchanged (e p, c p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   633
         --> unchanged (rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   634
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   635
  apply (drule S3_excl [temp_use] S4_excl [temp_use])+
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   636
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "e_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   637
    thm "c_def", thm "m_def", thm "resbar_def", thm "S_def", thm "S3_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   638
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   639
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   640
lemma Step1_4_3b: "|- RPCFail crCh rmCh rst p & $S3 rmhist p & (S6 rmhist p)$
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   641
         & unchanged (e p, c p, m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   642
         --> MemFail memCh (resbar rmhist) p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   643
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   644
  apply (drule S6_excl [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   645
  apply (auto simp: RPCFail_def MemFail_def e_def c_def m_def resbar_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   646
    apply (force simp: S3_def S_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   647
   apply (auto simp: Return_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   648
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   649
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   650
lemma Step1_4_4a1: "|- $S4 rmhist p & (S4 rmhist p)$ & ReadInner rmCh mm ires p l
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   651
         & unchanged (e p, c p, r p, rmhist!p) & $MemInv mm l
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   652
         --> ReadInner memCh mm (resbar rmhist) p l"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   653
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   654
  apply (drule S4_excl [temp_use])+
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   655
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "ReadInner_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   656
    thm "GoodRead_def", thm "BadRead_def", thm "e_def", thm "c_def", thm "m_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   657
     apply (auto simp: resbar_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   658
       apply (tactic {* ALLGOALS (action_simp_tac
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   659
                (@{simpset} addsimps [thm "RPCRelayArg_def", thm "MClkRelayArg_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   660
                  thm "S_def", thm "S4_def", thm "RdRequest_def", thm "MemInv_def"])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   661
                [] [thm "impE", thm "MemValNotAResultE"]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   662
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   663
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   664
lemma Step1_4_4a: "|- Read rmCh mm ires p & $S4 rmhist p & (S4 rmhist p)$
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   665
         & unchanged (e p, c p, r p, rmhist!p) & (!l. $(MemInv mm l))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   666
         --> Read memCh mm (resbar rmhist) p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   667
  by (force simp: Read_def elim!: Step1_4_4a1 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   668
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   669
lemma Step1_4_4b1: "|- $S4 rmhist p & (S4 rmhist p)$ & WriteInner rmCh mm ires p l v
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   670
         & unchanged (e p, c p, r p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   671
         --> WriteInner memCh mm (resbar rmhist) p l v"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   672
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   673
  apply (drule S4_excl [temp_use])+
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   674
  apply (tactic {* action_simp_tac (@{simpset} addsimps
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   675
    [thm "WriteInner_def", thm "GoodWrite_def", thm "BadWrite_def", thm "e_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   676
    thm "c_def", thm "m_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   677
     apply (auto simp: resbar_def)
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   678
    apply (tactic {* ALLGOALS (action_simp_tac (@{simpset} addsimps
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   679
      [thm "RPCRelayArg_def", thm "MClkRelayArg_def", thm "S_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   680
      thm "S4_def", thm "WrRequest_def"]) [] []) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   681
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   682
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   683
lemma Step1_4_4b: "|- Write rmCh mm ires p l & $S4 rmhist p & (S4 rmhist p)$
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   684
         & unchanged (e p, c p, r p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   685
         --> Write memCh mm (resbar rmhist) p l"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   686
  by (force simp: Write_def elim!: Step1_4_4b1 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   687
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   688
lemma Step1_4_4c: "|- MemReturn rmCh ires p & $S4 rmhist p & (S5 rmhist p)$
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   689
         & unchanged (e p, c p, r p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   690
         --> unchanged (rtrner memCh!p, resbar rmhist!p)"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   691
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "e_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   692
    thm "c_def", thm "r_def", thm "resbar_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   693
  apply (drule S4_excl [temp_use] S5_excl [temp_use])+
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   694
  apply (tactic {* auto_tac (MI_fast_css addsimps2 [thm "MemReturn_def", thm "Return_def"]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   695
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   696
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   697
lemma Step1_4_5a: "|- RPCReply crCh rmCh rst p & $S5 rmhist p & (S6 rmhist p)$
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   698
         & unchanged (e p, c p, m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   699
         --> unchanged (rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   700
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   701
  apply (drule S5_excl [temp_use] S6_excl [temp_use])+
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   702
  apply (auto simp: e_def c_def m_def resbar_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   703
   apply (auto simp: RPCReply_def Return_def S5_def S_def dest!: MVOKBAnotRF [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   704
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   705
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   706
lemma Step1_4_5b: "|- RPCFail crCh rmCh rst p & $S5 rmhist p & (S6 rmhist p)$
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   707
         & unchanged (e p, c p, m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   708
         --> MemFail memCh (resbar rmhist) p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   709
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   710
  apply (drule S6_excl [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   711
  apply (auto simp: e_def c_def m_def RPCFail_def Return_def MemFail_def resbar_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   712
   apply (auto simp: S5_def S_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   713
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   714
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   715
lemma Step1_4_6a: "|- MClkReply memCh crCh cst p & $S6 rmhist p & (S1 rmhist p)$
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   716
         & unchanged (e p, r p, m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   717
         --> MemReturn memCh (resbar rmhist) p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   718
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   719
  apply (drule S6_excl [temp_use])+
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   720
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "e_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   721
    thm "r_def", thm "m_def", thm "MClkReply_def", thm "MemReturn_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   722
    thm "Return_def", thm "resbar_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   723
    apply simp_all (* simplify if-then-else *)
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   724
    apply (tactic {* ALLGOALS (action_simp_tac (@{simpset} addsimps
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   725
      [thm "MClkReplyVal_def", thm "S6_def", thm "S_def"]) [] [thm "MVOKBARFnotNR"]) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   726
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   727
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   728
lemma Step1_4_6b: "|- MClkRetry memCh crCh cst p & $S6 rmhist p & (S3 rmhist p)$
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   729
         & unchanged (e p, r p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   730
         --> MemFail memCh (resbar rmhist) p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   731
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   732
  apply (drule S3_excl [temp_use])+
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   733
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "e_def", thm "r_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   734
    thm "m_def", thm "MClkRetry_def", thm "MemFail_def", thm "resbar_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   735
   apply (auto simp: S6_def S_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   736
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   737
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   738
lemma S_lemma: "|- unchanged (e p, c p, r p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   739
         --> unchanged (S rmhist ec cc rc cs rs hs1 hs2 p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   740
  by (auto simp: e_def c_def r_def m_def caller_def rtrner_def S_def Calling_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   741
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   742
lemma Step1_4_7H: "|- unchanged (e p, c p, r p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   743
         --> unchanged (rtrner memCh!p, S1 rmhist p, S2 rmhist p, S3 rmhist p,
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   744
                        S4 rmhist p, S5 rmhist p, S6 rmhist p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   745
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   746
  apply (rule conjI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   747
   apply (force simp: c_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   748
  apply (force simp: S1_def S2_def S3_def S4_def S5_def S6_def intro!: S_lemma [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   749
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   750
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   751
lemma Step1_4_7: "|- unchanged (e p, c p, r p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   752
         --> unchanged (rtrner memCh!p, resbar rmhist!p, S1 rmhist p, S2 rmhist p,
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   753
                        S3 rmhist p, S4 rmhist p, S5 rmhist p, S6 rmhist p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   754
  apply (rule actionI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   755
  apply (unfold action_rews)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   756
  apply (rule impI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   757
  apply (frule Step1_4_7H [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   758
  apply (auto simp: e_def c_def r_def m_def rtrner_def resbar_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   759
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   760
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   761
(* Frequently needed abbreviation: distinguish between idling and non-idling
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   762
   steps of the implementation, and try to solve the idling case by simplification
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   763
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   764
ML {*
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   765
fun split_idle_tac ctxt simps i =
32149
ef59550a55d3 renamed simpset_of to global_simpset_of, and local_simpset_of to simpset_of -- same for claset and clasimpset;
wenzelm
parents: 27208
diff changeset
   766
  let val ss = simpset_of ctxt in
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   767
    TRY (rtac @{thm actionI} i) THEN
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   768
    InductTacs.case_tac ctxt "(s,t) |= unchanged (e p, c p, r p, m p, rmhist!p)" i THEN
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   769
    rewrite_goals_tac @{thms action_rews} THEN
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   770
    forward_tac [temp_use @{thm Step1_4_7}] i THEN
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   771
    asm_full_simp_tac (ss addsimps simps) i
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   772
  end
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   773
*}
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   774
(* ----------------------------------------------------------------------
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   775
   Combine steps 1.2 and 1.4 to prove that the implementation satisfies
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   776
   the specification's next-state relation.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   777
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   778
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   779
(* Steps that leave all variables unchanged are safe, so I may assume
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   780
   that some variable changes in the proof that a step is safe. *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   781
lemma unchanged_safe: "|- (~unchanged (e p, c p, r p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   782
             --> [UNext memCh mm (resbar rmhist) p]_(rtrner memCh!p, resbar rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   783
         --> [UNext memCh mm (resbar rmhist) p]_(rtrner memCh!p, resbar rmhist!p)"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   784
  apply (tactic {* split_idle_tac @{context} [thm "square_def"] 1 *})
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   785
  apply force
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   786
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   787
(* turn into (unsafe, looping!) introduction rule *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   788
lemmas unchanged_safeI = impI [THEN unchanged_safe [action_use], standard]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   789
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   790
lemma S1safe: "|- $S1 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   791
         --> [UNext memCh mm (resbar rmhist) p]_(rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   792
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   793
  apply (rule unchanged_safeI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   794
  apply (rule idle_squareI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   795
  apply (auto dest!: Step1_2_1 [temp_use] Step1_4_1 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   796
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   797
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   798
lemma S2safe: "|- $S2 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   799
         --> [UNext memCh mm (resbar rmhist) p]_(rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   800
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   801
  apply (rule unchanged_safeI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   802
  apply (rule idle_squareI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   803
  apply (auto dest!: Step1_2_2 [temp_use] Step1_4_2 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   804
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   805
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   806
lemma S3safe: "|- $S3 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   807
         --> [UNext memCh mm (resbar rmhist) p]_(rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   808
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   809
  apply (rule unchanged_safeI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   810
  apply (auto dest!: Step1_2_3 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   811
  apply (auto simp: square_def UNext_def dest!: Step1_4_3a [temp_use] Step1_4_3b [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   812
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   813
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   814
lemma S4safe: "|- $S4 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   815
         & (!l. $(MemInv mm l))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   816
         --> [UNext memCh mm (resbar rmhist) p]_(rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   817
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   818
  apply (rule unchanged_safeI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   819
  apply (auto dest!: Step1_2_4 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   820
     apply (auto simp: square_def UNext_def RNext_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   821
       dest!: Step1_4_4a [temp_use] Step1_4_4b [temp_use] Step1_4_4c [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   822
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   823
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   824
lemma S5safe: "|- $S5 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   825
         --> [UNext memCh mm (resbar rmhist) p]_(rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   826
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   827
  apply (rule unchanged_safeI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   828
  apply (auto dest!: Step1_2_5 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   829
  apply (auto simp: square_def UNext_def dest!: Step1_4_5a [temp_use] Step1_4_5b [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   830
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   831
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   832
lemma S6safe: "|- $S6 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   833
         --> [UNext memCh mm (resbar rmhist) p]_(rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   834
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   835
  apply (rule unchanged_safeI)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   836
  apply (auto dest!: Step1_2_6 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   837
    apply (auto simp: square_def UNext_def RNext_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   838
      dest!: Step1_4_6a [temp_use] Step1_4_6b [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   839
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   840
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   841
(* ----------------------------------------------------------------------
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   842
   Step 1.5: Temporal refinement proof, based on previous steps.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   843
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   844
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   845
section "The liveness part"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   846
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   847
(* Liveness assertions for the different implementation states, based on the
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   848
   fairness conditions. Prove subgoals of WF1 / SF1 rules as separate lemmas
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   849
   for readability. Reuse action proofs from safety part.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   850
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   851
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   852
(* ------------------------------ State S1 ------------------------------ *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   853
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   854
lemma S1_successors: "|- $S1 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   855
         --> (S1 rmhist p)$ | (S2 rmhist p)$"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   856
  apply (tactic "split_idle_tac @{context} [] 1")
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   857
  apply (auto dest!: Step1_2_1 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   858
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   859
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   860
(* Show that the implementation can satisfy the high-level fairness requirements
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   861
   by entering the state S1 infinitely often.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   862
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   863
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   864
lemma S1_RNextdisabled: "|- S1 rmhist p -->
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   865
         ~Enabled (<RNext memCh mm (resbar rmhist) p>_(rtrner memCh!p, resbar rmhist!p))"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   866
  apply (tactic {* action_simp_tac (@{simpset} addsimps [thm "angle_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   867
    thm "S_def", thm "S1_def"]) [notI] [thm "enabledE", temp_elim (thm "Memoryidle")] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   868
  apply force
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   869
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   870
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   871
lemma S1_Returndisabled: "|- S1 rmhist p -->
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   872
         ~Enabled (<MemReturn memCh (resbar rmhist) p>_(rtrner memCh!p, resbar rmhist!p))"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
   873
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "angle_def", thm "MemReturn_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   874
    thm "Return_def", thm "S_def", thm "S1_def"]) [notI] [thm "enabledE"] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   875
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   876
lemma RNext_fair: "|- []<>S1 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   877
         --> WF(RNext memCh mm (resbar rmhist) p)_(rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   878
  by (auto simp: WF_alt [try_rewrite] intro!: S1_RNextdisabled [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   879
    elim!: STL4E [temp_use] DmdImplE [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   880
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   881
lemma Return_fair: "|- []<>S1 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   882
         --> WF(MemReturn memCh (resbar rmhist) p)_(rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   883
  by (auto simp: WF_alt [try_rewrite]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   884
    intro!: S1_Returndisabled [temp_use] elim!: STL4E [temp_use] DmdImplE [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   885
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   886
(* ------------------------------ State S2 ------------------------------ *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   887
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   888
lemma S2_successors: "|- $S2 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   889
         --> (S2 rmhist p)$ | (S3 rmhist p)$"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   890
  apply (tactic "split_idle_tac @{context} [] 1")
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   891
  apply (auto dest!: Step1_2_2 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   892
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   893
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   894
lemma S2MClkFwd_successors: "|- ($S2 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   895
         & <MClkFwd memCh crCh cst p>_(c p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   896
         --> (S3 rmhist p)$"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   897
  by (auto simp: angle_def dest!: Step1_2_2 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   898
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   899
lemma S2MClkFwd_enabled: "|- $S2 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   900
         --> $Enabled (<MClkFwd memCh crCh cst p>_(c p))"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   901
  apply (auto simp: c_def intro!: MClkFwd_ch_enabled [temp_use] MClkFwd_enabled [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   902
     apply (cut_tac MI_base)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   903
     apply (blast dest: base_pair)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   904
    apply (simp_all add: S_def S2_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   905
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   906
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   907
lemma S2_live: "|- [](ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   908
         & WF(MClkFwd memCh crCh cst p)_(c p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   909
         --> (S2 rmhist p ~> S3 rmhist p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   910
  by (rule WF1 S2_successors S2MClkFwd_successors S2MClkFwd_enabled)+
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   911
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   912
(* ------------------------------ State S3 ------------------------------ *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   913
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   914
lemma S3_successors: "|- $S3 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   915
         --> (S3 rmhist p)$ | (S4 rmhist p | S6 rmhist p)$"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   916
  apply (tactic "split_idle_tac @{context} [] 1")
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   917
  apply (auto dest!: Step1_2_3 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   918
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   919
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   920
lemma S3RPC_successors: "|- ($S3 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   921
         & <RPCNext crCh rmCh rst p>_(r p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   922
         --> (S4 rmhist p | S6 rmhist p)$"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   923
  apply (auto simp: angle_def dest!: Step1_2_3 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   924
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   925
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   926
lemma S3RPC_enabled: "|- $S3 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   927
         --> $Enabled (<RPCNext crCh rmCh rst p>_(r p))"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   928
  apply (auto simp: r_def intro!: RPCFail_Next_enabled [temp_use] RPCFail_enabled [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   929
    apply (cut_tac MI_base)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   930
    apply (blast dest: base_pair)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   931
   apply (simp_all add: S_def S3_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   932
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   933
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   934
lemma S3_live: "|- [](ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   935
         & WF(RPCNext crCh rmCh rst p)_(r p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   936
         --> (S3 rmhist p ~> S4 rmhist p | S6 rmhist p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   937
  by (rule WF1 S3_successors S3RPC_successors S3RPC_enabled)+
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   938
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   939
(* ------------- State S4 -------------------------------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   940
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   941
lemma S4_successors: "|- $S4 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   942
        & (ALL l. $MemInv mm l)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   943
        --> (S4 rmhist p)$ | (S5 rmhist p)$"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   944
  apply (tactic "split_idle_tac @{context} [] 1")
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   945
  apply (auto dest!: Step1_2_4 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   946
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   947
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   948
(* --------- State S4a: S4 /\ (ires p = NotAResult) ------------------------ *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   949
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   950
lemma S4a_successors: "|- $(S4 rmhist p & ires!p = #NotAResult)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   951
         & ImpNext p & [HNext rmhist p]_(c p,r p,m p,rmhist!p) & (ALL l. $MemInv mm l)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   952
         --> (S4 rmhist p & ires!p = #NotAResult)$
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   953
             | ((S4 rmhist p & ires!p ~= #NotAResult) | S5 rmhist p)$"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   954
  apply (tactic {* split_idle_tac @{context} [thm "m_def"] 1 *})
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   955
  apply (auto dest!: Step1_2_4 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   956
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   957
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   958
lemma S4aRNext_successors: "|- ($(S4 rmhist p & ires!p = #NotAResult)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   959
         & ImpNext p & [HNext rmhist p]_(c p,r p,m p,rmhist!p) & (ALL l. $MemInv mm l))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   960
         & <RNext rmCh mm ires p>_(m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   961
         --> ((S4 rmhist p & ires!p ~= #NotAResult) | S5 rmhist p)$"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   962
  by (auto simp: angle_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   963
    dest!: Step1_2_4 [temp_use] ReadResult [temp_use] WriteResult [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   964
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   965
lemma S4aRNext_enabled: "|- $(S4 rmhist p & ires!p = #NotAResult)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   966
         & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p) & (ALL l. $MemInv mm l)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   967
         --> $Enabled (<RNext rmCh mm ires p>_(m p))"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   968
  apply (auto simp: m_def intro!: RNext_enabled [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   969
   apply (cut_tac MI_base)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   970
   apply (blast dest: base_pair)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   971
  apply (simp add: S_def S4_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   972
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   973
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   974
lemma S4a_live: "|- [](ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   975
         & (ALL l. $MemInv mm l)) & WF(RNext rmCh mm ires p)_(m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   976
         --> (S4 rmhist p & ires!p = #NotAResult
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   977
              ~> (S4 rmhist p & ires!p ~= #NotAResult) | S5 rmhist p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   978
  by (rule WF1 S4a_successors S4aRNext_successors S4aRNext_enabled)+
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   979
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   980
(* ---------- State S4b: S4 /\ (ires p # NotAResult) --------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   981
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   982
lemma S4b_successors: "|- $(S4 rmhist p & ires!p ~= #NotAResult)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   983
         & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p) & (ALL l. $MemInv mm l)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   984
         --> (S4 rmhist p & ires!p ~= #NotAResult)$ | (S5 rmhist p)$"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
   985
  apply (tactic {* split_idle_tac @{context} [thm "m_def"] 1 *})
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   986
  apply (auto dest!: WriteResult [temp_use] Step1_2_4 [temp_use] ReadResult [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   987
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   988
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   989
lemma S4bReturn_successors: "|- ($(S4 rmhist p & ires!p ~= #NotAResult)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   990
         & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   991
         & (ALL l. $MemInv mm l)) & <MemReturn rmCh ires p>_(m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   992
         --> (S5 rmhist p)$"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   993
  by (force simp: angle_def dest!: Step1_2_4 [temp_use] dest: ReturnNotReadWrite [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   994
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   995
lemma S4bReturn_enabled: "|- $(S4 rmhist p & ires!p ~= #NotAResult)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   996
         & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   997
         & (ALL l. $MemInv mm l)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   998
         --> $Enabled (<MemReturn rmCh ires p>_(m p))"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
   999
  apply (auto simp: m_def intro!: MemReturn_enabled [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1000
   apply (cut_tac MI_base)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1001
   apply (blast dest: base_pair)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1002
  apply (simp add: S_def S4_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1003
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1004
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1005
lemma S4b_live: "|- [](ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p) & (!l. $MemInv mm l))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1006
         & WF(MemReturn rmCh ires p)_(m p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1007
         --> (S4 rmhist p & ires!p ~= #NotAResult ~> S5 rmhist p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1008
  by (rule WF1 S4b_successors S4bReturn_successors S4bReturn_enabled)+
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1009
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1010
(* ------------------------------ State S5 ------------------------------ *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1011
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1012
lemma S5_successors: "|- $S5 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1013
         --> (S5 rmhist p)$ | (S6 rmhist p)$"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
  1014
  apply (tactic "split_idle_tac @{context} [] 1")
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1015
  apply (auto dest!: Step1_2_5 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1016
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1017
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1018
lemma S5RPC_successors: "|- ($S5 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1019
         & <RPCNext crCh rmCh rst p>_(r p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1020
         --> (S6 rmhist p)$"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1021
  by (auto simp: angle_def dest!: Step1_2_5 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1022
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1023
lemma S5RPC_enabled: "|- $S5 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1024
         --> $Enabled (<RPCNext crCh rmCh rst p>_(r p))"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1025
  apply (auto simp: r_def intro!: RPCFail_Next_enabled [temp_use] RPCFail_enabled [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1026
    apply (cut_tac MI_base)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1027
    apply (blast dest: base_pair)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1028
   apply (simp_all add: S_def S5_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1029
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1030
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1031
lemma S5_live: "|- [](ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1032
         & WF(RPCNext crCh rmCh rst p)_(r p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1033
         --> (S5 rmhist p ~> S6 rmhist p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1034
  by (rule WF1 S5_successors S5RPC_successors S5RPC_enabled)+
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1035
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1036
(* ------------------------------ State S6 ------------------------------ *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1037
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1038
lemma S6_successors: "|- $S6 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1039
         --> (S1 rmhist p)$ | (S3 rmhist p)$ | (S6 rmhist p)$"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
  1040
  apply (tactic "split_idle_tac @{context} [] 1")
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1041
  apply (auto dest!: Step1_2_6 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1042
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1043
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1044
lemma S6MClkReply_successors:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1045
  "|- ($S6 rmhist p & ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1046
         & <MClkReply memCh crCh cst p>_(c p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1047
         --> (S1 rmhist p)$"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1048
  by (auto simp: angle_def dest!: Step1_2_6 [temp_use] MClkReplyNotRetry [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1049
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1050
lemma MClkReplyS6:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1051
  "|- $ImpInv rmhist p & <MClkReply memCh crCh cst p>_(c p) --> $S6 rmhist p"
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
  1052
  by (tactic {* action_simp_tac (@{simpset} addsimps [thm "angle_def",
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1053
    thm "MClkReply_def", thm "Return_def", thm "ImpInv_def", thm "S_def",
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1054
    thm "S1_def", thm "S2_def", thm "S3_def", thm "S4_def", thm "S5_def"]) [] [] 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1055
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1056
lemma S6MClkReply_enabled: "|- S6 rmhist p --> Enabled (<MClkReply memCh crCh cst p>_(c p))"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1057
  apply (auto simp: c_def intro!: MClkReply_enabled [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1058
     apply (cut_tac MI_base)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1059
     apply (blast dest: base_pair)
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
  1060
    apply (tactic {* ALLGOALS (action_simp_tac (@{simpset}
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1061
      addsimps [thm "S_def", thm "S6_def"]) [] []) *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1062
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1063
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1064
lemma S6_live: "|- [](ImpNext p & [HNext rmhist p]_(c p,r p,m p, rmhist!p) & $(ImpInv rmhist p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1065
         & SF(MClkReply memCh crCh cst p)_(c p) & []<>(S6 rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1066
         --> []<>(S1 rmhist p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1067
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1068
  apply (subgoal_tac "sigma |= []<> (<MClkReply memCh crCh cst p>_ (c p))")
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1069
   apply (erule InfiniteEnsures)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1070
    apply assumption
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
  1071
   apply (tactic {* action_simp_tac @{simpset} []
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1072
     (map temp_elim [thm "MClkReplyS6", thm "S6MClkReply_successors"]) 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1073
  apply (auto simp: SF_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1074
  apply (erule contrapos_np)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1075
  apply (auto intro!: S6MClkReply_enabled [temp_use] elim!: STL4E [temp_use] DmdImplE [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1076
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1077
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1078
(* --------------- aggregate leadsto properties----------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1079
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1080
lemma S5S6LeadstoS6: "sigma |= S5 rmhist p ~> S6 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1081
      ==> sigma |= (S5 rmhist p | S6 rmhist p) ~> S6 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1082
  by (auto intro!: LatticeDisjunctionIntro [temp_use] LatticeReflexivity [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1083
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1084
lemma S4bS5S6LeadstoS6: "[| sigma |= S4 rmhist p & ires!p ~= #NotAResult ~> S5 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1085
         sigma |= S5 rmhist p ~> S6 rmhist p |]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1086
      ==> sigma |= (S4 rmhist p & ires!p ~= #NotAResult) | S5 rmhist p | S6 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1087
                    ~> S6 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1088
  by (auto intro!: LatticeDisjunctionIntro [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1089
    S5S6LeadstoS6 [temp_use] intro: LatticeTransitivity [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1090
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1091
lemma S4S5S6LeadstoS6: "[| sigma |= S4 rmhist p & ires!p = #NotAResult
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1092
                  ~> (S4 rmhist p & ires!p ~= #NotAResult) | S5 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1093
         sigma |= S4 rmhist p & ires!p ~= #NotAResult ~> S5 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1094
         sigma |= S5 rmhist p ~> S6 rmhist p |]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1095
      ==> sigma |= S4 rmhist p | S5 rmhist p | S6 rmhist p ~> S6 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1096
  apply (subgoal_tac "sigma |= (S4 rmhist p & ires!p = #NotAResult) |
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1097
    (S4 rmhist p & ires!p ~= #NotAResult) | S5 rmhist p | S6 rmhist p ~> S6 rmhist p")
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1098
   apply (erule_tac G = "PRED ((S4 rmhist p & ires!p = #NotAResult) |
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1099
     (S4 rmhist p & ires!p ~= #NotAResult) | S5 rmhist p | S6 rmhist p)" in
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1100
     LatticeTransitivity [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1101
   apply (force simp: Init_defs intro!: ImplLeadsto_gen [temp_use] necT [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1102
  apply (rule LatticeDisjunctionIntro [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1103
   apply (erule LatticeTransitivity [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1104
   apply (erule LatticeTriangle2 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1105
   apply assumption
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1106
  apply (auto intro!: S4bS5S6LeadstoS6 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1107
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1108
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1109
lemma S3S4S5S6LeadstoS6: "[| sigma |= S3 rmhist p ~> S4 rmhist p | S6 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1110
         sigma |= S4 rmhist p & ires!p = #NotAResult
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1111
                  ~> (S4 rmhist p & ires!p ~= #NotAResult) | S5 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1112
         sigma |= S4 rmhist p & ires!p ~= #NotAResult ~> S5 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1113
         sigma |= S5 rmhist p ~> S6 rmhist p |]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1114
      ==> sigma |= S3 rmhist p | S4 rmhist p | S5 rmhist p | S6 rmhist p ~> S6 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1115
  apply (rule LatticeDisjunctionIntro [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1116
   apply (erule LatticeTriangle2 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1117
   apply (rule S4S5S6LeadstoS6 [THEN LatticeTransitivity [temp_use]])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1118
      apply (auto intro!: S4S5S6LeadstoS6 [temp_use] necT [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1119
        intro: ImplLeadsto_gen [temp_use] simp: Init_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1120
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1121
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1122
lemma S2S3S4S5S6LeadstoS6: "[| sigma |= S2 rmhist p ~> S3 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1123
         sigma |= S3 rmhist p ~> S4 rmhist p | S6 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1124
         sigma |= S4 rmhist p & ires!p = #NotAResult
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1125
                  ~> S4 rmhist p & ires!p ~= #NotAResult | S5 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1126
         sigma |= S4 rmhist p & ires!p ~= #NotAResult ~> S5 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1127
         sigma |= S5 rmhist p ~> S6 rmhist p |]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1128
      ==> sigma |= S2 rmhist p | S3 rmhist p | S4 rmhist p | S5 rmhist p | S6 rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1129
                   ~> S6 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1130
  apply (rule LatticeDisjunctionIntro [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1131
   apply (rule LatticeTransitivity [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1132
    prefer 2 apply assumption
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1133
   apply (rule S3S4S5S6LeadstoS6 [THEN LatticeTransitivity [temp_use]])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1134
       apply (auto intro!: S3S4S5S6LeadstoS6 [temp_use] necT [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1135
         intro: ImplLeadsto_gen [temp_use] simp: Init_defs)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1136
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1137
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1138
lemma NotS1LeadstoS6: "[| sigma |= []ImpInv rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1139
         sigma |= S2 rmhist p ~> S3 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1140
         sigma |= S3 rmhist p ~> S4 rmhist p | S6 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1141
         sigma |= S4 rmhist p & ires!p = #NotAResult
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1142
                  ~> S4 rmhist p & ires!p ~= #NotAResult | S5 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1143
         sigma |= S4 rmhist p & ires!p ~= #NotAResult ~> S5 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1144
         sigma |= S5 rmhist p ~> S6 rmhist p |]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1145
      ==> sigma |= ~S1 rmhist p ~> S6 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1146
  apply (rule S2S3S4S5S6LeadstoS6 [THEN LatticeTransitivity [temp_use]])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1147
       apply assumption+
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1148
  apply (erule INV_leadsto [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1149
  apply (rule ImplLeadsto_gen [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1150
  apply (rule necT [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1151
  apply (auto simp: ImpInv_def Init_defs intro!: necT [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1152
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1153
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1154
lemma S1Infinite: "[| sigma |= ~S1 rmhist p ~> S6 rmhist p;
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1155
         sigma |= []<>S6 rmhist p --> []<>S1 rmhist p |]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1156
      ==> sigma |= []<>S1 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1157
  apply (rule classical)
26342
0f65fa163304 more antiquotations;
wenzelm
parents: 24180
diff changeset
  1158
  apply (tactic {* asm_lr_simp_tac (@{simpset} addsimps
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1159
    [temp_use (thm "NotBox"), temp_rewrite (thm "NotDmd")]) 1 *})
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1160
  apply (auto elim!: leadsto_infinite [temp_use] mp dest!: DBImplBD [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1161
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1162
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1163
section "Refinement proof (step 1.5)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1164
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1165
(* Prove invariants of the implementation:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1166
   a. memory invariant
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1167
   b. "implementation invariant": always in states S1,...,S6
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1168
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1169
lemma Step1_5_1a: "|- IPImp p --> (ALL l. []$MemInv mm l)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1170
  by (auto simp: IPImp_def box_stp_act [temp_use] intro!: MemoryInvariantAll [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1171
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1172
lemma Step1_5_1b: "|- Init(ImpInit p & HInit rmhist p) & [](ImpNext p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1173
         & [][HNext rmhist p]_(c p, r p, m p, rmhist!p) & [](ALL l. $MemInv mm l)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1174
         --> []ImpInv rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1175
  apply (tactic "inv_tac MI_css 1")
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1176
   apply (auto simp: Init_def ImpInv_def box_stp_act [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1177
     dest!: Step1_1 [temp_use] dest: S1_successors [temp_use] S2_successors [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1178
     S3_successors [temp_use] S4_successors [temp_use] S5_successors [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1179
     S6_successors [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1180
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1181
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1182
(*** Initialization ***)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1183
lemma Step1_5_2a: "|- Init(ImpInit p & HInit rmhist p) --> Init(PInit (resbar rmhist) p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1184
  by (auto simp: Init_def intro!: Step1_1 [temp_use] Step1_3  [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1185
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1186
(*** step simulation ***)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1187
lemma Step1_5_2b: "|- [](ImpNext p & [HNext rmhist p]_(c p, r p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1188
         & $ImpInv rmhist p & (!l. $MemInv mm l))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1189
         --> [][UNext memCh mm (resbar rmhist) p]_(rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1190
  by (auto simp: ImpInv_def elim!: STL4E [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1191
    dest!: S1safe [temp_use] S2safe [temp_use] S3safe [temp_use] S4safe [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1192
    S5safe [temp_use] S6safe [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1193
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1194
(*** Liveness ***)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1195
lemma GoodImpl: "|- IPImp p & HistP rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1196
         -->   Init(ImpInit p & HInit rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1197
             & [](ImpNext p & [HNext rmhist p]_(c p, r p, m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1198
             & [](ALL l. $MemInv mm l) & []($ImpInv rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1199
             & ImpLive p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1200
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1201
    apply (subgoal_tac "sigma |= Init (ImpInit p & HInit rmhist p) & [] (ImpNext p) &
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1202
      [][HNext rmhist p]_ (c p, r p, m p, rmhist!p) & [] (ALL l. $MemInv mm l)")
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1203
   apply (auto simp: split_box_conj [try_rewrite] box_stp_act [try_rewrite]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1204
       dest!: Step1_5_1b [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1205
      apply (force simp: IPImp_def MClkIPSpec_def RPCIPSpec_def RPSpec_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1206
        ImpLive_def c_def r_def m_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1207
      apply (force simp: IPImp_def MClkIPSpec_def RPCIPSpec_def RPSpec_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1208
        HistP_def Init_def ImpInit_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1209
    apply (force simp: IPImp_def MClkIPSpec_def RPCIPSpec_def RPSpec_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1210
      ImpNext_def c_def r_def m_def split_box_conj [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1211
   apply (force simp: HistP_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1212
  apply (force simp: allT [temp_use] dest!: Step1_5_1a [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1213
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1214
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1215
(* The implementation is infinitely often in state S1... *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1216
lemma Step1_5_3a: "|- [](ImpNext p & [HNext rmhist p]_(c p, r p, m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1217
         & [](ALL l. $MemInv mm l)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1218
         & []($ImpInv rmhist p) & ImpLive p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1219
         --> []<>S1 rmhist p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1220
  apply (clarsimp simp: ImpLive_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1221
  apply (rule S1Infinite)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1222
   apply (force simp: split_box_conj [try_rewrite] box_stp_act [try_rewrite]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1223
     intro!: NotS1LeadstoS6 [temp_use] S2_live [temp_use] S3_live [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1224
     S4a_live [temp_use] S4b_live [temp_use] S5_live [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1225
  apply (auto simp: split_box_conj [temp_use] intro!: S6_live [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1226
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1227
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1228
(* ... and therefore satisfies the fairness requirements of the specification *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1229
lemma Step1_5_3b: "|- [](ImpNext p & [HNext rmhist p]_(c p, r p, m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1230
         & [](ALL l. $MemInv mm l) & []($ImpInv rmhist p) & ImpLive p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1231
         --> WF(RNext memCh mm (resbar rmhist) p)_(rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1232
  by (auto intro!: RNext_fair [temp_use] Step1_5_3a [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1233
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1234
lemma Step1_5_3c: "|- [](ImpNext p & [HNext rmhist p]_(c p, r p, m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1235
         & [](ALL l. $MemInv mm l) & []($ImpInv rmhist p) & ImpLive p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1236
         --> WF(MemReturn memCh (resbar rmhist) p)_(rtrner memCh!p, resbar rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1237
  by (auto intro!: Return_fair [temp_use] Step1_5_3a [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1238
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1239
(* QED step of step 1 *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1240
lemma Step1: "|- IPImp p & HistP rmhist p --> UPSpec memCh mm (resbar rmhist) p"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1241
  by (auto simp: UPSpec_def split_box_conj [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1242
    dest!: GoodImpl [temp_use] intro!: Step1_5_2a [temp_use] Step1_5_2b [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1243
    Step1_5_3b [temp_use] Step1_5_3c [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1244
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1245
(* ------------------------------ Step 2 ------------------------------ *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1246
section "Step 2"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1247
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1248
lemma Step2_2a: "|- Write rmCh mm ires p l & ImpNext p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1249
         & [HNext rmhist p]_(c p, r p, m p, rmhist!p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1250
         & $ImpInv rmhist p
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1251
         --> (S4 rmhist p)$ & unchanged (e p, c p, r p, rmhist!p)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1252
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1253
  apply (drule WriteS4 [action_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1254
   apply assumption
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 27117
diff changeset
  1255
  apply (tactic "split_idle_tac @{context} [] 1")
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1256
  apply (auto simp: ImpNext_def dest!: S4EnvUnch [temp_use] S4ClerkUnch [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1257
    S4RPCUnch [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1258
     apply (auto simp: square_def dest: S4Write [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1259
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1260
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1261
lemma Step2_2: "|-   (ALL p. ImpNext p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1262
         & (ALL p. [HNext rmhist p]_(c p, r p, m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1263
         & (ALL p. $ImpInv rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1264
         & [EX q. Write rmCh mm ires q l]_(mm!l)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1265
         --> [EX q. Write memCh mm (resbar rmhist) q l]_(mm!l)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1266
  apply (auto intro!: squareCI elim!: squareE)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1267
  apply (assumption | rule exI Step1_4_4b [action_use])+
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1268
    apply (force intro!: WriteS4 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1269
   apply (auto dest!: Step2_2a [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1270
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1271
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1272
lemma Step2_lemma: "|- [](  (ALL p. ImpNext p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1273
            & (ALL p. [HNext rmhist p]_(c p, r p, m p, rmhist!p))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1274
            & (ALL p. $ImpInv rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1275
            & [EX q. Write rmCh mm ires q l]_(mm!l))
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1276
         --> [][EX q. Write memCh mm (resbar rmhist) q l]_(mm!l)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1277
  by (force elim!: STL4E [temp_use] dest!: Step2_2 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1278
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1279
lemma Step2: "|- #l : #MemLoc & (ALL p. IPImp p & HistP rmhist p)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1280
         --> MSpec memCh mm (resbar rmhist) l"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1281
  apply (auto simp: MSpec_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1282
   apply (force simp: IPImp_def MSpec_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1283
  apply (auto intro!: Step2_lemma [temp_use] simp: split_box_conj [temp_use] all_box [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1284
     prefer 4
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1285
     apply (force simp: IPImp_def MSpec_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1286
    apply (auto simp: split_box_conj [temp_use] elim!: allE dest!: GoodImpl [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1287
  done
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1288
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1289
(* ----------------------------- Main theorem --------------------------------- *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1290
section "Memory implementation"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1291
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1292
(* The combination of a legal caller, the memory clerk, the RPC component,
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1293
   and a reliable memory implement the unreliable memory.
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1294
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1295
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1296
(* Implementation of internal specification by combination of implementation
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1297
   and history variable with explicit refinement mapping
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1298
*)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1299
lemma Impl_IUSpec: "|- Implementation & Hist rmhist --> IUSpec memCh mm (resbar rmhist)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1300
  by (auto simp: IUSpec_def Implementation_def IPImp_def MClkISpec_def
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1301
    RPCISpec_def IRSpec_def Hist_def intro!: Step1 [temp_use] Step2 [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1302
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1303
(* The main theorem: introduce hiding and eliminate history variable. *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1304
lemma Implementation: "|- Implementation --> USpec memCh"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1305
  apply clarsimp
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1306
  apply (frule History [temp_use])
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1307
  apply (auto simp: USpec_def intro: eexI [temp_use] Impl_IUSpec [temp_use]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1308
    MI_base [temp_use] elim!: eexE)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
  1309
  done
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
  1310
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
  1311
end