| 
3071
 | 
     1  | 
(*  Title:      HOLCF/IOA/meta_theory/CompoTraces.thy
  | 
| 
3275
 | 
     2  | 
    ID:         $Id$
  | 
| 
12218
 | 
     3  | 
    Author:     Olaf Müller
  | 
| 
3071
 | 
     4  | 
*) 
  | 
| 
 | 
     5  | 
  | 
| 
17233
 | 
     6  | 
header {* Compositionality on Trace level *}
 | 
| 
 | 
     7  | 
  | 
| 
 | 
     8  | 
theory CompoTraces
  | 
| 
 | 
     9  | 
imports CompoScheds ShortExecutions
  | 
| 
 | 
    10  | 
begin
  | 
| 
3071
 | 
    11  | 
 
  | 
| 
 | 
    12  | 
  | 
| 
 | 
    13  | 
consts  
  | 
| 
 | 
    14  | 
  | 
| 
3521
 | 
    15  | 
 mksch      ::"('a,'s)ioa => ('a,'t)ioa => 'a Seq -> 'a Seq -> 'a Seq -> 'a Seq" 
 | 
| 
 | 
    16  | 
 par_traces ::"['a trace_module,'a trace_module] => 'a trace_module"
  | 
| 
3071
 | 
    17  | 
  | 
| 
 | 
    18  | 
defs
  | 
| 
 | 
    19  | 
  | 
| 
17233
 | 
    20  | 
mksch_def:
  | 
| 
10835
 | 
    21  | 
  "mksch A B == (fix$(LAM h tr schA schB. case tr of 
  | 
| 
3071
 | 
    22  | 
       nil => nil
  | 
| 
 | 
    23  | 
    | x##xs => 
  | 
| 
 | 
    24  | 
      (case x of 
  | 
| 
12028
 | 
    25  | 
        UU => UU
  | 
| 
3071
 | 
    26  | 
      | Def y => 
  | 
| 
 | 
    27  | 
         (if y:act A then 
  | 
| 
 | 
    28  | 
             (if y:act B then 
  | 
| 
10835
 | 
    29  | 
                   ((Takewhile (%a. a:int A)$schA)
  | 
| 
 | 
    30  | 
                      @@ (Takewhile (%a. a:int B)$schB)
  | 
| 
 | 
    31  | 
                           @@ (y>>(h$xs
  | 
| 
 | 
    32  | 
                                    $(TL$(Dropwhile (%a. a:int A)$schA))
  | 
| 
 | 
    33  | 
                                    $(TL$(Dropwhile (%a. a:int B)$schB))
  | 
| 
3071
 | 
    34  | 
                    )))
  | 
| 
 | 
    35  | 
              else
  | 
| 
10835
 | 
    36  | 
                 ((Takewhile (%a. a:int A)$schA)
  | 
| 
 | 
    37  | 
                  @@ (y>>(h$xs
  | 
| 
 | 
    38  | 
                           $(TL$(Dropwhile (%a. a:int A)$schA))
  | 
| 
 | 
    39  | 
                           $schB)))
  | 
| 
3071
 | 
    40  | 
              )
  | 
| 
 | 
    41  | 
          else 
  | 
| 
 | 
    42  | 
             (if y:act B then 
  | 
| 
10835
 | 
    43  | 
                 ((Takewhile (%a. a:int B)$schB)
  | 
| 
 | 
    44  | 
                     @@ (y>>(h$xs
  | 
| 
 | 
    45  | 
                              $schA
  | 
| 
 | 
    46  | 
                              $(TL$(Dropwhile (%a. a:int B)$schB))
  | 
| 
3071
 | 
    47  | 
                              )))
  | 
| 
 | 
    48  | 
             else
  | 
| 
 | 
    49  | 
               UU
  | 
| 
 | 
    50  | 
             )
  | 
| 
 | 
    51  | 
         )
  | 
| 
 | 
    52  | 
       )))"
  | 
| 
 | 
    53  | 
  | 
| 
 | 
    54  | 
  | 
| 
17233
 | 
    55  | 
par_traces_def:
  | 
| 
3521
 | 
    56  | 
  "par_traces TracesA TracesB == 
  | 
| 
 | 
    57  | 
       let trA = fst TracesA; sigA = snd TracesA; 
  | 
| 
 | 
    58  | 
           trB = fst TracesB; sigB = snd TracesB       
  | 
| 
 | 
    59  | 
       in
  | 
| 
10835
 | 
    60  | 
       (    {tr. Filter (%a. a:actions sigA)$tr : trA}
 | 
| 
 | 
    61  | 
        Int {tr. Filter (%a. a:actions sigB)$tr : trB}
 | 
| 
3521
 | 
    62  | 
        Int {tr. Forall (%x. x:(externals sigA Un externals sigB)) tr},
 | 
| 
 | 
    63  | 
        asig_comp sigA sigB)"
  | 
| 
 | 
    64  | 
  | 
| 
17233
 | 
    65  | 
axioms
  | 
| 
3071
 | 
    66  | 
  | 
| 
17233
 | 
    67  | 
finiteR_mksch:
  | 
| 
10835
 | 
    68  | 
  "Finite (mksch A B$tr$x$y) --> Finite tr"
  | 
| 
3071
 | 
    69  | 
  | 
| 
17233
 | 
    70  | 
ML {* use_legacy_bindings (the_context ()) *}
 | 
| 
3071
 | 
    71  | 
  | 
| 
 | 
    72  | 
  | 
| 
 | 
    73  | 
end
  |