src/HOL/TLA/Init.thy
author wenzelm
Thu, 11 Feb 2010 21:31:50 +0100
changeset 35108 e384e27c229f
parent 26304 02fbd0e7954a
child 35318 e1b61c5fd494
permissions -rw-r--r--
modernized syntax/translations; tuned headers;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35108
e384e27c229f modernized syntax/translations;
wenzelm
parents: 26304
diff changeset
     1
(*  Title:      HOL/TLA/Init.thy
e384e27c229f modernized syntax/translations;
wenzelm
parents: 26304
diff changeset
     2
    Author:     Stephan Merz
e384e27c229f modernized syntax/translations;
wenzelm
parents: 26304
diff changeset
     3
    Copyright:  1998 University of Munich
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
     4
35108
e384e27c229f modernized syntax/translations;
wenzelm
parents: 26304
diff changeset
     5
Introduces type of temporal formulas.  Defines interface between
e384e27c229f modernized syntax/translations;
wenzelm
parents: 26304
diff changeset
     6
temporal formulas and its "subformulas" (state predicates and
e384e27c229f modernized syntax/translations;
wenzelm
parents: 26304
diff changeset
     7
actions).
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
     8
*)
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
     9
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    10
theory Init
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    11
imports Action
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    12
begin
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    13
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    14
typedecl behavior
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    15
instance behavior :: world ..
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    16
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    17
types
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    18
  temporal = "behavior form"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    19
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    20
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    21
consts
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    22
  Initial     :: "('w::world => bool) => temporal"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    23
  first_world :: "behavior => ('w::world)"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    24
  st1         :: "behavior => state"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    25
  st2         :: "behavior => state"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    26
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    27
syntax
35108
e384e27c229f modernized syntax/translations;
wenzelm
parents: 26304
diff changeset
    28
  "_TEMP"    :: "lift => 'a"                          ("(TEMP _)")
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    29
  "_Init"    :: "lift => lift"                        ("(Init _)"[40] 50)
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    30
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    31
translations
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    32
  "TEMP F"   => "(F::behavior => _)"
35108
e384e27c229f modernized syntax/translations;
wenzelm
parents: 26304
diff changeset
    33
  "_Init"    == "CONST Initial"
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    34
  "sigma |= Init F"  <= "_Init F sigma"
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    35
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    36
defs
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    37
  Init_def:    "sigma |= Init F  ==  (first_world sigma) |= F"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    38
  fw_temp_def: "first_world == %sigma. sigma"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    39
  fw_stp_def:  "first_world == st1"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    40
  fw_act_def:  "first_world == %sigma. (st1 sigma, st2 sigma)"
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    41
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    42
lemma const_simps [int_rewrite, simp]:
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    43
  "|- (Init #True) = #True"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    44
  "|- (Init #False) = #False"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    45
  by (auto simp: Init_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    46
26304
02fbd0e7954a avoid rebinding of existing facts;
wenzelm
parents: 21624
diff changeset
    47
lemma Init_simps1 [int_rewrite]:
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    48
  "!!F. |- (Init ~F) = (~ Init F)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    49
  "|- (Init (P --> Q)) = (Init P --> Init Q)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    50
  "|- (Init (P & Q)) = (Init P & Init Q)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    51
  "|- (Init (P | Q)) = (Init P | Init Q)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    52
  "|- (Init (P = Q)) = ((Init P) = (Init Q))"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    53
  "|- (Init (!x. F x)) = (!x. (Init F x))"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    54
  "|- (Init (? x. F x)) = (? x. (Init F x))"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    55
  "|- (Init (?! x. F x)) = (?! x. (Init F x))"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    56
  by (auto simp: Init_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    57
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    58
lemma Init_stp_act: "|- (Init $P) = (Init P)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    59
  by (auto simp add: Init_def fw_act_def fw_stp_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    60
26304
02fbd0e7954a avoid rebinding of existing facts;
wenzelm
parents: 21624
diff changeset
    61
lemmas Init_simps2 = Init_stp_act [int_rewrite] Init_simps1
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    62
lemmas Init_stp_act_rev = Init_stp_act [int_rewrite, symmetric]
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    63
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    64
lemma Init_temp: "|- (Init F) = F"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    65
  by (auto simp add: Init_def fw_temp_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    66
26304
02fbd0e7954a avoid rebinding of existing facts;
wenzelm
parents: 21624
diff changeset
    67
lemmas Init_simps = Init_temp [int_rewrite] Init_simps2
21624
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    68
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    69
(* Trivial instances of the definitions that avoid introducing lambda expressions. *)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    70
lemma Init_stp: "(sigma |= Init P) = P (st1 sigma)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    71
  by (simp add: Init_def fw_stp_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    72
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    73
lemma Init_act: "(sigma |= Init A) = A (st1 sigma, st2 sigma)"
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    74
  by (simp add: Init_def fw_act_def)
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    75
6f79647cf536 TLA: converted legacy ML scripts;
wenzelm
parents: 17309
diff changeset
    76
lemmas Init_defs = Init_stp Init_act Init_temp [int_use]
17309
c43ed29bd197 converted to Isar theory format;
wenzelm
parents: 12338
diff changeset
    77
6255
db63752140c7 updated (Stephan Merz);
wenzelm
parents:
diff changeset
    78
end