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