src/HOL/TLA/Buffer/Buffer.thy
author urbanc
Tue, 13 Dec 2005 18:11:21 +0100
changeset 18396 b3e7da94b51f
parent 17309 c43ed29bd197
child 21624 6f79647cf536
permissions -rw-r--r--
added a fresh_left lemma that contains all instantiation for the various atom-types.
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:        Buffer.thy
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
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
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     6
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     7
   Theory Name: Buffer
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     8
   Logic Image: TLA
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     9
*)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    10
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    11
header {* A simple FIFO buffer (synchronous communication, interleaving) *}
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    12
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    13
theory Buffer
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    14
imports TLA
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    15
begin
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    16
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    17
consts
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    18
  (* actions *)
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    19
  BInit     :: "'a stfun => 'a list stfun => 'a stfun => stpred"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    20
  Enq       :: "'a stfun => 'a list stfun => 'a stfun => action"
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    21
  Deq       :: "'a stfun => 'a list stfun => 'a stfun => action"
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    22
  Next      :: "'a stfun => 'a list stfun => 'a stfun => action"
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    23
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    24
  (* temporal formulas *)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    25
  IBuffer   :: "'a stfun => 'a list stfun => 'a stfun => temporal"
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    26
  Buffer    :: "'a stfun => 'a stfun => temporal"
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    27
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    28
defs
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    29
  BInit_def:   "BInit ic q oc    == PRED q = #[]"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    30
  Enq_def:     "Enq ic q oc      == ACT (ic$ ~= $ic)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    31
                                     & (q$ = $q @ [ ic$ ])
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    32
                                     & (oc$ = $oc)"
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    33
  Deq_def:     "Deq ic q oc      == ACT ($q ~= #[])
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    34
                                     & (oc$ = hd< $q >)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    35
                                     & (q$ = tl< $q >)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    36
                                     & (ic$ = $ic)"
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    37
  Next_def:    "Next ic q oc     == ACT (Enq ic q oc | Deq ic q oc)"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    38
  IBuffer_def: "IBuffer ic q oc  == TEMP Init (BInit ic q oc)
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    39
                                      & [][Next ic q oc]_(ic,q,oc)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3807
diff changeset
    40
                                      & WF(Deq ic q oc)_(ic,q,oc)"
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    41
  Buffer_def:  "Buffer ic oc     == TEMP (EEX q. IBuffer ic q oc)"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    42
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    43
ML {* use_legacy_bindings (the_context ()) *}
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    44
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 6255
diff changeset
    45
end