src/HOLCF/IOA/meta_theory/CompoScheds.thy
author aspinall
Fri, 30 Sep 2005 18:18:34 +0200
changeset 17740 fc385ce6187d
parent 17233 41eee2e7b465
child 19741 f65265d71426
permissions -rw-r--r--
Add icon for interface.
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
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    12
consts
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    13
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    14
 mkex     ::"('a,'s)ioa => ('a,'t)ioa => 'a Seq =>
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    15
              ('a,'s)execution => ('a,'t)execution =>('a,'s*'t)execution"
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    16
 mkex2    ::"('a,'s)ioa => ('a,'t)ioa => 'a Seq ->
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    17
              ('a,'s)pairs -> ('a,'t)pairs ->
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    18
              ('s => 't => ('a,'s*'t)pairs)"
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    19
 par_scheds ::"['a schedule_module,'a schedule_module] => 'a schedule_module"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    20
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    21
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    22
defs
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    23
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    24
mkex_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    25
  "mkex A B sch exA exB ==
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    26
       ((fst exA,fst exB),
10835
nipkow
parents: 3842
diff changeset
    27
        (mkex2 A B$sch$(snd exA)$(snd exB)) (fst exA) (fst exB))"
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    28
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    29
mkex2_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    30
  "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
    31
       nil => nil
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    32
    | x##xs =>
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    33
      (case x of
12028
52aa183c15bb replaced Undef by UU;
wenzelm
parents: 10835
diff changeset
    34
        UU => UU
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    35
      | Def y =>
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    36
         (if y:act A then
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    37
             (if y:act B then
10835
nipkow
parents: 3842
diff changeset
    38
                (case HD$exA of
12028
52aa183c15bb replaced Undef by UU;
wenzelm
parents: 10835
diff changeset
    39
                   UU => UU
10835
nipkow
parents: 3842
diff changeset
    40
                 | Def a => (case HD$exB of
12028
52aa183c15bb replaced Undef by UU;
wenzelm
parents: 10835
diff changeset
    41
                              UU => UU
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    42
                            | Def b =>
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    43
                   (y,(snd a,snd b))>>
10835
nipkow
parents: 3842
diff changeset
    44
                     (h$xs$(TL$exA)$(TL$exB)) (snd a) (snd b)))
3071
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    45
              else
10835
nipkow
parents: 3842
diff changeset
    46
                (case HD$exA of
12028
52aa183c15bb replaced Undef by UU;
wenzelm
parents: 10835
diff changeset
    47
                   UU => UU
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    48
                 | Def a =>
10835
nipkow
parents: 3842
diff changeset
    49
                   (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
    50
              )
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    51
          else
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    52
             (if y:act B then
10835
nipkow
parents: 3842
diff changeset
    53
                (case HD$exB of
12028
52aa183c15bb replaced Undef by UU;
wenzelm
parents: 10835
diff changeset
    54
                   UU => UU
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    55
                 | Def b =>
10835
nipkow
parents: 3842
diff changeset
    56
                   (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
    57
             else
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    58
               UU
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    59
             )
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    60
         )
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    61
       ))))"
981258186b71 New meta theory for IOA based on HOLCF.
mueller
parents:
diff changeset
    62
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    63
par_scheds_def:
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    64
  "par_scheds SchedsA SchedsB ==
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    65
       let schA = fst SchedsA; sigA = snd SchedsA;
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    66
           schB = fst SchedsB; sigB = snd SchedsB
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    67
       in
10835
nipkow
parents: 3842
diff changeset
    68
       (    {sch. Filter (%a. a:actions sigA)$sch : schA}
nipkow
parents: 3842
diff changeset
    69
        Int {sch. Filter (%a. a:actions sigB)$sch : schB}
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    70
        Int {sch. Forall (%x. x:(actions sigA Un actions sigB)) sch},
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    71
        asig_comp sigA sigB)"
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    72
17233
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    73
ML {* use_legacy_bindings (the_context ()) *}
41eee2e7b465 converted specifications to Isar theories;
wenzelm
parents: 14981
diff changeset
    74
3521
bdc51b4c6050 changes needed for adding fairness
mueller
parents: 3275
diff changeset
    75
end