src/HOL/TLA/TLA.thy
author wenzelm
Sat, 21 Jan 2006 23:02:14 +0100
changeset 18728 6790126ab5f6
parent 17309 c43ed29bd197
child 21624 6f79647cf536
permissions -rw-r--r--
simplified type attribute;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
     1
(*
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     2
    File:        TLA/TLA.thy
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
     3
    ID:          $Id$
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     4
    Author:      Stephan Merz
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
     5
    Copyright:   1998 University of Munich
3807
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: TLA
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
     8
    Logic Image: HOL
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
The temporal level of TLA.
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    11
*)
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    12
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    13
theory TLA
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    14
imports Init
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
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
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    18
  (** abstract syntax **)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    19
  Box        :: "('w::world) form => temporal"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    20
  Dmd        :: "('w::world) form => temporal"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    21
  leadsto    :: "['w::world form, 'v::world form] => temporal"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    22
  Stable     :: "stpred => temporal"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    23
  WF         :: "[action, 'a stfun] => temporal"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    24
  SF         :: "[action, 'a stfun] => temporal"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    25
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    26
  (* Quantification over (flexible) state variables *)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    27
  EEx        :: "('a stfun => temporal) => temporal"       (binder "Eex " 10)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    28
  AAll       :: "('a stfun => temporal) => temporal"       (binder "Aall " 10)
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    29
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    30
  (** concrete syntax **)
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    31
syntax
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    32
  "_Box"     :: "lift => lift"                        ("([]_)" [40] 40)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    33
  "_Dmd"     :: "lift => lift"                        ("(<>_)" [40] 40)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    34
  "_leadsto" :: "[lift,lift] => lift"                 ("(_ ~> _)" [23,22] 22)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    35
  "_stable"  :: "lift => lift"                        ("(stable/ _)")
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    36
  "_WF"      :: "[lift,lift] => lift"                 ("(WF'(_')'_(_))" [0,60] 55)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    37
  "_SF"      :: "[lift,lift] => lift"                 ("(SF'(_')'_(_))" [0,60] 55)
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    38
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    39
  "_EEx"     :: "[idts, lift] => lift"                ("(3EEX _./ _)" [0,10] 10)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    40
  "_AAll"    :: "[idts, lift] => lift"                ("(3AALL _./ _)" [0,10] 10)
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    41
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    42
translations
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    43
  "_Box"      ==   "Box"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    44
  "_Dmd"      ==   "Dmd"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    45
  "_leadsto"  ==   "leadsto"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    46
  "_stable"   ==   "Stable"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    47
  "_WF"       ==   "WF"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    48
  "_SF"       ==   "SF"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    49
  "_EEx v A"  ==   "Eex v. A"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    50
  "_AAll v A" ==   "Aall v. A"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    51
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    52
  "sigma |= []F"         <= "_Box F sigma"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    53
  "sigma |= <>F"         <= "_Dmd F sigma"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    54
  "sigma |= F ~> G"      <= "_leadsto F G sigma"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    55
  "sigma |= stable P"    <= "_stable P sigma"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    56
  "sigma |= WF(A)_v"     <= "_WF A v sigma"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    57
  "sigma |= SF(A)_v"     <= "_SF A v sigma"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    58
  "sigma |= EEX x. F"    <= "_EEx x F sigma"
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    59
  "sigma |= AALL x. F"    <= "_AAll x F sigma"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    60
12114
a8e860c86252 eliminated old "symbols" syntax, use "xsymbols" instead;
wenzelm
parents: 9517
diff changeset
    61
syntax (xsymbols)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    62
  "_Box"     :: "lift => lift"                        ("(\<box>_)" [40] 40)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    63
  "_Dmd"     :: "lift => lift"                        ("(\<diamond>_)" [40] 40)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    64
  "_leadsto" :: "[lift,lift] => lift"                 ("(_ \<leadsto> _)" [23,22] 22)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    65
  "_EEx"     :: "[idts, lift] => lift"                ("(3\<exists>\<exists> _./ _)" [0,10] 10)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    66
  "_AAll"    :: "[idts, lift] => lift"                ("(3\<forall>\<forall> _./ _)" [0,10] 10)
3808
8489375c6198 symbols syntax;
wenzelm
parents: 3807
diff changeset
    67
14565
c6dc17aab88a use more symbols in HTML output
kleing
parents: 12114
diff changeset
    68
syntax (HTML output)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    69
  "_EEx"     :: "[idts, lift] => lift"                ("(3\<exists>\<exists> _./ _)" [0,10] 10)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    70
  "_AAll"    :: "[idts, lift] => lift"                ("(3\<forall>\<forall> _./ _)" [0,10] 10)
14565
c6dc17aab88a use more symbols in HTML output
kleing
parents: 12114
diff changeset
    71
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    72
axioms
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    73
  (* Definitions of derived operators *)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    74
  dmd_def:      "TEMP <>F  ==  TEMP ~[]~F"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    75
  boxInit:      "TEMP []F  ==  TEMP []Init F"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    76
  leadsto_def:  "TEMP F ~> G  ==  TEMP [](Init F --> <>G)"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    77
  stable_def:   "TEMP stable P  ==  TEMP []($P --> P$)"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    78
  WF_def:       "TEMP WF(A)_v  ==  TEMP <>[] Enabled(<A>_v) --> []<><A>_v"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    79
  SF_def:       "TEMP SF(A)_v  ==  TEMP []<> Enabled(<A>_v) --> []<><A>_v"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    80
  aall_def:     "TEMP (AALL x. F x)  ==  TEMP ~ (EEX x. ~ F x)"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    81
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
    82
(* Base axioms for raw TLA. *)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    83
  normalT:    "|- [](F --> G) --> ([]F --> []G)"    (* polymorphic *)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    84
  reflT:      "|- []F --> F"         (* F::temporal *)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    85
  transT:     "|- []F --> [][]F"     (* polymorphic *)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    86
  linT:       "|- <>F & <>G --> (<>(F & <>G)) | (<>(G & <>F))"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    87
  discT:      "|- [](F --> <>(~F & <>F)) --> (F --> []<>F)"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    88
  primeI:     "|- []P --> Init P`"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    89
  primeE:     "|- [](Init P --> []F) --> Init P` --> (F --> []F)"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    90
  indT:       "|- [](Init P & ~[]F --> Init P` & F) --> Init P --> []F"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    91
  allT:       "|- (ALL x. [](F x)) = ([](ALL x. F x))"
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    92
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    93
  necT:       "|- F ==> |- []F"      (* polymorphic *)
3807
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    94
82a99b090d9d A formalization of TLA in HOL -- by Stephan Merz;
wenzelm
parents:
diff changeset
    95
(* Flexible quantification: refinement mappings, history variables *)
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    96
  eexI:       "|- F x --> (EEX x. F x)"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    97
  eexE:       "[| sigma |= (EEX x. F x); basevars vs;
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    98
                 (!!x. [| basevars (x, vs); sigma |= F x |] ==> (G sigma)::bool)
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
    99
              |] ==> G sigma"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
   100
  history:    "|- EEX h. Init(h = ha) & [](!x. $h = #x --> h` = hb x)"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
   101
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
   102
ML {* use_legacy_bindings (the_context ()) *}
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 14565
diff changeset
   103
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents: 3808
diff changeset
   104
end