src/HOL/HOLCF/IOA/meta_theory/Automata.thy
author wenzelm
Wed, 30 Dec 2015 21:35:21 +0100
changeset 61999 89291b5d0ede
parent 59807 22bc39064290
child 62002 f1599e98c4d0
permissions -rw-r--r--
more symbols;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42151
4da4fc77664b tuned headers;
wenzelm
parents: 41476
diff changeset
     1
(*  Title:      HOL/HOLCF/IOA/meta_theory/Automata.thy
40945
b8703f63bfb2 recoded latin1 as utf8;
wenzelm
parents: 40774
diff changeset
     2
    Author:     Olaf Müller, Konrad Slind, Tobias Nipkow
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     3
*)
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
     4
58880
0baae4311a9f modernized header;
wenzelm
parents: 51686
diff changeset
     5
section {* The I/O automata of Lynch and Tuttle in HOLCF *}
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
     6
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     7
theory Automata
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     8
imports Asig
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     9
begin
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    10
36452
d37c6eed8117 renamed command 'defaultsort' to 'default_sort';
wenzelm
parents: 36176
diff changeset
    11
default_sort type
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    12
41476
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    13
type_synonym
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    14
  ('a, 's) transition = "'s * 'a * 's"
41476
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    15
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    16
type_synonym
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    17
  ('a, 's) ioa = "'a signature * 's set * ('a,'s)transition set * ('a set set) * ('a set set)"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    18
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    19
consts
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    20
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    21
  (* IO automata *)
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    22
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    23
  asig_of        ::"('a,'s)ioa => 'a signature"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    24
  starts_of      ::"('a,'s)ioa => 's set"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    25
  trans_of       ::"('a,'s)ioa => ('a,'s)transition set"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    26
  wfair_of       ::"('a,'s)ioa => ('a set) set"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    27
  sfair_of       ::"('a,'s)ioa => ('a set) set"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    28
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    29
  is_asig_of     ::"('a,'s)ioa => bool"
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    30
  is_starts_of   ::"('a,'s)ioa => bool"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    31
  is_trans_of    ::"('a,'s)ioa => bool"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    32
  input_enabled  ::"('a,'s)ioa => bool"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    33
  IOA            ::"('a,'s)ioa => bool"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    34
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    35
  (* constraints for fair IOA *)
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    36
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    37
  fairIOA        ::"('a,'s)ioa => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    38
  input_resistant::"('a,'s)ioa => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    39
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    40
  (* enabledness of actions and action sets *)
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    41
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    42
  enabled        ::"('a,'s)ioa => 'a => 's => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    43
  Enabled    ::"('a,'s)ioa => 'a set => 's => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    44
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    45
  (* action set keeps enabled until probably disabled by itself *)
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    46
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    47
  en_persistent  :: "('a,'s)ioa => 'a set => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    48
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    49
 (* post_conditions for actions and action sets *)
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    50
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    51
  was_enabled        ::"('a,'s)ioa => 'a => 's => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    52
  set_was_enabled    ::"('a,'s)ioa => 'a set => 's => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
    53
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 22808
diff changeset
    54
  (* invariants *)
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    55
  invariant     :: "[('a,'s)ioa, 's=>bool] => bool"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    56
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    57
  (* binary composition of action signatures and automata *)
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    58
  asig_comp    ::"['a signature, 'a signature] => 'a signature"
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    59
  compatible   ::"[('a,'s)ioa, ('a,'t)ioa] => bool"
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
    60
  par          ::"[('a,'s)ioa, ('a,'t)ioa] => ('a,'s*'t)ioa"  (infixr "\<parallel>" 10)
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    61
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    62
  (* hiding and restricting *)
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    63
  hide_asig     :: "['a signature, 'a set] => 'a signature"
36176
3fe7e97ccca8 replaced generic 'hide' command by more conventional 'hide_class', 'hide_type', 'hide_const', 'hide_fact' -- frees some popular keywords;
wenzelm
parents: 35174
diff changeset
    64
  hide          :: "[('a,'s)ioa, 'a set] => ('a,'s)ioa"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    65
  restrict_asig :: "['a signature, 'a set] => 'a signature"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    66
  restrict      :: "[('a,'s)ioa, 'a set] => ('a,'s)ioa"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    67
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    68
  (* renaming *)
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    69
  rename_set    :: "'a set => ('c => 'a option) => 'c set"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    70
  rename        :: "('a, 'b)ioa => ('c => 'a option) => ('c,'b)ioa"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    71
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    72
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 22808
diff changeset
    73
inductive
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 22808
diff changeset
    74
  reachable :: "('a, 's) ioa => 's => bool"
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 22808
diff changeset
    75
  for C :: "('a, 's) ioa"
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 22808
diff changeset
    76
  where
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 22808
diff changeset
    77
    reachable_0:  "s : starts_of C ==> reachable C s"
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 22808
diff changeset
    78
  | reachable_n:  "[| reachable C s; (s, a, t) : trans_of C |] ==> reachable C t"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    79
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    80
abbreviation
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    81
  trans_of_syn  ("_ -_--_-> _" [81,81,81,81] 100) where
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    82
  "s -a--A-> t == (s,a,t):trans_of A"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    83
25131
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    84
notation (xsymbols)
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    85
  trans_of_syn  ("_ \<midarrow>_\<midarrow>_\<longrightarrow> _" [81,81,81,81] 100)
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    86
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    87
abbreviation "act A == actions (asig_of A)"
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    88
abbreviation "ext A == externals (asig_of A)"
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    89
abbreviation int where "int A == internals (asig_of A)"
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    90
abbreviation "inp A == inputs (asig_of A)"
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    91
abbreviation "out A == outputs (asig_of A)"
2c8caac48ade modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents: 23778
diff changeset
    92
abbreviation "local A == locals (asig_of A)"
3433
2de17c994071 added deadlock freedom, polished definitions and proofs
mueller
parents: 3275
diff changeset
    93
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    94
defs
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    95
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    96
(* --------------------------------- IOA ---------------------------------*)
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    97
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    98
asig_of_def:   "asig_of == fst"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    99
starts_of_def: "starts_of == (fst o snd)"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   100
trans_of_def:  "trans_of == (fst o snd o snd)"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   101
wfair_of_def:  "wfair_of == (fst o snd o snd o snd)"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   102
sfair_of_def:  "sfair_of == (snd o snd o snd o snd)"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   103
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   104
is_asig_of_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   105
  "is_asig_of A == is_asig (asig_of A)"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   106
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   107
is_starts_of_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   108
  "is_starts_of A ==  (~ starts_of A = {})"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   109
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   110
is_trans_of_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   111
  "is_trans_of A ==
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   112
    (!triple. triple:(trans_of A) --> fst(snd(triple)):actions(asig_of A))"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   113
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   114
input_enabled_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   115
  "input_enabled A ==
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   116
    (!a. (a:inputs(asig_of A)) --> (!s1. ? s2. (s1,a,s2):(trans_of A)))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   117
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   118
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   119
ioa_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   120
  "IOA A == (is_asig_of A    &
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   121
             is_starts_of A  &
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   122
             is_trans_of A   &
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   123
             input_enabled A)"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   124
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   125
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   126
invariant_def: "invariant A P == (!s. reachable A s --> P(s))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   127
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   128
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   129
(* ------------------------- parallel composition --------------------------*)
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   130
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   131
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   132
compatible_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   133
  "compatible A B ==
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   134
  (((out A Int out B) = {}) &
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   135
   ((int A Int act B) = {}) &
3433
2de17c994071 added deadlock freedom, polished definitions and proofs
mueller
parents: 3275
diff changeset
   136
   ((int B Int act A) = {}))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   137
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   138
asig_comp_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   139
  "asig_comp a1 a2 ==
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   140
     (((inputs(a1) Un inputs(a2)) - (outputs(a1) Un outputs(a2)),
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   141
       (outputs(a1) Un outputs(a2)),
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   142
       (internals(a1) Un internals(a2))))"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   143
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   144
par_def:
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   145
  "(A \<parallel> B) ==
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   146
      (asig_comp (asig_of A) (asig_of B),
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   147
       {pr. fst(pr):starts_of(A) & snd(pr):starts_of(B)},
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   148
       {tr. let s = fst(tr); a = fst(snd(tr)); t = snd(snd(tr))
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   149
            in (a:act A | a:act B) &
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   150
               (if a:act A then
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   151
                  (fst(s),a,fst(t)):trans_of(A)
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   152
                else fst(t) = fst(s))
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   153
               &
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   154
               (if a:act B then
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   155
                  (snd(s),a,snd(t)):trans_of(B)
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   156
                else snd(t) = snd(s))},
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   157
        wfair_of A Un wfair_of B,
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   158
        sfair_of A Un sfair_of B)"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   159
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   160
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   161
(* ------------------------ hiding -------------------------------------------- *)
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   162
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   163
restrict_asig_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   164
  "restrict_asig asig actns ==
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   165
    (inputs(asig) Int actns,
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   166
     outputs(asig) Int actns,
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   167
     internals(asig) Un (externals(asig) - actns))"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   168
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   169
(* Notice that for wfair_of and sfair_of nothing has to be changed, as
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   170
   changes from the outputs to the internals does not touch the locals as
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   171
   a whole, which is of importance for fairness only *)
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   172
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   173
restrict_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   174
  "restrict A actns ==
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   175
    (restrict_asig (asig_of A) actns,
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   176
     starts_of A,
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   177
     trans_of A,
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   178
     wfair_of A,
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   179
     sfair_of A)"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   180
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   181
hide_asig_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   182
  "hide_asig asig actns ==
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   183
    (inputs(asig) - actns,
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   184
     outputs(asig) - actns,
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   185
     internals(asig) Un actns)"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   186
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   187
hide_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   188
  "hide A actns ==
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   189
    (hide_asig (asig_of A) actns,
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   190
     starts_of A,
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   191
     trans_of A,
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   192
     wfair_of A,
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   193
     sfair_of A)"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   194
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   195
(* ------------------------- renaming ------------------------------------------- *)
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   196
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   197
rename_set_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   198
  "rename_set A ren == {b. ? x. Some x = ren b & x : A}"
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   199
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   200
rename_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   201
"rename ioa ren ==
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   202
  ((rename_set (inp ioa) ren,
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   203
    rename_set (out ioa) ren,
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   204
    rename_set (int ioa) ren),
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   205
   starts_of ioa,
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   206
   {tr. let s = fst(tr); a = fst(snd(tr));  t = snd(snd(tr))
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   207
        in
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   208
        ? x. Some(x) = ren(a) & (s,x,t):trans_of ioa},
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   209
   {rename_set s ren | s. s: wfair_of ioa},
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   210
   {rename_set s ren | s. s: sfair_of ioa})"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   211
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   212
(* ------------------------- fairness ----------------------------- *)
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   213
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   214
fairIOA_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   215
  "fairIOA A == (! S : wfair_of A. S<= local A) &
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   216
                (! S : sfair_of A. S<= local A)"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   217
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   218
input_resistant_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   219
  "input_resistant A == ! W : sfair_of A. ! s a t.
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   220
                        reachable A s & reachable A t & a:inp A &
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   221
                        Enabled A W s & s -a--A-> t
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   222
                        --> Enabled A W t"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   223
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   224
enabled_def:
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   225
  "enabled A a s == ? t. s-a--A-> t"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   226
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   227
Enabled_def:
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   228
  "Enabled A W s == ? w:W. enabled A w s"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   229
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   230
en_persistent_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   231
  "en_persistent A W == ! s a t. Enabled A W s &
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   232
                                 a ~:W &
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   233
                                 s -a--A-> t
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   234
                                 --> Enabled A W t"
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   235
was_enabled_def:
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   236
  "was_enabled A a t == ? s. s-a--A-> t"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   237
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   238
set_was_enabled_def:
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   239
  "set_was_enabled A W t == ? w:W. was_enabled A w t"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3521
diff changeset
   240
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   241
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   242
declare split_paired_Ex [simp del]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   243
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   244
lemmas ioa_projections = asig_of_def starts_of_def trans_of_def wfair_of_def sfair_of_def
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   245
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   246
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   247
subsection "asig_of, starts_of, trans_of"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   248
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   249
lemma ioa_triple_proj: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   250
 "((asig_of (x,y,z,w,s)) = x)   &  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   251
  ((starts_of (x,y,z,w,s)) = y) &  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   252
  ((trans_of (x,y,z,w,s)) = z)  &  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   253
  ((wfair_of (x,y,z,w,s)) = w) &  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   254
  ((sfair_of (x,y,z,w,s)) = s)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   255
  apply (simp add: ioa_projections)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   256
  done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   257
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   258
lemma trans_in_actions: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   259
  "[| is_trans_of A; (s1,a,s2):trans_of(A) |] ==> a:act A"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   260
apply (unfold is_trans_of_def actions_def is_asig_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   261
  apply (erule allE, erule impE, assumption)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   262
  apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   263
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   264
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   265
lemma starts_of_par: 
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   266
"starts_of(A \<parallel> B) = {p. fst(p):starts_of(A) & snd(p):starts_of(B)}"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   267
  apply (simp add: par_def ioa_projections)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   268
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   269
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   270
lemma trans_of_par: 
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   271
"trans_of(A \<parallel> B) = {tr. let s = fst(tr); a = fst(snd(tr)); t = snd(snd(tr))  
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   272
             in (a:act A | a:act B) &  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   273
                (if a:act A then        
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   274
                   (fst(s),a,fst(t)):trans_of(A)  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   275
                 else fst(t) = fst(s))             
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   276
                &                                   
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   277
                (if a:act B then                     
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   278
                   (snd(s),a,snd(t)):trans_of(B)      
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   279
                 else snd(t) = snd(s))}"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   280
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   281
apply (simp add: par_def ioa_projections)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   282
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   283
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   284
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   285
subsection "actions and par"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   286
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   287
lemma actions_asig_comp: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   288
  "actions(asig_comp a b) = actions(a) Un actions(b)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   289
  apply (simp (no_asm) add: actions_def asig_comp_def asig_projections)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   290
  apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   291
  done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   292
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   293
lemma asig_of_par: "asig_of(A \<parallel> B) = asig_comp (asig_of A) (asig_of B)"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   294
  apply (simp add: par_def ioa_projections)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   295
  done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   296
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   297
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   298
lemma externals_of_par: "ext (A1\<parallel>A2) =     
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   299
   (ext A1) Un (ext A2)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   300
apply (simp add: externals_def asig_of_par asig_comp_def
26806
40b411ec05aa Adapted to encoding of sets as predicates
berghofe
parents: 26359
diff changeset
   301
  asig_inputs_def asig_outputs_def Un_def set_diff_eq)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   302
apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   303
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   304
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   305
lemma actions_of_par: "act (A1\<parallel>A2) =     
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   306
   (act A1) Un (act A2)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   307
apply (simp add: actions_def asig_of_par asig_comp_def
26806
40b411ec05aa Adapted to encoding of sets as predicates
berghofe
parents: 26359
diff changeset
   308
  asig_inputs_def asig_outputs_def asig_internals_def Un_def set_diff_eq)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   309
apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   310
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   311
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   312
lemma inputs_of_par: "inp (A1\<parallel>A2) = 
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   313
          ((inp A1) Un (inp A2)) - ((out A1) Un (out A2))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   314
apply (simp add: actions_def asig_of_par asig_comp_def
26806
40b411ec05aa Adapted to encoding of sets as predicates
berghofe
parents: 26359
diff changeset
   315
  asig_inputs_def asig_outputs_def Un_def set_diff_eq)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   316
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   317
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   318
lemma outputs_of_par: "out (A1\<parallel>A2) = 
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   319
          (out A1) Un (out A2)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   320
apply (simp add: actions_def asig_of_par asig_comp_def
26806
40b411ec05aa Adapted to encoding of sets as predicates
berghofe
parents: 26359
diff changeset
   321
  asig_outputs_def Un_def set_diff_eq)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   322
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   323
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   324
lemma internals_of_par: "int (A1\<parallel>A2) = 
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   325
          (int A1) Un (int A2)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   326
apply (simp add: actions_def asig_of_par asig_comp_def
26806
40b411ec05aa Adapted to encoding of sets as predicates
berghofe
parents: 26359
diff changeset
   327
  asig_inputs_def asig_outputs_def asig_internals_def Un_def set_diff_eq)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   328
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   329
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   330
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   331
subsection "actions and compatibility"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   332
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   333
lemma compat_commute: "compatible A B = compatible B A"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   334
apply (simp add: compatible_def Int_commute)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   335
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   336
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   337
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   338
lemma ext1_is_not_int2: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   339
 "[| compatible A1 A2; a:ext A1|] ==> a~:int A2"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   340
apply (unfold externals_def actions_def compatible_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   341
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   342
apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   343
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   344
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   345
(* just commuting the previous one: better commute compatible *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   346
lemma ext2_is_not_int1: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   347
 "[| compatible A2 A1 ; a:ext A1|] ==> a~:int A2"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   348
apply (unfold externals_def actions_def compatible_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   349
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   350
apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   351
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   352
45606
b1e1508643b1 eliminated obsolete "standard";
wenzelm
parents: 44066
diff changeset
   353
lemmas ext1_ext2_is_not_act2 = ext1_is_not_int2 [THEN int_and_ext_is_act]
b1e1508643b1 eliminated obsolete "standard";
wenzelm
parents: 44066
diff changeset
   354
lemmas ext1_ext2_is_not_act1 = ext2_is_not_int1 [THEN int_and_ext_is_act]
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   355
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   356
lemma intA_is_not_extB: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   357
 "[| compatible A B; x:int A |] ==> x~:ext B"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   358
apply (unfold externals_def actions_def compatible_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   359
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   360
apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   361
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   362
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   363
lemma intA_is_not_actB: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   364
"[| compatible A B; a:int A |] ==> a ~: act B"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   365
apply (unfold externals_def actions_def compatible_def is_asig_def asig_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   366
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   367
apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   368
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   369
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   370
(* the only one that needs disjointness of outputs and of internals and _all_ acts *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   371
lemma outAactB_is_inpB: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   372
"[| compatible A B; a:out A ;a:act B|] ==> a : inp B"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   373
apply (unfold asig_outputs_def asig_internals_def actions_def asig_inputs_def 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   374
    compatible_def is_asig_def asig_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   375
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   376
apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   377
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   378
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   379
(* needed for propagation of input_enabledness from A,B to A\<parallel>B *)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   380
lemma inpAAactB_is_inpBoroutB: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   381
"[| compatible A B; a:inp A ;a:act B|] ==> a : inp B | a: out B"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   382
apply (unfold asig_outputs_def asig_internals_def actions_def asig_inputs_def 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   383
    compatible_def is_asig_def asig_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   384
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   385
apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   386
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   387
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   388
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   389
subsection "input_enabledness and par"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   390
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   391
(* ugly case distinctions. Heart of proof:
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   392
     1. inpAAactB_is_inpBoroutB ie. internals are really hidden.
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   393
     2. inputs_of_par: outputs are no longer inputs of par. This is important here *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   394
lemma input_enabled_par: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   395
"[| compatible A B; input_enabled A; input_enabled B|]  
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   396
      ==> input_enabled (A\<parallel>B)"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   397
apply (unfold input_enabled_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   398
apply (simp add: Let_def inputs_of_par trans_of_par)
58957
c9e744ea8a38 proper context for match_tac etc.;
wenzelm
parents: 58880
diff changeset
   399
apply (tactic "safe_tac (Context.raw_transfer @{theory} @{theory_context Fun})")
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   400
apply (simp add: inp_is_act)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   401
prefer 2
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   402
apply (simp add: inp_is_act)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   403
(* a: inp A *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   404
apply (case_tac "a:act B")
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   405
(* a:act B *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   406
apply (erule_tac x = "a" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   407
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   408
apply (drule inpAAactB_is_inpBoroutB)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   409
apply assumption
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   410
apply assumption
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   411
apply (erule_tac x = "a" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   412
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   413
apply (erule_tac x = "aa" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   414
apply (erule_tac x = "b" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   415
apply (erule exE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   416
apply (erule exE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   417
apply (rule_tac x = " (s2,s2a) " in exI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   418
apply (simp add: inp_is_act)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   419
(* a~: act B*)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   420
apply (simp add: inp_is_act)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   421
apply (erule_tac x = "a" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   422
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   423
apply (erule_tac x = "aa" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   424
apply (erule exE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   425
apply (rule_tac x = " (s2,b) " in exI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   426
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   427
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   428
(* a:inp B *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   429
apply (case_tac "a:act A")
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   430
(* a:act A *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   431
apply (erule_tac x = "a" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   432
apply (erule_tac x = "a" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   433
apply (simp add: inp_is_act)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   434
apply (frule_tac A1 = "A" in compat_commute [THEN iffD1])
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   435
apply (drule inpAAactB_is_inpBoroutB)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   436
back
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   437
apply assumption
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   438
apply assumption
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   439
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   440
apply (erule_tac x = "aa" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   441
apply (erule_tac x = "b" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   442
apply (erule exE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   443
apply (erule exE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   444
apply (rule_tac x = " (s2,s2a) " in exI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   445
apply (simp add: inp_is_act)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   446
(* a~: act B*)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   447
apply (simp add: inp_is_act)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   448
apply (erule_tac x = "a" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   449
apply (erule_tac x = "a" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   450
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   451
apply (erule_tac x = "b" in allE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   452
apply (erule exE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   453
apply (rule_tac x = " (aa,s2) " in exI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   454
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   455
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   456
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   457
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   458
subsection "invariants"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   459
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   460
lemma invariantI:
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   461
  "[| !!s. s:starts_of(A) ==> P(s);      
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   462
      !!s t a. [|reachable A s; P(s)|] ==> (s,a,t): trans_of(A) --> P(t) |]  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   463
   ==> invariant A P"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   464
apply (unfold invariant_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   465
apply (rule allI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   466
apply (rule impI)
23778
18f426a137a9 Adapted to new inductive definition package.
berghofe
parents: 22808
diff changeset
   467
apply (rule_tac x = "s" in reachable.induct)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   468
apply assumption
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   469
apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   470
apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   471
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   472
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   473
lemma invariantI1:
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   474
 "[| !!s. s : starts_of(A) ==> P(s);  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   475
     !!s t a. reachable A s ==> P(s) --> (s,a,t):trans_of(A) --> P(t)  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   476
  |] ==> invariant A P"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   477
  apply (blast intro: invariantI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   478
  done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   479
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   480
lemma invariantE: "[| invariant A P; reachable A s |] ==> P(s)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   481
  apply (unfold invariant_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   482
  apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   483
  done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   484
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   485
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   486
subsection "restrict"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   487
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   488
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   489
lemmas reachable_0 = reachable.reachable_0
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   490
  and reachable_n = reachable.reachable_n
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   491
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   492
lemma cancel_restrict_a: "starts_of(restrict ioa acts) = starts_of(ioa) &      
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   493
          trans_of(restrict ioa acts) = trans_of(ioa)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   494
apply (simp add: restrict_def ioa_projections)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   495
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   496
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   497
lemma cancel_restrict_b: "reachable (restrict ioa acts) s = reachable ioa s"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   498
apply (rule iffI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   499
apply (erule reachable.induct)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   500
apply (simp add: cancel_restrict_a reachable_0)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   501
apply (erule reachable_n)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   502
apply (simp add: cancel_restrict_a)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   503
(* <--  *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   504
apply (erule reachable.induct)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   505
apply (rule reachable_0)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   506
apply (simp add: cancel_restrict_a)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   507
apply (erule reachable_n)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   508
apply (simp add: cancel_restrict_a)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   509
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   510
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   511
lemma acts_restrict: "act (restrict A acts) = act A"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   512
apply (simp (no_asm) add: actions_def asig_internals_def
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   513
  asig_outputs_def asig_inputs_def externals_def asig_of_def restrict_def restrict_asig_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   514
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   515
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   516
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   517
lemma cancel_restrict: "starts_of(restrict ioa acts) = starts_of(ioa) &      
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   518
          trans_of(restrict ioa acts) = trans_of(ioa) &  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   519
          reachable (restrict ioa acts) s = reachable ioa s &  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   520
          act (restrict A acts) = act A"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   521
  apply (simp (no_asm) add: cancel_restrict_a cancel_restrict_b acts_restrict)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   522
  done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   523
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   524
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   525
subsection "rename"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   526
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   527
lemma trans_rename: "s -a--(rename C f)-> t ==> (? x. Some(x) = f(a) & s -x--C-> t)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   528
apply (simp add: Let_def rename_def trans_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   529
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   530
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   531
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   532
lemma reachable_rename: "[| reachable (rename C g) s |] ==> reachable C s"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   533
apply (erule reachable.induct)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   534
apply (rule reachable_0)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   535
apply (simp add: rename_def ioa_projections)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   536
apply (drule trans_rename)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   537
apply (erule exE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   538
apply (erule conjE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   539
apply (erule reachable_n)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   540
apply assumption
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   541
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   542
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   543
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   544
subsection "trans_of(A\<parallel>B)"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   545
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   546
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   547
lemma trans_A_proj: "[|(s,a,t):trans_of (A\<parallel>B); a:act A|]  
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   548
              ==> (fst s,a,fst t):trans_of A"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   549
apply (simp add: Let_def par_def trans_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   550
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   551
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   552
lemma trans_B_proj: "[|(s,a,t):trans_of (A\<parallel>B); a:act B|]  
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   553
              ==> (snd s,a,snd t):trans_of B"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   554
apply (simp add: Let_def par_def trans_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   555
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   556
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   557
lemma trans_A_proj2: "[|(s,a,t):trans_of (A\<parallel>B); a~:act A|] 
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   558
              ==> fst s = fst t"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   559
apply (simp add: Let_def par_def trans_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   560
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   561
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   562
lemma trans_B_proj2: "[|(s,a,t):trans_of (A\<parallel>B); a~:act B|] 
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   563
              ==> snd s = snd t"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   564
apply (simp add: Let_def par_def trans_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   565
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   566
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   567
lemma trans_AB_proj: "(s,a,t):trans_of (A\<parallel>B)  
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   568
               ==> a :act A | a :act B"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   569
apply (simp add: Let_def par_def trans_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   570
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   571
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   572
lemma trans_AB: "[|a:act A;a:act B; 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   573
       (fst s,a,fst t):trans_of A;(snd s,a,snd t):trans_of B|] 
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   574
   ==> (s,a,t):trans_of (A\<parallel>B)"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   575
apply (simp add: Let_def par_def trans_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   576
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   577
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   578
lemma trans_A_notB: "[|a:act A;a~:act B; 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   579
       (fst s,a,fst t):trans_of A;snd s=snd t|] 
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   580
   ==> (s,a,t):trans_of (A\<parallel>B)"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   581
apply (simp add: Let_def par_def trans_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   582
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   583
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   584
lemma trans_notA_B: "[|a~:act A;a:act B; 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   585
       (snd s,a,snd t):trans_of B;fst s=fst t|] 
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   586
   ==> (s,a,t):trans_of (A\<parallel>B)"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   587
apply (simp add: Let_def par_def trans_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   588
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   589
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   590
lemmas trans_of_defs1 = trans_AB trans_A_notB trans_notA_B
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   591
  and trans_of_defs2 = trans_A_proj trans_B_proj trans_A_proj2 trans_B_proj2 trans_AB_proj
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   592
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   593
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   594
lemma trans_of_par4: 
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   595
"((s,a,t) : trans_of(A \<parallel> B \<parallel> C \<parallel> D)) =                                     
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   596
  ((a:actions(asig_of(A)) | a:actions(asig_of(B)) | a:actions(asig_of(C)) |   
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   597
    a:actions(asig_of(D))) &                                                  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   598
   (if a:actions(asig_of(A)) then (fst(s),a,fst(t)):trans_of(A)               
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   599
    else fst t=fst s) &                                                       
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   600
   (if a:actions(asig_of(B)) then (fst(snd(s)),a,fst(snd(t))):trans_of(B)     
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   601
    else fst(snd(t))=fst(snd(s))) &                                           
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   602
   (if a:actions(asig_of(C)) then                                             
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   603
      (fst(snd(snd(s))),a,fst(snd(snd(t)))):trans_of(C)                       
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   604
    else fst(snd(snd(t)))=fst(snd(snd(s)))) &                                 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   605
   (if a:actions(asig_of(D)) then                                             
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   606
      (snd(snd(snd(s))),a,snd(snd(snd(t)))):trans_of(D)                       
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   607
    else snd(snd(snd(t)))=snd(snd(snd(s)))))"
44066
d74182c93f04 rename Pair_fst_snd_eq to prod_eq_iff (keeping old name too)
huffman
parents: 42793
diff changeset
   608
  apply (simp (no_asm) add: par_def actions_asig_comp prod_eq_iff Let_def ioa_projections)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   609
  done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   610
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   611
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   612
subsection "proof obligation generator for IOA requirements"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   613
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   614
(* without assumptions on A and B because is_trans_of is also incorporated in \<parallel>def *)
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   615
lemma is_trans_of_par: "is_trans_of (A\<parallel>B)"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   616
apply (unfold is_trans_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   617
apply (simp add: Let_def actions_of_par trans_of_par)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   618
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   619
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   620
lemma is_trans_of_restrict: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   621
"is_trans_of A ==> is_trans_of (restrict A acts)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   622
apply (unfold is_trans_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   623
apply (simp add: cancel_restrict acts_restrict)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   624
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   625
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   626
lemma is_trans_of_rename: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   627
"is_trans_of A ==> is_trans_of (rename A f)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   628
apply (unfold is_trans_of_def restrict_def restrict_asig_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   629
apply (simp add: Let_def actions_def trans_of_def asig_internals_def
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   630
  asig_outputs_def asig_inputs_def externals_def asig_of_def rename_def rename_set_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   631
apply blast
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   632
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   633
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   634
lemma is_asig_of_par: "[| is_asig_of A; is_asig_of B; compatible A B|]   
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   635
          ==> is_asig_of (A\<parallel>B)"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   636
apply (simp add: is_asig_of_def asig_of_par asig_comp_def compatible_def
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   637
  asig_internals_def asig_outputs_def asig_inputs_def actions_def is_asig_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   638
apply (simp add: asig_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   639
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   640
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   641
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   642
lemma is_asig_of_restrict: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   643
"is_asig_of A ==> is_asig_of (restrict A f)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   644
apply (unfold is_asig_of_def is_asig_def asig_of_def restrict_def restrict_asig_def 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   645
           asig_internals_def asig_outputs_def asig_inputs_def externals_def o_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   646
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   647
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   648
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   649
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   650
lemma is_asig_of_rename: "is_asig_of A ==> is_asig_of (rename A f)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   651
apply (simp add: is_asig_of_def rename_def rename_set_def asig_internals_def
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   652
  asig_outputs_def asig_inputs_def actions_def is_asig_def asig_of_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   653
apply auto
59807
22bc39064290 prefer local fixes;
wenzelm
parents: 58957
diff changeset
   654
apply (drule_tac [!] s = "Some _" in sym)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   655
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   656
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   657
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   658
lemmas [simp] = is_asig_of_par is_asig_of_restrict
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   659
  is_asig_of_rename is_trans_of_par is_trans_of_restrict is_trans_of_rename
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   660
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   661
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   662
lemma compatible_par: 
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   663
"[|compatible A B; compatible A C |]==> compatible A (B\<parallel>C)"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   664
apply (unfold compatible_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   665
apply (simp add: internals_of_par outputs_of_par actions_of_par)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   666
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   667
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   668
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   669
(*  better derive by previous one and compat_commute *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   670
lemma compatible_par2: 
61999
89291b5d0ede more symbols;
wenzelm
parents: 59807
diff changeset
   671
"[|compatible A C; compatible B C |]==> compatible (A\<parallel>B) C"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   672
apply (unfold compatible_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   673
apply (simp add: internals_of_par outputs_of_par actions_of_par)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   674
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   675
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   676
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   677
lemma compatible_restrict: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   678
"[| compatible A B; (ext B - S) Int ext A = {}|]  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   679
      ==> compatible A (restrict B S)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   680
apply (unfold compatible_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   681
apply (simp add: ioa_triple_proj asig_triple_proj externals_def
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   682
  restrict_def restrict_asig_def actions_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   683
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   684
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   685
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   686
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   687
declare split_paired_Ex [simp]
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   688
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   689
end