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