src/HOLCF/IOA/meta_theory/CompoScheds.thy
author wenzelm
Sat, 14 Jun 2008 23:19:51 +0200
changeset 27208 5fe899199f85
parent 26359 6d437bde2f1d
child 32149 ef59550a55d3
permissions -rw-r--r--
proper context for tactics derived from res_inst_tac;
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/CompoScheds.thy
3275
3f53f2c876f4 changes for release 94-8
mueller
parents: 3071
diff changeset
     2
    ID:         $Id$
12218
wenzelm
parents: 12028
diff changeset
     3
    Author:     Olaf Müller
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     4
*)
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
     5
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     6
header {* Compositionality on Schedule level *}
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
     7
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     8
theory CompoScheds
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     9
imports CompoExecs
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    10
begin
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    11
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    12
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    13
  mkex2 :: "('a,'s)ioa => ('a,'t)ioa => 'a Seq ->
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    14
              ('a,'s)pairs -> ('a,'t)pairs ->
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    15
              ('s => 't => ('a,'s*'t)pairs)" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    16
  "mkex2 A B = (fix$(LAM h sch exA exB. (%s t. case sch of
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    17
       nil => nil
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    18
    | x##xs =>
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    19
      (case x of
12028
52aa183c15bb replaced Undef by UU;
wenzelm
parents: 10835
diff changeset
    20
        UU => UU
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    21
      | Def y =>
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    22
         (if y:act A then
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    23
             (if y:act B then
10835
nipkow
parents: 3842
diff changeset
    24
                (case HD$exA of
12028
52aa183c15bb replaced Undef by UU;
wenzelm
parents: 10835
diff changeset
    25
                   UU => UU
10835
nipkow
parents: 3842
diff changeset
    26
                 | Def a => (case HD$exB of
12028
52aa183c15bb replaced Undef by UU;
wenzelm
parents: 10835
diff changeset
    27
                              UU => UU
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    28
                            | Def b =>
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    29
                   (y,(snd a,snd b))>>
10835
nipkow
parents: 3842
diff changeset
    30
                     (h$xs$(TL$exA)$(TL$exB)) (snd a) (snd b)))
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    31
              else
10835
nipkow
parents: 3842
diff changeset
    32
                (case HD$exA of
12028
52aa183c15bb replaced Undef by UU;
wenzelm
parents: 10835
diff changeset
    33
                   UU => UU
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    34
                 | Def a =>
10835
nipkow
parents: 3842
diff changeset
    35
                   (y,(snd a,t))>>(h$xs$(TL$exA)$exB) (snd a) t)
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    36
              )
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    37
          else
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    38
             (if y:act B then
10835
nipkow
parents: 3842
diff changeset
    39
                (case HD$exB of
12028
52aa183c15bb replaced Undef by UU;
wenzelm
parents: 10835
diff changeset
    40
                   UU => UU
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    41
                 | Def b =>
10835
nipkow
parents: 3842
diff changeset
    42
                   (y,(s,snd b))>>(h$xs$exA$(TL$exB)) s (snd b))
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    43
             else
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    44
               UU
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    45
             )
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    46
         )
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    47
       ))))"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    48
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    49
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    50
  mkex :: "('a,'s)ioa => ('a,'t)ioa => 'a Seq =>
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    51
              ('a,'s)execution => ('a,'t)execution =>('a,'s*'t)execution" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    52
  "mkex A B sch exA exB =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    53
       ((fst exA,fst exB),
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    54
        (mkex2 A B$sch$(snd exA)$(snd exB)) (fst exA) (fst exB))"
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    55
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    56
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    57
  par_scheds ::"['a schedule_module,'a schedule_module] => 'a schedule_module" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    58
  "par_scheds SchedsA SchedsB =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    59
      (let schA = fst SchedsA; sigA = snd SchedsA;
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    60
           schB = fst SchedsB; sigB = snd SchedsB
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    61
       in
10835
nipkow
parents: 3842
diff changeset
    62
       (    {sch. Filter (%a. a:actions sigA)$sch : schA}
nipkow
parents: 3842
diff changeset
    63
        Int {sch. Filter (%a. a:actions sigB)$sch : schB}
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    64
        Int {sch. Forall (%x. x:(actions sigA Un actions sigB)) sch},
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    65
        asig_comp sigA sigB))"
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    66
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    67
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    68
declare surjective_pairing [symmetric, simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    69
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    70
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    71
subsection "mkex rewrite rules"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    72
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    73
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    74
lemma mkex2_unfold:
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    75
"mkex2 A B = (LAM sch exA exB. (%s t. case sch of
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    76
      nil => nil
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    77
   | x##xs =>
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    78
     (case x of
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    79
       UU => UU
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    80
     | Def y =>
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    81
        (if y:act A then
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    82
            (if y:act B then
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    83
               (case HD$exA of
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    84
                  UU => UU
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    85
                | Def a => (case HD$exB of
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    86
                             UU => UU
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    87
                           | Def b =>
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    88
                  (y,(snd a,snd b))>>
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    89
                    (mkex2 A B$xs$(TL$exA)$(TL$exB)) (snd a) (snd b)))
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    90
             else
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    91
               (case HD$exA of
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    92
                  UU => UU
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    93
                | Def a =>
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    94
                  (y,(snd a,t))>>(mkex2 A B$xs$(TL$exA)$exB) (snd a) t)
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    95
             )
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    96
         else
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    97
            (if y:act B then
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    98
               (case HD$exB of
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    99
                  UU => UU
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   100
                | Def b =>
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   101
                  (y,(s,snd b))>>(mkex2 A B$xs$exA$(TL$exB)) s (snd b))
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   102
            else
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   103
              UU
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   104
            )
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   105
        )
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   106
      )))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   107
apply (rule trans)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   108
apply (rule fix_eq2)
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   109
apply (simp only: mkex2_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   110
apply (rule beta_cfun)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   111
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   112
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   113
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   114
lemma mkex2_UU: "(mkex2 A B$UU$exA$exB) s t = UU"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   115
apply (subst mkex2_unfold)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   116
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   117
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   118
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   119
lemma mkex2_nil: "(mkex2 A B$nil$exA$exB) s t= nil"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   120
apply (subst mkex2_unfold)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   121
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   122
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   123
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   124
lemma mkex2_cons_1: "[| x:act A; x~:act B; HD$exA=Def a|]
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   125
    ==> (mkex2 A B$(x>>sch)$exA$exB) s t =
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   126
        (x,snd a,t) >> (mkex2 A B$sch$(TL$exA)$exB) (snd a) t"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   127
apply (rule trans)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   128
apply (subst mkex2_unfold)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   129
apply (simp add: Consq_def If_and_if)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   130
apply (simp add: Consq_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   131
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   132
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   133
lemma mkex2_cons_2: "[| x~:act A; x:act B; HD$exB=Def b|]
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   134
    ==> (mkex2 A B$(x>>sch)$exA$exB) s t =
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   135
        (x,s,snd b) >> (mkex2 A B$sch$exA$(TL$exB)) s (snd b)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   136
apply (rule trans)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   137
apply (subst mkex2_unfold)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   138
apply (simp add: Consq_def If_and_if)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   139
apply (simp add: Consq_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   140
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   141
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   142
lemma mkex2_cons_3: "[| x:act A; x:act B; HD$exA=Def a;HD$exB=Def b|]
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   143
    ==> (mkex2 A B$(x>>sch)$exA$exB) s t =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   144
         (x,snd a,snd b) >>
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   145
            (mkex2 A B$sch$(TL$exA)$(TL$exB)) (snd a) (snd b)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   146
apply (rule trans)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   147
apply (subst mkex2_unfold)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   148
apply (simp add: Consq_def If_and_if)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   149
apply (simp add: Consq_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   150
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   151
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   152
declare mkex2_UU [simp] mkex2_nil [simp] mkex2_cons_1 [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   153
  mkex2_cons_2 [simp] mkex2_cons_3 [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   154
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   155
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   156
subsection {* mkex *}
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   157
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   158
lemma mkex_UU: "mkex A B UU  (s,exA) (t,exB) = ((s,t),UU)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   159
apply (simp add: mkex_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   160
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   161
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   162
lemma mkex_nil: "mkex A B nil (s,exA) (t,exB) = ((s,t),nil)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   163
apply (simp add: mkex_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   164
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   165
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   166
lemma mkex_cons_1: "[| x:act A; x~:act B |]
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   167
    ==> mkex A B (x>>sch) (s,a>>exA) (t,exB)  =
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   168
        ((s,t), (x,snd a,t) >> snd (mkex A B sch (snd a,exA) (t,exB)))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   169
apply (simp (no_asm) add: mkex_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   170
apply (cut_tac exA = "a>>exA" in mkex2_cons_1)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   171
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   172
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   173
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   174
lemma mkex_cons_2: "[| x~:act A; x:act B |]
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   175
    ==> mkex A B (x>>sch) (s,exA) (t,b>>exB) =
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   176
        ((s,t), (x,s,snd b) >> snd (mkex A B sch (s,exA) (snd b,exB)))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   177
apply (simp (no_asm) add: mkex_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   178
apply (cut_tac exB = "b>>exB" in mkex2_cons_2)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   179
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   180
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   181
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   182
lemma mkex_cons_3: "[| x:act A; x:act B |]
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   183
    ==>  mkex A B (x>>sch) (s,a>>exA) (t,b>>exB) =
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   184
         ((s,t), (x,snd a,snd b) >> snd (mkex A B sch (snd a,exA) (snd b,exB)))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   185
apply (simp (no_asm) add: mkex_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   186
apply (cut_tac exB = "b>>exB" and exA = "a>>exA" in mkex2_cons_3)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   187
apply auto
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   188
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   189
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   190
declare mkex2_UU [simp del] mkex2_nil [simp del]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   191
  mkex2_cons_1 [simp del] mkex2_cons_2 [simp del] mkex2_cons_3 [simp del]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   192
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   193
lemmas composch_simps = mkex_UU mkex_nil mkex_cons_1 mkex_cons_2 mkex_cons_3
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   194
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   195
declare composch_simps [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   196
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   197
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   198
subsection {* COMPOSITIONALITY on SCHEDULE Level *}
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   199
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   200
subsubsection "Lemmas for ==>"
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
(*    Lemma_2_1 :  tfilter(ex) and filter_act are commutative            *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   204
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   205
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   206
lemma lemma_2_1a:
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   207
   "filter_act$(Filter_ex2 (asig_of A)$xs)=
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   208
    Filter (%a. a:act A)$(filter_act$xs)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   209
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   210
apply (unfold filter_act_def Filter_ex2_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   211
apply (simp (no_asm) add: MapFilter o_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
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   215
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   216
(*    Lemma_2_2 : State-projections do not affect filter_act             *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   217
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   218
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   219
lemma lemma_2_1b:
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   220
   "filter_act$(ProjA2$xs) =filter_act$xs &
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   221
    filter_act$(ProjB2$xs) =filter_act$xs"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   222
apply (tactic {* pair_induct_tac @{context} "xs" [] 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   223
done
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
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   227
(*             Schedules of A||B have only  A- or B-actions              *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   228
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   229
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   230
(* very similar to lemma_1_1c, but it is not checking if every action element of
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   231
   an ex is in A or B, but after projecting it onto the action schedule. Of course, this
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   232
   is the same proposition, but we cannot change this one, when then rather lemma_1_1c  *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   233
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   234
lemma sch_actions_in_AorB: "!s. is_exec_frag (A||B) (s,xs)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   235
   --> Forall (%x. x:act (A||B)) (filter_act$xs)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   236
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   237
apply (tactic {* pair_induct_tac @{context} "xs" [@{thm is_exec_frag_def}, @{thm Forall_def},
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   238
  @{thm sforall_def}] 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   239
(* main case *)
26359
6d437bde2f1d more antiquotations
haftmann
parents: 25135
diff changeset
   240
apply auto
6d437bde2f1d more antiquotations
haftmann
parents: 25135
diff changeset
   241
apply (simp add: trans_of_defs2 actions_asig_comp asig_of_par)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   242
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   243
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   244
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   245
subsubsection "Lemmas for <=="
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
    Filtering actions out of mkex(sch,exA,exB) yields the oracle sch
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   249
                             structural induction
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   250
  --------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   251
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   252
lemma Mapfst_mkex_is_sch: "! exA exB s t.
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   253
  Forall (%x. x:act (A||B)) sch  &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   254
  Filter (%a. a:act A)$sch << filter_act$exA &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   255
  Filter (%a. a:act B)$sch << filter_act$exB
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   256
  --> filter_act$(snd (mkex A B sch (s,exA) (t,exB))) = sch"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   257
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   258
apply (tactic {* Seq_induct_tac @{context} "sch" [@{thm Filter_def}, @{thm Forall_def},
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   259
  @{thm sforall_def}, @{thm mkex_def}] 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   260
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   261
(* main case *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   262
(* splitting into 4 cases according to a:A, a:B *)
26359
6d437bde2f1d more antiquotations
haftmann
parents: 25135
diff changeset
   263
apply auto
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   264
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   265
(* Case y:A, y:B *)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   266
apply (tactic {* Seq_case_simp_tac @{context} "exA" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   267
(* Case exA=UU, Case exA=nil*)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   268
(* These UU and nil cases are the only places where the assumption filter A sch<<f_act exA
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   269
   is used! --> to generate a contradiction using  ~a>>ss<< UU(nil), using theorems
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   270
   Cons_not_less_UU and Cons_not_less_nil  *)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   271
apply (tactic {* Seq_case_simp_tac @{context} "exB" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   272
(* Case exA=a>>x, exB=b>>y *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   273
(* here it is important that Seq_case_simp_tac uses no !full!_simp_tac for the cons case,
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   274
   as otherwise mkex_cons_3 would  not be rewritten without use of rotate_tac: then tactic
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   275
   would not be generally applicable *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   276
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   277
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   278
(* Case y:A, y~:B *)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   279
apply (tactic {* Seq_case_simp_tac @{context} "exA" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   280
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   281
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   282
(* Case y~:A, y:B *)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   283
apply (tactic {* Seq_case_simp_tac @{context} "exB" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   284
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   285
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   286
(* Case y~:A, y~:B *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   287
apply (simp add: asig_of_par actions_asig_comp)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   288
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   289
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   290
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   291
(* generalizing the proof above to a tactic *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   292
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   293
ML {*
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   294
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   295
local
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   296
  val defs = [thm "Filter_def", thm "Forall_def", thm "sforall_def", thm "mkex_def",
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   297
    thm "stutter_def"]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   298
  val asigs = [thm "asig_of_par", thm "actions_asig_comp"]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   299
in
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   300
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   301
fun mkex_induct_tac ctxt sch exA exB =
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   302
  let val ss = Simplifier.local_simpset_of ctxt in
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   303
    EVERY1[Seq_induct_tac ctxt sch defs,
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   304
           asm_full_simp_tac ss,
26359
6d437bde2f1d more antiquotations
haftmann
parents: 25135
diff changeset
   305
           SELECT_GOAL (safe_tac (claset_of @{theory Fun})),
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   306
           Seq_case_simp_tac ctxt exA,
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   307
           Seq_case_simp_tac ctxt exB,
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   308
           asm_full_simp_tac ss,
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   309
           Seq_case_simp_tac ctxt exA,
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   310
           asm_full_simp_tac ss,
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   311
           Seq_case_simp_tac ctxt exB,
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   312
           asm_full_simp_tac ss,
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   313
           asm_full_simp_tac (ss addsimps asigs)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   314
          ]
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   315
  end
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   316
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
   317
end
19741
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
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   321
(*---------------------------------------------------------------------------
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   322
               Projection of mkex(sch,exA,exB) onto A stutters on A
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   323
                             structural induction
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   324
  --------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   325
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   326
lemma stutterA_mkex: "! exA exB s t.
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   327
  Forall (%x. x:act (A||B)) sch &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   328
  Filter (%a. a:act A)$sch << filter_act$exA &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   329
  Filter (%a. a:act B)$sch << filter_act$exB
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   330
  --> stutter (asig_of A) (s,ProjA2$(snd (mkex A B sch (s,exA) (t,exB))))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   331
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   332
apply (tactic {* mkex_induct_tac @{context} "sch" "exA" "exB" *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   333
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   334
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   335
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   336
lemma stutter_mkex_on_A: "[|
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   337
  Forall (%x. x:act (A||B)) sch ;
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   338
  Filter (%a. a:act A)$sch << filter_act$(snd exA) ;
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   339
  Filter (%a. a:act B)$sch << filter_act$(snd exB) |]
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   340
  ==> stutter (asig_of A) (ProjA (mkex A B sch exA exB))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   341
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   342
apply (cut_tac stutterA_mkex)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   343
apply (simp add: stutter_def ProjA_def mkex_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   344
apply (erule allE)+
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   345
apply (drule mp)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   346
prefer 2 apply (assumption)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   347
apply simp
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
(*---------------------------------------------------------------------------
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   352
               Projection of mkex(sch,exA,exB) onto B stutters on B
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   353
                             structural induction
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   354
  --------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   355
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   356
lemma stutterB_mkex: "! exA exB s t.
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   357
  Forall (%x. x:act (A||B)) sch &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   358
  Filter (%a. a:act A)$sch << filter_act$exA &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   359
  Filter (%a. a:act B)$sch << filter_act$exB
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   360
  --> stutter (asig_of B) (t,ProjB2$(snd (mkex A B sch (s,exA) (t,exB))))"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   361
apply (tactic {* mkex_induct_tac @{context} "sch" "exA" "exB" *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   362
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   363
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   364
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   365
lemma stutter_mkex_on_B: "[|
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   366
  Forall (%x. x:act (A||B)) sch ;
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   367
  Filter (%a. a:act A)$sch << filter_act$(snd exA) ;
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   368
  Filter (%a. a:act B)$sch << filter_act$(snd exB) |]
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   369
  ==> stutter (asig_of B) (ProjB (mkex A B sch exA exB))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   370
apply (cut_tac stutterB_mkex)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   371
apply (simp add: stutter_def ProjB_def mkex_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   372
apply (erule allE)+
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   373
apply (drule mp)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   374
prefer 2 apply (assumption)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   375
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   376
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   377
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   378
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   379
(*---------------------------------------------------------------------------
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   380
     Filter of mkex(sch,exA,exB) to A after projection onto A is exA
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   381
        --  using zip$(proj1$exA)$(proj2$exA) instead of exA    --
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   382
        --           because of admissibility problems          --
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   383
                             structural induction
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   384
  --------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   385
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   386
lemma filter_mkex_is_exA_tmp: "! exA exB s t.
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   387
  Forall (%x. x:act (A||B)) sch &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   388
  Filter (%a. a:act A)$sch << filter_act$exA  &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   389
  Filter (%a. a:act B)$sch << filter_act$exB
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   390
  --> Filter_ex2 (asig_of A)$(ProjA2$(snd (mkex A B sch (s,exA) (t,exB)))) =
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   391
      Zip$(Filter (%a. a:act A)$sch)$(Map snd$exA)"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   392
apply (tactic {* mkex_induct_tac @{context} "sch" "exB" "exA" *})
19741
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
(*---------------------------------------------------------------------------
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   396
                      zip$(proj1$y)$(proj2$y) = y   (using the lift operations)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   397
                    lemma for admissibility problems
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   398
  --------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   399
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   400
lemma Zip_Map_fst_snd: "Zip$(Map fst$y)$(Map snd$y) = y"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   401
apply (tactic {* Seq_induct_tac @{context} "y" [] 1 *})
19741
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
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   405
(*---------------------------------------------------------------------------
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   406
      filter A$sch = proj1$ex   -->  zip$(filter A$sch)$(proj2$ex) = ex
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   407
         lemma for eliminating non admissible equations in assumptions
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   408
  --------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   409
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   410
lemma trick_against_eq_in_ass: "!! sch ex.
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   411
  Filter (%a. a:act AB)$sch = filter_act$ex
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   412
  ==> ex = Zip$(Filter (%a. a:act AB)$sch)$(Map snd$ex)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   413
apply (simp add: filter_act_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   414
apply (rule Zip_Map_fst_snd [symmetric])
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   415
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   416
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   417
(*---------------------------------------------------------------------------
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   418
     Filter of mkex(sch,exA,exB) to A after projection onto A is exA
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   419
                       using the above trick
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   420
  --------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   421
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   422
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   423
lemma filter_mkex_is_exA: "!!sch exA exB.
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   424
  [| Forall (%a. a:act (A||B)) sch ;
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   425
  Filter (%a. a:act A)$sch = filter_act$(snd exA)  ;
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   426
  Filter (%a. a:act B)$sch = filter_act$(snd exB) |]
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   427
  ==> Filter_ex (asig_of A) (ProjA (mkex A B sch exA exB)) = exA"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   428
apply (simp add: ProjA_def Filter_ex_def)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   429
apply (tactic {* pair_tac @{context} "exA" 1 *})
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   430
apply (tactic {* pair_tac @{context} "exB" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   431
apply (rule conjI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   432
apply (simp (no_asm) add: mkex_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   433
apply (simplesubst trick_against_eq_in_ass)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   434
back
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   435
apply assumption
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   436
apply (simp add: filter_mkex_is_exA_tmp)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   437
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   438
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   439
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   440
(*---------------------------------------------------------------------------
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   441
     Filter of mkex(sch,exA,exB) to B after projection onto B is exB
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   442
        --  using zip$(proj1$exB)$(proj2$exB) instead of exB    --
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   443
        --           because of admissibility problems          --
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   444
                             structural induction
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   445
  --------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   446
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   447
lemma filter_mkex_is_exB_tmp: "! exA exB s t.
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   448
  Forall (%x. x:act (A||B)) sch &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   449
  Filter (%a. a:act A)$sch << filter_act$exA  &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   450
  Filter (%a. a:act B)$sch << filter_act$exB
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   451
  --> Filter_ex2 (asig_of B)$(ProjB2$(snd (mkex A B sch (s,exA) (t,exB)))) =
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   452
      Zip$(Filter (%a. a:act B)$sch)$(Map snd$exB)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   453
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   454
(* notice necessary change of arguments exA and exB *)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   455
apply (tactic {* mkex_induct_tac @{context} "sch" "exA" "exB" *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   456
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   457
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   458
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   459
(*---------------------------------------------------------------------------
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   460
     Filter of mkex(sch,exA,exB) to A after projection onto B is exB
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   461
                       using the above trick
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   462
  --------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   463
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   464
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   465
lemma filter_mkex_is_exB: "!!sch exA exB.
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   466
  [| Forall (%a. a:act (A||B)) sch ;
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   467
  Filter (%a. a:act A)$sch = filter_act$(snd exA)  ;
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   468
  Filter (%a. a:act B)$sch = filter_act$(snd exB) |]
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   469
  ==> Filter_ex (asig_of B) (ProjB (mkex A B sch exA exB)) = exB"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   470
apply (simp add: ProjB_def Filter_ex_def)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   471
apply (tactic {* pair_tac @{context} "exA" 1 *})
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   472
apply (tactic {* pair_tac @{context} "exB" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   473
apply (rule conjI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   474
apply (simp (no_asm) add: mkex_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   475
apply (simplesubst trick_against_eq_in_ass)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   476
back
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   477
apply assumption
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   478
apply (simp add: filter_mkex_is_exB_tmp)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   479
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   480
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   481
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   482
(*                    mkex has only  A- or B-actions                    *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   483
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   484
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   485
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   486
lemma mkex_actions_in_AorB: "!s t exA exB.
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   487
  Forall (%x. x : act (A || B)) sch &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   488
  Filter (%a. a:act A)$sch << filter_act$exA  &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   489
  Filter (%a. a:act B)$sch << filter_act$exB
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   490
   --> Forall (%x. fst x : act (A ||B))
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   491
         (snd (mkex A B sch (s,exA) (t,exB)))"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   492
apply (tactic {* mkex_induct_tac @{context} "sch" "exA" "exB" *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   493
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   494
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   495
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   496
(* ------------------------------------------------------------------ *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   497
(*           COMPOSITIONALITY   on    SCHEDULE      Level             *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   498
(*                          Main Theorem                              *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   499
(* ------------------------------------------------------------------ *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   500
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   501
lemma compositionality_sch:
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   502
"(sch : schedules (A||B)) =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   503
  (Filter (%a. a:act A)$sch : schedules A &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   504
   Filter (%a. a:act B)$sch : schedules B &
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   505
   Forall (%x. x:act (A||B)) sch)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   506
apply (simp (no_asm) add: schedules_def has_schedule_def)
26359
6d437bde2f1d more antiquotations
haftmann
parents: 25135
diff changeset
   507
apply auto
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   508
(* ==> *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   509
apply (rule_tac x = "Filter_ex (asig_of A) (ProjA ex) " in bexI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   510
prefer 2
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   511
apply (simp add: compositionality_ex)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   512
apply (simp (no_asm) add: Filter_ex_def ProjA_def lemma_2_1a lemma_2_1b)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   513
apply (rule_tac x = "Filter_ex (asig_of B) (ProjB ex) " in bexI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   514
prefer 2
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   515
apply (simp add: compositionality_ex)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   516
apply (simp (no_asm) add: Filter_ex_def ProjB_def lemma_2_1a lemma_2_1b)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   517
apply (simp add: executions_def)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   518
apply (tactic {* pair_tac @{context} "ex" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   519
apply (erule conjE)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   520
apply (simp add: sch_actions_in_AorB)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   521
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   522
(* <== *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   523
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   524
(* mkex is exactly the construction of exA||B out of exA, exB, and the oracle sch,
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   525
   we need here *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   526
apply (rename_tac exA exB)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   527
apply (rule_tac x = "mkex A B sch exA exB" in bexI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   528
(* mkex actions are just the oracle *)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   529
apply (tactic {* pair_tac @{context} "exA" 1 *})
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   530
apply (tactic {* pair_tac @{context} "exB" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   531
apply (simp add: Mapfst_mkex_is_sch)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   532
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   533
(* mkex is an execution -- use compositionality on ex-level *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   534
apply (simp add: compositionality_ex)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   535
apply (simp add: stutter_mkex_on_A stutter_mkex_on_B filter_mkex_is_exB filter_mkex_is_exA)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   536
apply (tactic {* pair_tac @{context} "exA" 1 *})
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   537
apply (tactic {* pair_tac @{context} "exB" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   538
apply (simp add: mkex_actions_in_AorB)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   539
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   540
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   541
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   542
subsection {* COMPOSITIONALITY on SCHEDULE Level -- for Modules *}
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   543
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   544
lemma compositionality_sch_modules:
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   545
  "Scheds (A||B) = par_scheds (Scheds A) (Scheds B)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   546
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   547
apply (unfold Scheds_def par_scheds_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   548
apply (simp add: asig_of_par)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   549
apply (rule set_ext)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   550
apply (simp add: compositionality_sch actions_of_par)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   551
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   552
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   553
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   554
declare compoex_simps [simp del]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   555
declare composch_simps [simp del]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   556
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   557
end