src/HOL/HOLCF/IOA/meta_theory/CompoExecs.thy
author wenzelm
Sun, 02 Nov 2014 17:16:01 +0100
changeset 58880 0baae4311a9f
parent 42151 4da4fc77664b
child 61999 89291b5d0ede
permissions -rw-r--r--
modernized header;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42151
4da4fc77664b tuned headers;
wenzelm
parents: 40945
diff changeset
     1
(*  Title:      HOL/HOLCF/IOA/meta_theory/CompoExecs.thy
40945
b8703f63bfb2 recoded latin1 as utf8;
wenzelm
parents: 40774
diff changeset
     2
    Author:     Olaf Müller
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     3
*)
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
     4
58880
0baae4311a9f modernized header;
wenzelm
parents: 42151
diff changeset
     5
section {* Compositionality on Execution level *}
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 CompoExecs
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
     8
imports Traces
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
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    11
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    12
  ProjA2 :: "('a,'s * 't)pairs -> ('a,'s)pairs" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    13
  "ProjA2 = Map (%x.(fst x,fst(snd x)))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    14
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    15
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    16
  ProjA :: "('a,'s * 't)execution => ('a,'s)execution" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    17
  "ProjA ex = (fst (fst ex), ProjA2$(snd ex))"
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    18
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    19
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    20
  ProjB2 :: "('a,'s * 't)pairs -> ('a,'t)pairs" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    21
  "ProjB2 = Map (%x.(fst x,snd(snd x)))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    22
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    23
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    24
  ProjB :: "('a,'s * 't)execution => ('a,'t)execution" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    25
  "ProjB ex = (snd (fst ex), ProjB2$(snd ex))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    26
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    27
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    28
  Filter_ex2 :: "'a signature => ('a,'s)pairs -> ('a,'s)pairs" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    29
  "Filter_ex2 sig = Filter (%x. fst x:actions sig)"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    30
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    31
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    32
  Filter_ex :: "'a signature => ('a,'s)execution => ('a,'s)execution" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    33
  "Filter_ex sig ex = (fst ex,Filter_ex2 sig$(snd ex))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    34
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    35
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    36
  stutter2 :: "'a signature => ('a,'s)pairs -> ('s => tr)" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    37
  "stutter2 sig = (fix$(LAM h ex. (%s. case ex of
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    38
      nil => TT
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    39
    | x##xs => (flift1
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    40
            (%p.(If Def ((fst p)~:actions sig)
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    41
                 then Def (s=(snd p))
40322
707eb30e8a53 make syntax of continuous if-then-else consistent with HOL if-then-else
huffman
parents: 39302
diff changeset
    42
                 else TT)
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    43
                andalso (h$xs) (snd p))
10835
nipkow
parents: 3842
diff changeset
    44
             $x)
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    45
   )))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    46
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    47
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    48
  stutter :: "'a signature => ('a,'s)execution => bool" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    49
  "stutter sig ex = ((stutter2 sig$(snd ex)) (fst ex) ~= FF)"
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    50
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    51
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    52
  par_execs :: "[('a,'s)execution_module,('a,'t)execution_module] => ('a,'s*'t)execution_module" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    53
  "par_execs ExecsA ExecsB =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    54
      (let exA = fst ExecsA; sigA = snd ExecsA;
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    55
           exB = fst ExecsB; sigB = snd ExecsB
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    56
       in
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    57
       (    {ex. Filter_ex sigA (ProjA ex) : exA}
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    58
        Int {ex. Filter_ex sigB (ProjB ex) : exB}
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    59
        Int {ex. stutter sigA (ProjA ex)}
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    60
        Int {ex. stutter sigB (ProjB ex)}
3842
b55686a7b22c fixed dots;
wenzelm
parents: 3521
diff changeset
    61
        Int {ex. Forall (%x. fst x:(actions sigA Un actions sigB)) (snd ex)},
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    62
        asig_comp sigA sigB))"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    63
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    64
35215
a03462cbf86f get rid of warnings about duplicate simp rules in all HOLCF theories
huffman
parents: 35174
diff changeset
    65
lemmas [simp del] = split_paired_All
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    66
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    67
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    68
section "recursive equations of operators"
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
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    72
(*                               ProjA2                             *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    73
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    74
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    75
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    76
lemma ProjA2_UU: "ProjA2$UU = UU"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    77
apply (simp add: ProjA2_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    78
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    79
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    80
lemma ProjA2_nil: "ProjA2$nil = nil"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    81
apply (simp add: ProjA2_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    82
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    83
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    84
lemma ProjA2_cons: "ProjA2$((a,t)>>xs) = (a,fst t) >> ProjA2$xs"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    85
apply (simp add: ProjA2_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    86
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    87
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    88
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    89
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    90
(*                               ProjB2                             *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    91
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    92
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    93
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    94
lemma ProjB2_UU: "ProjB2$UU = UU"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    95
apply (simp add: ProjB2_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    96
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    97
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    98
lemma ProjB2_nil: "ProjB2$nil = nil"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    99
apply (simp add: ProjB2_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   100
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   101
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   102
lemma ProjB2_cons: "ProjB2$((a,t)>>xs) = (a,snd t) >> ProjB2$xs"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   103
apply (simp add: ProjB2_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   104
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   105
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   106
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   107
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   108
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   109
(*                             Filter_ex2                           *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   110
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   111
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   112
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   113
lemma Filter_ex2_UU: "Filter_ex2 sig$UU=UU"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   114
apply (simp add: Filter_ex2_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   115
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   116
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   117
lemma Filter_ex2_nil: "Filter_ex2 sig$nil=nil"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   118
apply (simp add: Filter_ex2_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   119
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   120
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   121
lemma Filter_ex2_cons: "Filter_ex2 sig$(at >> xs) =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   122
             (if (fst at:actions sig)
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   123
                  then at >> (Filter_ex2 sig$xs)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   124
                  else        Filter_ex2 sig$xs)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   125
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   126
apply (simp add: Filter_ex2_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   127
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   128
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   129
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   130
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   131
(*                             stutter2                             *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   132
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   133
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   134
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   135
lemma stutter2_unfold: "stutter2 sig = (LAM ex. (%s. case ex of
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   136
       nil => TT
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   137
     | x##xs => (flift1
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   138
             (%p.(If Def ((fst p)~:actions sig)
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   139
                  then Def (s=(snd p))
40322
707eb30e8a53 make syntax of continuous if-then-else consistent with HOL if-then-else
huffman
parents: 39302
diff changeset
   140
                  else TT)
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   141
                 andalso (stutter2 sig$xs) (snd p))
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   142
              $x)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   143
            ))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   144
apply (rule trans)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   145
apply (rule fix_eq2)
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   146
apply (simp only: stutter2_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   147
apply (rule beta_cfun)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   148
apply (simp add: flift1_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   149
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   150
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   151
lemma stutter2_UU: "(stutter2 sig$UU) s=UU"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   152
apply (subst stutter2_unfold)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   153
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   154
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   155
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   156
lemma stutter2_nil: "(stutter2 sig$nil) s = TT"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   157
apply (subst stutter2_unfold)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   158
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   159
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   160
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   161
lemma stutter2_cons: "(stutter2 sig$(at>>xs)) s =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   162
               ((if (fst at)~:actions sig then Def (s=snd at) else TT)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   163
                 andalso (stutter2 sig$xs) (snd at))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   164
apply (rule trans)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   165
apply (subst stutter2_unfold)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   166
apply (simp add: Consq_def flift1_def If_and_if)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   167
apply simp
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   168
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   169
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   170
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   171
declare stutter2_UU [simp] stutter2_nil [simp] stutter2_cons [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   172
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   173
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   174
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   175
(*                             stutter                              *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   176
(* ---------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   177
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   178
lemma stutter_UU: "stutter sig (s, UU)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   179
apply (simp add: stutter_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   180
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   181
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   182
lemma stutter_nil: "stutter sig (s, nil)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   183
apply (simp add: stutter_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   184
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   185
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   186
lemma stutter_cons: "stutter sig (s, (a,t)>>ex) =
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   187
      ((a~:actions sig --> (s=t)) & stutter sig (t,ex))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   188
apply (simp add: stutter_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   189
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   190
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   191
(* ----------------------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   192
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   193
declare stutter2_UU [simp del] stutter2_nil [simp del] stutter2_cons [simp del]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   194
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   195
lemmas compoex_simps = ProjA2_UU ProjA2_nil ProjA2_cons
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   196
  ProjB2_UU ProjB2_nil ProjB2_cons
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   197
  Filter_ex2_UU Filter_ex2_nil Filter_ex2_cons
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   198
  stutter_UU stutter_nil stutter_cons
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   199
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   200
declare compoex_simps [simp]
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
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   204
(* ------------------------------------------------------------------ *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   205
(*                      The following lemmata aim for                 *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   206
(*             COMPOSITIONALITY   on    EXECUTION     Level           *)
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
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   211
(*  Lemma_1_1a : is_ex_fr propagates from A||B to Projections A and B    *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   212
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   213
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   214
lemma lemma_1_1a: "!s. is_exec_frag (A||B) (s,xs)
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   215
       -->  is_exec_frag A (fst s, Filter_ex2 (asig_of A)$(ProjA2$xs)) &
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   216
            is_exec_frag B (snd s, Filter_ex2 (asig_of B)$(ProjB2$xs))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   217
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   218
apply (tactic {* pair_induct_tac @{context} "xs" [@{thm is_exec_frag_def}] 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   219
(* main case *)
26359
6d437bde2f1d more antiquotations
haftmann
parents: 25135
diff changeset
   220
apply (auto simp add: trans_of_defs2)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   221
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   222
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   223
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   224
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   225
(*  Lemma_1_1b : is_ex_fr (A||B) implies stuttering on Projections       *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   226
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   227
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   228
lemma lemma_1_1b: "!s. is_exec_frag (A||B) (s,xs)
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   229
       --> stutter (asig_of A) (fst s,ProjA2$xs)  &
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   230
           stutter (asig_of B) (snd s,ProjB2$xs)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   231
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   232
apply (tactic {* pair_induct_tac @{context} "xs"
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   233
  [@{thm stutter_def}, @{thm is_exec_frag_def}] 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   234
(* main case *)
26359
6d437bde2f1d more antiquotations
haftmann
parents: 25135
diff changeset
   235
apply (auto simp add: trans_of_defs2)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   236
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   237
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   238
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   239
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   240
(*  Lemma_1_1c : Executions of A||B have only  A- or B-actions           *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   241
(* --------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   242
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   243
lemma lemma_1_1c: "!s. (is_exec_frag (A||B) (s,xs)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   244
   --> Forall (%x. fst x:act (A||B)) xs)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   245
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   246
apply (tactic {* pair_induct_tac @{context} "xs" [@{thm Forall_def}, @{thm sforall_def},
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   247
  @{thm is_exec_frag_def}] 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   248
(* main case *)
26359
6d437bde2f1d more antiquotations
haftmann
parents: 25135
diff changeset
   249
apply auto
6d437bde2f1d more antiquotations
haftmann
parents: 25135
diff changeset
   250
apply (simp add: trans_of_defs2 actions_asig_comp asig_of_par)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   251
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   252
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   253
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   254
(* ----------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   255
(*  Lemma_1_2 : ex A, exB, stuttering and forall a:A|B implies ex (A||B)   *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   256
(* ----------------------------------------------------------------------- *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   257
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   258
lemma lemma_1_2:
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   259
"!s. is_exec_frag A (fst s,Filter_ex2 (asig_of A)$(ProjA2$xs)) &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   260
     is_exec_frag B (snd s,Filter_ex2 (asig_of B)$(ProjB2$xs)) &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   261
     stutter (asig_of A) (fst s,(ProjA2$xs)) &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   262
     stutter (asig_of B) (snd s,(ProjB2$xs)) &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   263
     Forall (%x. fst x:act (A||B)) xs
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   264
     --> is_exec_frag (A||B) (s,xs)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   265
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   266
apply (tactic {* pair_induct_tac @{context} "xs" [@{thm Forall_def}, @{thm sforall_def},
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   267
  @{thm is_exec_frag_def}, @{thm stutter_def}] 1 *})
26359
6d437bde2f1d more antiquotations
haftmann
parents: 25135
diff changeset
   268
apply (auto simp add: trans_of_defs1 actions_asig_comp asig_of_par)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   269
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   270
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   271
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   272
subsection {* COMPOSITIONALITY on EXECUTION Level -- Main Theorem *}
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   273
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   274
lemma compositionality_ex:
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   275
"(ex:executions(A||B)) =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   276
 (Filter_ex (asig_of A) (ProjA ex) : executions A &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   277
  Filter_ex (asig_of B) (ProjB ex) : executions B &
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   278
  stutter (asig_of A) (ProjA ex) & stutter (asig_of B) (ProjB ex) &
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   279
  Forall (%x. fst x:act (A||B)) (snd ex))"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   280
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   281
apply (simp (no_asm) add: executions_def ProjB_def Filter_ex_def ProjA_def starts_of_par)
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 26359
diff changeset
   282
apply (tactic {* pair_tac @{context} "ex" 1 *})
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   283
apply (rule iffI)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   284
(* ==>  *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   285
apply (erule conjE)+
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   286
apply (simp add: lemma_1_1a lemma_1_1b lemma_1_1c)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   287
(* <==  *)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   288
apply (erule conjE)+
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   289
apply (simp add: lemma_1_2)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   290
done
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   291
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   292
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   293
subsection {* COMPOSITIONALITY on EXECUTION Level -- for Modules *}
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   294
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   295
lemma compositionality_ex_modules:
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   296
  "Execs (A||B) = par_execs (Execs A) (Execs B)"
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   297
apply (unfold Execs_def par_execs_def)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   298
apply (simp add: asig_of_par)
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 35215
diff changeset
   299
apply (rule set_eqI)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   300
apply (simp add: compositionality_ex actions_of_par)
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   301
done
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   302
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   303
end