src/HOL/HOLCF/IOA/meta_theory/Traces.thy
author wenzelm
Wed, 30 Dec 2015 21:56:12 +0100
changeset 62001 1f2788fb0b8b
parent 62000 8cba509ace9c
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/Traces.thy
40945
b8703f63bfb2 recoded latin1 as utf8;
wenzelm
parents: 40774
diff changeset
     2
    Author:     Olaf Müller
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: 51703
diff changeset
     5
section {* Executions and Traces of I/O automata 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 Traces
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     8
imports Sequence Automata
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     9
begin
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    10
36452
d37c6eed8117 renamed command 'defaultsort' to 'default_sort';
wenzelm
parents: 30607
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
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    14
   ('a,'s)pairs            =    "('a * 's) Seq"
41476
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    15
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    16
type_synonym
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    17
   ('a,'s)execution        =    "'s * ('a,'s)pairs"
41476
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    18
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    19
type_synonym
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    20
   'a trace                =    "'a Seq"
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    21
41476
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    22
type_synonym
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    23
   ('a,'s)execution_module = "('a,'s)execution set * 'a signature"
41476
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    24
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    25
type_synonym
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    26
   'a schedule_module      = "'a trace set * 'a signature"
41476
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    27
0fa9629aa399 types -> type_synonym
huffman
parents: 40945
diff changeset
    28
type_synonym
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    29
   'a trace_module         = "'a trace set * 'a signature"
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    30
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    31
consts
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    32
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    33
   (* Executions *)
3433
2de17c994071 added deadlock freedom, polished definitions and proofs
mueller
parents: 3275
diff changeset
    34
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    35
  is_exec_fragC ::"('a,'s)ioa => ('a,'s)pairs -> 's => tr"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    36
  is_exec_frag  ::"[('a,'s)ioa, ('a,'s)execution] => bool"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    37
  has_execution ::"[('a,'s)ioa, ('a,'s)execution] => bool"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    38
  executions    :: "('a,'s)ioa => ('a,'s)execution set"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    39
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    40
  (* Schedules and traces *)
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    41
  filter_act    ::"('a,'s)pairs -> 'a trace"
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    42
  has_schedule  :: "[('a,'s)ioa, 'a trace] => bool"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    43
  has_trace     :: "[('a,'s)ioa, 'a trace] => bool"
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    44
  schedules     :: "('a,'s)ioa => 'a trace set"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    45
  traces        :: "('a,'s)ioa => 'a trace set"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    46
  mk_trace      :: "('a,'s)ioa => ('a,'s)pairs -> 'a trace"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    47
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    48
  laststate    ::"('a,'s)execution => 's"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    49
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    50
  (* A predicate holds infinitely (finitely) often in a sequence *)
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    51
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    52
  inf_often      ::"('a => bool) => 'a Seq => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    53
  fin_often      ::"('a => bool) => 'a Seq => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    54
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    55
  (* fairness of executions *)
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    56
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    57
  wfair_ex       ::"('a,'s)ioa => ('a,'s)execution => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    58
  sfair_ex       ::"('a,'s)ioa => ('a,'s)execution => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    59
  is_wfair       ::"('a,'s)ioa => 'a set => ('a,'s)execution => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    60
  is_sfair       ::"('a,'s)ioa => 'a set => ('a,'s)execution => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    61
  fair_ex        ::"('a,'s)ioa => ('a,'s)execution => bool"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    62
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    63
  (* fair behavior sets *)
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    64
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    65
  fairexecutions ::"('a,'s)ioa => ('a,'s)execution set"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    66
  fairtraces     ::"('a,'s)ioa => 'a trace set"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    67
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    68
  (* Notions of implementation *)
22808
a7daa74e2980 eliminated unnamed infixes, tuned syntax;
wenzelm
parents: 19741
diff changeset
    69
  ioa_implements :: "[('a,'s1)ioa, ('a,'s2)ioa] => bool"   (infixr "=<|" 12)
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
    70
  fair_implements  :: "('a,'s1)ioa => ('a,'s2)ioa => bool"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    71
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    72
  (* Execution, schedule and trace modules *)
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    73
  Execs         ::  "('a,'s)ioa => ('a,'s)execution_module"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    74
  Scheds        ::  "('a,'s)ioa => 'a schedule_module"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    75
  Traces        ::  "('a,'s)ioa => 'a trace_module"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
    76
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    77
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    78
defs
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    79
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    80
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    81
(*  ------------------- Executions ------------------------------ *)
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    82
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    83
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    84
is_exec_frag_def:
10835
nipkow
parents: 5976
diff changeset
    85
  "is_exec_frag A ex ==  ((is_exec_fragC A$(snd ex)) (fst ex) ~= FF)"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    86
3433
2de17c994071 added deadlock freedom, polished definitions and proofs
mueller
parents: 3275
diff changeset
    87
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    88
is_exec_fragC_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    89
  "is_exec_fragC A ==(fix$(LAM h ex. (%s. case ex of
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    90
      nil => TT
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    91
    | x##xs => (flift1
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    92
            (%p. Def ((s,p):trans_of A) andalso (h$xs) (snd p))
10835
nipkow
parents: 5976
diff changeset
    93
             $x)
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    94
   )))"
3433
2de17c994071 added deadlock freedom, polished definitions and proofs
mueller
parents: 3275
diff changeset
    95
2de17c994071 added deadlock freedom, polished definitions and proofs
mueller
parents: 3275
diff changeset
    96
2de17c994071 added deadlock freedom, polished definitions and proofs
mueller
parents: 3275
diff changeset
    97
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    98
executions_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    99
  "executions ioa == {e. ((fst e) : starts_of(ioa)) &
3433
2de17c994071 added deadlock freedom, polished definitions and proofs
mueller
parents: 3275
diff changeset
   100
                         is_exec_frag ioa e}"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   101
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   102
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   103
(*  ------------------- Schedules ------------------------------ *)
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   104
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   105
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   106
filter_act_def:
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   107
  "filter_act == Map fst"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   108
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   109
has_schedule_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   110
  "has_schedule ioa sch ==
10835
nipkow
parents: 5976
diff changeset
   111
     (? ex:executions ioa. sch = filter_act$(snd ex))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   112
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   113
schedules_def:
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   114
  "schedules ioa == {sch. has_schedule ioa sch}"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   115
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   116
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   117
(*  ------------------- Traces ------------------------------ *)
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
has_trace_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   120
  "has_trace ioa tr ==
10835
nipkow
parents: 5976
diff changeset
   121
     (? sch:schedules ioa. tr = Filter (%a. a:ext(ioa))$sch)"
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   122
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   123
traces_def:
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   124
  "traces ioa == {tr. has_trace ioa tr}"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   125
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   126
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   127
mk_trace_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   128
  "mk_trace ioa == LAM tr.
10835
nipkow
parents: 5976
diff changeset
   129
     Filter (%a. a:ext(ioa))$(filter_act$tr)"
3071
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
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   132
(*  ------------------- Fair Traces ------------------------------ *)
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   133
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   134
laststate_def:
10835
nipkow
parents: 5976
diff changeset
   135
  "laststate ex == case Last$(snd ex) of
12028
52aa183c15bb replaced Undef by UU;
wenzelm
parents: 10835
diff changeset
   136
                      UU  => fst ex
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   137
                    | Def at => snd at"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   138
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   139
inf_often_def:
10835
nipkow
parents: 5976
diff changeset
   140
  "inf_often P s == Infinite (Filter P$s)"
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   141
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   142
(*  filtering P yields a finite or partial sequence *)
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   143
fin_often_def:
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   144
  "fin_often P s == ~inf_often P s"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   145
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   146
(* Note that partial execs cannot be wfair as the inf_often predicate in the
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   147
   else branch prohibits it. However they can be sfair in the case when all W
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   148
   are only finitely often enabled: Is this the right model?
5976
44290b71a85f tuning to assimiliate it with PhD;
mueller
parents: 4559
diff changeset
   149
   See LiveIOA for solution conforming with the literature and superseding this one *)
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   150
wfair_ex_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   151
  "wfair_ex A ex == ! W : wfair_of A.
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   152
                      if   Finite (snd ex)
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   153
                      then ~Enabled A W (laststate ex)
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   154
                      else is_wfair A W ex"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   155
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   156
is_wfair_def:
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   157
  "is_wfair A W ex == (inf_often (%x. fst x:W) (snd ex)
62000
8cba509ace9c more symbols;
wenzelm
parents: 61032
diff changeset
   158
                     | inf_often (%x. ~ Enabled A W (snd x)) (snd ex))"
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   159
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   160
sfair_ex_def:
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   161
  "sfair_ex A ex == ! W : sfair_of A.
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   162
                      if   Finite (snd ex)
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   163
                      then ~Enabled A W (laststate ex)
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   164
                      else is_sfair A W ex"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   165
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   166
is_sfair_def:
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   167
  "is_sfair A W ex ==  (inf_often (%x. fst x:W) (snd ex)
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   168
                      | fin_often (%x. Enabled A W (snd x)) (snd ex))"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   169
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   170
fair_ex_def:
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   171
  "fair_ex A ex == wfair_ex A ex & sfair_ex A ex"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   172
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   173
fairexecutions_def:
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   174
  "fairexecutions A == {ex. ex:executions A & fair_ex A ex}"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   175
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   176
fairtraces_def:
10835
nipkow
parents: 5976
diff changeset
   177
  "fairtraces A == {mk_trace A$(snd ex) | ex. ex:fairexecutions A}"
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   178
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   179
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   180
(*  ------------------- Implementation ------------------------------ *)
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   181
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   182
ioa_implements_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   183
  "ioa1 =<| ioa2 ==
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   184
    (((inputs(asig_of(ioa1)) = inputs(asig_of(ioa2))) &
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   185
     (outputs(asig_of(ioa1)) = outputs(asig_of(ioa2)))) &
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   186
      traces(ioa1) <= traces(ioa2))"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
   187
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   188
fair_implements_def:
4559
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   189
  "fair_implements C A == inp(C) = inp(A) &  out(C)=out(A) &
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   190
                          fairtraces(C) <= fairtraces(A)"
8e604d885b54 added files containing temproal logic and abstraction;
mueller
parents: 3842
diff changeset
   191
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   192
(*  ------------------- Modules ------------------------------ *)
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   193
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   194
Execs_def:
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   195
  "Execs A  == (executions A, asig_of A)"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   196
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   197
Scheds_def:
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   198
  "Scheds A == (schedules A, asig_of A)"
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
Traces_def:
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   201
  "Traces A == (traces A,asig_of A)"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3433
diff changeset
   202
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   203
37598
893dcabf0c04 explicit is better than implicit
haftmann
parents: 36452
diff changeset
   204
lemmas [simp del] = HOL.ex_simps HOL.all_simps split_paired_Ex
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   205
declare Let_def [simp]
51703
f2e92fc0c8aa modifiers for classical wrappers operate on Proof.context instead of claset;
wenzelm
parents: 45606
diff changeset
   206
setup {* map_theory_claset (fn ctxt => ctxt delSWrapper "split_all_tac") *}
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   207
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   208
lemmas exec_rws = executions_def is_exec_frag_def
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   209
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   210
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   211
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   212
subsection "recursive equations of operators"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   213
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   214
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   215
(*                               filter_act                         *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   216
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   217
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   218
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   219
lemma filter_act_UU: "filter_act$UU = UU"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   220
apply (simp add: filter_act_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   221
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   222
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   223
lemma filter_act_nil: "filter_act$nil = nil"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   224
apply (simp add: filter_act_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   225
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   226
62001
1f2788fb0b8b more symbols;
wenzelm
parents: 62000
diff changeset
   227
lemma filter_act_cons: "filter_act$(x\<leadsto>xs) = (fst x) \<leadsto> filter_act$xs"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   228
apply (simp add: filter_act_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   229
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   230
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   231
declare filter_act_UU [simp] filter_act_nil [simp] filter_act_cons [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   232
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   233
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   234
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   235
(*                             mk_trace                             *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   236
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   237
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   238
lemma mk_trace_UU: "mk_trace A$UU=UU"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   239
apply (simp add: mk_trace_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   240
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   241
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   242
lemma mk_trace_nil: "mk_trace A$nil=nil"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   243
apply (simp add: mk_trace_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   244
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   245
62001
1f2788fb0b8b more symbols;
wenzelm
parents: 62000
diff changeset
   246
lemma mk_trace_cons: "mk_trace A$(at \<leadsto> xs) =     
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   247
             (if ((fst at):ext A)            
62001
1f2788fb0b8b more symbols;
wenzelm
parents: 62000
diff changeset
   248
                  then (fst at) \<leadsto> (mk_trace A$xs)     
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   249
                  else mk_trace A$xs)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   250
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   251
apply (simp add: mk_trace_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   252
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   253
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   254
declare mk_trace_UU [simp] mk_trace_nil [simp] mk_trace_cons [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   255
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   256
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   257
(*                             is_exec_fragC                             *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   258
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   259
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   260
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   261
lemma is_exec_fragC_unfold: "is_exec_fragC A = (LAM ex. (%s. case ex of  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   262
       nil => TT  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   263
     | x##xs => (flift1   
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   264
             (%p. Def ((s,p):trans_of A) andalso (is_exec_fragC A$xs) (snd p))  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   265
              $x)  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   266
    ))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   267
apply (rule trans)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   268
apply (rule fix_eq2)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   269
apply (rule is_exec_fragC_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   270
apply (rule beta_cfun)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   271
apply (simp add: flift1_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   272
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   273
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   274
lemma is_exec_fragC_UU: "(is_exec_fragC A$UU) s=UU"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   275
apply (subst is_exec_fragC_unfold)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   276
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   277
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   278
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   279
lemma is_exec_fragC_nil: "(is_exec_fragC A$nil) s = TT"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   280
apply (subst is_exec_fragC_unfold)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   281
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   282
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   283
62001
1f2788fb0b8b more symbols;
wenzelm
parents: 62000
diff changeset
   284
lemma is_exec_fragC_cons: "(is_exec_fragC A$(pr\<leadsto>xs)) s =  
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   285
                         (Def ((s,pr):trans_of A)  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   286
                 andalso (is_exec_fragC A$xs)(snd pr))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   287
apply (rule trans)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   288
apply (subst is_exec_fragC_unfold)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   289
apply (simp add: Consq_def flift1_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   290
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   291
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   292
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   293
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   294
declare is_exec_fragC_UU [simp] is_exec_fragC_nil [simp] is_exec_fragC_cons [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   295
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   296
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   297
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   298
(*                        is_exec_frag                              *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   299
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   300
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   301
lemma is_exec_frag_UU: "is_exec_frag A (s, UU)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   302
apply (simp add: is_exec_frag_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   303
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   304
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   305
lemma is_exec_frag_nil: "is_exec_frag A (s, nil)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   306
apply (simp add: is_exec_frag_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   307
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   308
62001
1f2788fb0b8b more symbols;
wenzelm
parents: 62000
diff changeset
   309
lemma is_exec_frag_cons: "is_exec_frag A (s, (a,t)\<leadsto>ex) =  
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   310
                                (((s,a,t):trans_of A) &  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   311
                                is_exec_frag A (t, ex))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   312
apply (simp add: is_exec_frag_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   313
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   314
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   315
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   316
(* Delsimps [is_exec_fragC_UU,is_exec_fragC_nil,is_exec_fragC_cons]; *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   317
declare is_exec_frag_UU [simp] is_exec_frag_nil [simp] is_exec_frag_cons [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   318
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   319
(* ---------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   320
                           section "laststate"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   321
(* ---------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   322
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   323
lemma laststate_UU: "laststate (s,UU) = s"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   324
apply (simp add: laststate_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   325
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   326
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   327
lemma laststate_nil: "laststate (s,nil) = s"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   328
apply (simp add: laststate_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   329
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   330
62001
1f2788fb0b8b more symbols;
wenzelm
parents: 62000
diff changeset
   331
lemma laststate_cons: "!! ex. Finite ex ==> laststate (s,at\<leadsto>ex) = laststate (snd at,ex)"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   332
apply (simp (no_asm) add: laststate_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   333
apply (case_tac "ex=nil")
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   334
apply (simp (no_asm_simp))
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   335
apply (simp (no_asm_simp))
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   336
apply (drule Finite_Last1 [THEN mp])
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   337
apply assumption
30607
c3d1590debd8 eliminated global SIMPSET, CLASET etc. -- refer to explicit context;
wenzelm
parents: 27208
diff changeset
   338
apply defined
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   339
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   340
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   341
declare laststate_UU [simp] laststate_nil [simp] laststate_cons [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   342
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   343
lemma exists_laststate: "!!ex. Finite ex ==> (! s. ? u. laststate (s,ex)=u)"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   344
apply (tactic "Seq_Finite_induct_tac @{context} 1")
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   345
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   346
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   347
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   348
subsection "has_trace, mk_trace"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   349
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   350
(* alternative definition of has_trace tailored for the refinement proof, as it does not 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   351
   take the detour of schedules *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   352
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   353
lemma has_trace_def2: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   354
"has_trace A b = (? ex:executions A. b = mk_trace A$(snd ex))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   355
apply (unfold executions_def mk_trace_def has_trace_def schedules_def has_schedule_def)
26359
6d437bde2f1d more antiquotations
haftmann
parents: 26339
diff changeset
   356
apply auto
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   357
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   358
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   359
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   360
subsection "signatures and executions, schedules"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   361
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   362
(* All executions of A have only actions of A. This is only true because of the 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   363
   predicate state_trans (part of the predicate IOA): We have no dependent types.
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   364
   For executions of parallel automata this assumption is not needed, as in par_def
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   365
   this condition is included once more. (see Lemmas 1.1.1c in CompoExecs for example) *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   366
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   367
lemma execfrag_in_sig: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   368
  "!! A. is_trans_of A ==>  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   369
  ! s. is_exec_frag A (s,xs) --> Forall (%a. a:act A) (filter_act$xs)"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   370
apply (tactic {* pair_induct_tac @{context} "xs" [@{thm is_exec_frag_def},
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   371
  @{thm Forall_def}, @{thm sforall_def}] 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   372
(* main case *)
26359
6d437bde2f1d more antiquotations
haftmann
parents: 26339
diff changeset
   373
apply (auto simp add: is_trans_of_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   374
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   375
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   376
lemma exec_in_sig: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   377
  "!! A.[|  is_trans_of A; x:executions A |] ==>  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   378
  Forall (%a. a:act A) (filter_act$(snd x))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   379
apply (simp add: executions_def)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   380
apply (tactic {* pair_tac @{context} "x" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   381
apply (rule execfrag_in_sig [THEN spec, THEN mp])
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   382
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   383
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   384
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   385
lemma scheds_in_sig: 
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   386
  "!! A.[|  is_trans_of A; x:schedules A |] ==>  
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   387
    Forall (%a. a:act A) x"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   388
apply (unfold schedules_def has_schedule_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   389
apply (fast intro!: exec_in_sig)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   390
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   391
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   392
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   393
subsection "executions are prefix closed"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   394
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   395
(* only admissible in y, not if done in x !! *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   396
lemma execfrag_prefixclosed: "!x s. is_exec_frag A (s,x) & y<<x  --> is_exec_frag A (s,y)"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   397
apply (tactic {* pair_induct_tac @{context} "y" [@{thm is_exec_frag_def}] 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   398
apply (intro strip)
61032
b57df8eecad6 standardized some occurences of ancient "split" alias
haftmann
parents: 58880
diff changeset
   399
apply (tactic {* Seq_case_simp_tac @{context} "x" 1 *})
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   400
apply (tactic {* pair_tac @{context} "a" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   401
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   402
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   403
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   404
lemmas exec_prefixclosed =
45606
b1e1508643b1 eliminated obsolete "standard";
wenzelm
parents: 42151
diff changeset
   405
  conjI [THEN execfrag_prefixclosed [THEN spec, THEN spec, THEN mp]]
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   406
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   407
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   408
(* second prefix notion for Finite x *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   409
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   410
lemma exec_prefix2closed [rule_format]:
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   411
  "! y s. is_exec_frag A (s,x@@y) --> is_exec_frag A (s,x)"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   412
apply (tactic {* pair_induct_tac @{context} "x" [@{thm is_exec_frag_def}] 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   413
apply (intro strip)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   414
apply (tactic {* Seq_case_simp_tac @{context} "s" 1 *})
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   415
apply (tactic {* pair_tac @{context} "a" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   416
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   417
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   418
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   419
end