src/HOL/HOLCF/IOA/CompoExecs.thy
author wenzelm
Mon, 11 Jan 2016 00:04:23 +0100
changeset 62116 bc178c0fe1a1
parent 62008 cbedaddc9351
child 62195 799a5306e2ed
permissions -rw-r--r--
misc tuning and modernization;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
62008
cbedaddc9351 clarified directory structure;
wenzelm
parents: 62002
diff changeset
     1
(*  Title:      HOL/HOLCF/IOA/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
62002
f1599e98c4d0 isabelle update_cartouches -c -t;
wenzelm
parents: 62001
diff changeset
     5
section \<open>Compositionality on Execution level\<close>
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
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    11
definition ProjA2 :: "('a, 's \<times> 't) pairs \<rightarrow> ('a, 's) pairs"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    12
  where "ProjA2 = Map (\<lambda>x. (fst x, fst (snd x)))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    13
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    14
definition ProjA :: "('a, 's \<times> 't) execution \<Rightarrow> ('a, 's) execution"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    15
  where "ProjA ex = (fst (fst ex), ProjA2 $ (snd ex))"
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    16
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    17
definition ProjB2 :: "('a, 's \<times> 't) pairs \<rightarrow> ('a, 't) pairs"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    18
  where "ProjB2 = Map (\<lambda>x. (fst x, snd (snd x)))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    19
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    20
definition ProjB :: "('a, 's \<times> 't) execution \<Rightarrow> ('a, 't) execution"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    21
  where "ProjB ex = (snd (fst ex), ProjB2 $ (snd ex))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    22
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    23
definition Filter_ex2 :: "'a signature \<Rightarrow> ('a, 's) pairs \<rightarrow> ('a, 's) pairs"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    24
  where "Filter_ex2 sig = Filter (\<lambda>x. fst x \<in> actions sig)"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    25
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    26
definition Filter_ex :: "'a signature \<Rightarrow> ('a, 's) execution \<Rightarrow> ('a, 's) execution"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    27
  where "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
    28
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    29
definition stutter2 :: "'a signature \<Rightarrow> ('a, 's) pairs \<rightarrow> ('s \<Rightarrow> tr)"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    30
  where "stutter2 sig =
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    31
    (fix $
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    32
      (LAM h ex.
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    33
        (\<lambda>s.
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    34
          case ex of
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    35
            nil \<Rightarrow> TT
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    36
          | x ## xs \<Rightarrow>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    37
              (flift1
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    38
                (\<lambda>p.
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    39
                  (If Def (fst p \<notin> actions sig) then Def (s = snd p) else TT)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    40
                  andalso (h$xs) (snd p)) $ x))))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    41
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    42
definition stutter :: "'a signature \<Rightarrow> ('a, 's) execution \<Rightarrow> bool"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    43
  where "stutter sig ex \<longleftrightarrow> (stutter2 sig $ (snd ex)) (fst ex) \<noteq> FF"
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    44
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    45
definition par_execs ::
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    46
  "('a, 's) execution_module \<Rightarrow> ('a, 't) execution_module \<Rightarrow> ('a, 's \<times> 't) execution_module"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    47
  where "par_execs ExecsA ExecsB =
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    48
    (let
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    49
      exA = fst ExecsA; sigA = snd ExecsA;
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    50
      exB = fst ExecsB; sigB = snd ExecsB
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    51
     in
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    52
       ({ex. Filter_ex sigA (ProjA ex) \<in> exA} \<inter>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    53
        {ex. Filter_ex sigB (ProjB ex) \<in> exB} \<inter>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    54
        {ex. stutter sigA (ProjA ex)} \<inter>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    55
        {ex. stutter sigB (ProjB ex)} \<inter>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    56
        {ex. Forall (\<lambda>x. fst x \<in> actions sigA \<union> actions sigB) (snd ex)},
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
    57
        asig_comp sigA sigB))"
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    58
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    59
35215
a03462cbf86f get rid of warnings about duplicate simp rules in all HOLCF theories
huffman
parents: 35174
diff changeset
    60
lemmas [simp del] = split_paired_All
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    61
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    62
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    63
section \<open>Recursive equations of operators\<close>
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    64
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    65
subsection \<open>\<open>ProjA2\<close>\<close>
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    66
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    67
lemma ProjA2_UU: "ProjA2 $ UU = UU"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    68
  by (simp add: ProjA2_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    69
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    70
lemma ProjA2_nil: "ProjA2 $ nil = nil"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    71
  by (simp add: ProjA2_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    72
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    73
lemma ProjA2_cons: "ProjA2 $ ((a, t) \<leadsto> xs) = (a, fst t) \<leadsto> ProjA2 $ xs"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    74
  by (simp add: ProjA2_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    75
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    76
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    77
subsection \<open>\<open>ProjB2\<close>\<close>
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    78
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    79
lemma ProjB2_UU: "ProjB2 $ UU = UU"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    80
  by (simp add: ProjB2_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    81
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    82
lemma ProjB2_nil: "ProjB2 $ nil = nil"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    83
  by (simp add: ProjB2_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    84
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    85
lemma ProjB2_cons: "ProjB2 $ ((a, t) \<leadsto> xs) = (a, snd t) \<leadsto> ProjB2 $ xs"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    86
  by (simp add: ProjB2_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    87
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    88
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    89
subsection \<open>\<open>Filter_ex2\<close>\<close>
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    90
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    91
lemma Filter_ex2_UU: "Filter_ex2 sig $ UU = UU"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    92
  by (simp add: Filter_ex2_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    93
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    94
lemma Filter_ex2_nil: "Filter_ex2 sig $ nil = nil"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    95
  by (simp add: Filter_ex2_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
    96
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    97
lemma Filter_ex2_cons:
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    98
  "Filter_ex2 sig $ (at \<leadsto> xs) =
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
    99
    (if fst at \<in> actions sig
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   100
     then at \<leadsto> (Filter_ex2 sig $ xs)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   101
     else Filter_ex2 sig $ xs)"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   102
  by (simp add: Filter_ex2_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   103
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   104
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   105
subsection \<open>\<open>stutter2\<close>\<close>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   106
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   107
lemma stutter2_unfold:
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   108
  "stutter2 sig =
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   109
    (LAM ex.
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   110
      (\<lambda>s.
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   111
        case ex of
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   112
          nil \<Rightarrow> TT
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   113
        | x ## xs \<Rightarrow>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   114
            (flift1
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   115
              (\<lambda>p.
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   116
                (If Def (fst p \<notin> actions sig) then Def (s= snd p) else TT)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   117
                andalso (stutter2 sig$xs) (snd p)) $ x)))"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   118
  apply (rule trans)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   119
  apply (rule fix_eq2)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   120
  apply (simp only: stutter2_def)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   121
  apply (rule beta_cfun)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   122
  apply (simp add: flift1_def)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   123
  done
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   124
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   125
lemma stutter2_UU: "(stutter2 sig $ UU) s = UU"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   126
  apply (subst stutter2_unfold)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   127
  apply simp
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   128
  done
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   129
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   130
lemma stutter2_nil: "(stutter2 sig $ nil) s = TT"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   131
  apply (subst stutter2_unfold)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   132
  apply simp
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   133
  done
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   134
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   135
lemma stutter2_cons:
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   136
  "(stutter2 sig $ (at \<leadsto> xs)) s =
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   137
    ((if fst at \<notin> actions sig then Def (s = snd at) else TT)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   138
      andalso (stutter2 sig $ xs) (snd at))"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   139
  apply (rule trans)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   140
  apply (subst stutter2_unfold)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   141
  apply (simp add: Consq_def flift1_def If_and_if)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   142
  apply simp
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   143
  done
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   144
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   145
declare stutter2_UU [simp] stutter2_nil [simp] stutter2_cons [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   146
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   147
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   148
subsection \<open>\<open>stutter\<close>\<close>
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   149
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   150
lemma stutter_UU: "stutter sig (s, UU)"
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   151
  by (simp add: stutter_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   152
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   153
lemma stutter_nil: "stutter sig (s, nil)"
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   154
  by (simp add: stutter_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   155
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   156
lemma stutter_cons:
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   157
  "stutter sig (s, (a, t) \<leadsto> ex) \<longleftrightarrow> (a \<notin> actions sig \<longrightarrow> (s = t)) \<and> stutter sig (t, ex)"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   158
  by (simp add: stutter_def)
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   159
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   160
declare stutter2_UU [simp del] stutter2_nil [simp del] stutter2_cons [simp del]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   161
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   162
lemmas compoex_simps = ProjA2_UU ProjA2_nil ProjA2_cons
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   163
  ProjB2_UU ProjB2_nil ProjB2_cons
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   164
  Filter_ex2_UU Filter_ex2_nil Filter_ex2_cons
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   165
  stutter_UU stutter_nil stutter_cons
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   166
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   167
declare compoex_simps [simp]
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   168
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   169
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   170
section \<open>Compositionality on execution level\<close>
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   171
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   172
lemma lemma_1_1a:
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   173
  \<comment> \<open>\<open>is_ex_fr\<close> propagates from \<open>A \<parallel> B\<close> to projections \<open>A\<close> and \<open>B\<close>\<close>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   174
  "\<forall>s. is_exec_frag (A \<parallel> B) (s, xs) \<longrightarrow>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   175
    is_exec_frag A (fst s, Filter_ex2 (asig_of A) $ (ProjA2 $ xs)) \<and>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   176
    is_exec_frag B (snd s, Filter_ex2 (asig_of B) $ (ProjB2 $ xs))"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   177
  apply (tactic \<open>pair_induct_tac @{context} "xs" [@{thm is_exec_frag_def}] 1\<close>)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   178
  text \<open>main case\<close>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   179
  apply (auto simp add: trans_of_defs2)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   180
  done
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   181
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   182
lemma lemma_1_1b:
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   183
  \<comment> \<open>\<open>is_ex_fr (A \<parallel> B)\<close> implies stuttering on projections\<close>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   184
  "\<forall>s. is_exec_frag (A \<parallel> B) (s, xs) \<longrightarrow>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   185
    stutter (asig_of A) (fst s, ProjA2 $ xs) \<and>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   186
    stutter (asig_of B) (snd s, ProjB2 $ xs)"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   187
  apply (tactic \<open>pair_induct_tac @{context} "xs" @{thms stutter_def is_exec_frag_def} 1\<close>)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   188
  text \<open>main case\<close>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   189
  apply (auto simp add: trans_of_defs2)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   190
  done
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   191
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   192
lemma lemma_1_1c:
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   193
  \<comment> \<open>Executions of \<open>A \<parallel> B\<close> have only \<open>A\<close>- or \<open>B\<close>-actions\<close>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   194
  "\<forall>s. is_exec_frag (A \<parallel> B) (s, xs) \<longrightarrow> Forall (\<lambda>x. fst x \<in> act (A \<parallel> B)) xs"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   195
  apply (tactic \<open>pair_induct_tac @{context} "xs" [@{thm Forall_def}, @{thm sforall_def},
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   196
    @{thm is_exec_frag_def}] 1\<close>)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   197
  text \<open>main case\<close>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   198
  apply auto
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   199
  apply (simp add: trans_of_defs2 actions_asig_comp asig_of_par)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   200
  done
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   201
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19741
diff changeset
   202
lemma lemma_1_2:
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   203
  \<comment> \<open>\<open>ex A\<close>, \<open>exB\<close>, stuttering and forall \<open>a \<in> A \<parallel> B\<close> implies \<open>ex (A \<parallel> B)\<close>\<close>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   204
  "\<forall>s.
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   205
    is_exec_frag A (fst s, Filter_ex2 (asig_of A) $ (ProjA2 $ xs)) \<and>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   206
    is_exec_frag B (snd s, Filter_ex2 (asig_of B) $ (ProjB2 $ xs)) \<and>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   207
    stutter (asig_of A) (fst s, ProjA2 $ xs) \<and>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   208
    stutter (asig_of B) (snd s, ProjB2 $ xs) \<and>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   209
    Forall (\<lambda>x. fst x \<in> act (A \<parallel> B)) xs \<longrightarrow>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   210
    is_exec_frag (A \<parallel> B) (s, xs)"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   211
  apply (tactic \<open>pair_induct_tac @{context} "xs"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   212
    @{thms Forall_def sforall_def is_exec_frag_def stutter_def} 1\<close>)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   213
  apply (auto simp add: trans_of_defs1 actions_asig_comp asig_of_par)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   214
  done
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   215
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   216
theorem compositionality_ex:
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   217
  "ex \<in> executions (A \<parallel> B) \<longleftrightarrow>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   218
    Filter_ex (asig_of A) (ProjA ex) : executions A \<and>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   219
    Filter_ex (asig_of B) (ProjB ex) : executions B \<and>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   220
    stutter (asig_of A) (ProjA ex) \<and>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   221
    stutter (asig_of B) (ProjB ex) \<and>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   222
    Forall (\<lambda>x. fst x \<in> act (A \<parallel> B)) (snd ex)"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   223
  apply (simp add: executions_def ProjB_def Filter_ex_def ProjA_def starts_of_par)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   224
  apply (tactic \<open>pair_tac @{context} "ex" 1\<close>)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   225
  apply (rule iffI)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   226
  text \<open>\<open>\<Longrightarrow>\<close>\<close>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   227
  apply (erule conjE)+
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   228
  apply (simp add: lemma_1_1a lemma_1_1b lemma_1_1c)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   229
  text \<open>\<open>\<Longleftarrow>\<close>\<close>
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   230
  apply (erule conjE)+
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   231
  apply (simp add: lemma_1_2)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   232
  done
19741
f65265d71426 removed legacy ML scripts;
wenzelm
parents: 17233
diff changeset
   233
62116
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   234
theorem compositionality_ex_modules: "Execs (A \<parallel> B) = par_execs (Execs A) (Execs B)"
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   235
  apply (unfold Execs_def par_execs_def)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   236
  apply (simp add: asig_of_par)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   237
  apply (rule set_eqI)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   238
  apply (simp add: compositionality_ex actions_of_par)
bc178c0fe1a1 misc tuning and modernization;
wenzelm
parents: 62008
diff changeset
   239
  done
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   240
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
   241
end