src/HOL/IOA/ABP/Abschannel.thy
author lcp
Tue, 25 Apr 1995 11:14:03 +0200
changeset 1072 0140ff702b23
parent 1050 0c36c6a52a1d
child 1138 82fd99d5a6ff
permissions -rw-r--r--
updated version
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1050
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/IOA/ABP/Abschannels.thy
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     2
    ID:         $Id$
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     3
    Author:     Olaf Mueller
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     4
    Copyright   1995  TU Muenchen
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     5
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     6
The transmission channel 
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     7
*)
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     8
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
     9
Abschannel = IOA + Action + Lemmas + List +
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    10
 
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    11
datatype ('a)act =   S('a) | R('a)
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    12
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    13
consts
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    14
 
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    15
ch_asig  :: "'a act signature"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    16
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    17
ch_trans :: "('a act, 'a list)transition set"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    18
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    19
ch_ioa   :: "('a act, 'a list)ioa"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    20
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    21
rsch_actions  :: "'m action => bool act option"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    22
srch_actions  :: "'m action =>(bool * 'm) act option"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    23
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    24
srch_asig, 
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    25
rsch_asig  :: "'m action signature"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    26
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    27
srch_trans :: "('m action, 'm packet list)transition set"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    28
rsch_trans :: "('m action, bool list)transition set"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    29
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    30
srch_ioa   :: "('m action, 'm packet list)ioa"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    31
rsch_ioa   :: "('m action, bool list)ioa"   
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    32
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    33
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    34
defs
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    35
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    36
srch_asig_def "srch_asig == asig_of(srch_ioa)"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    37
rsch_asig_def "rsch_asig == asig_of(rsch_ioa)"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    38
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    39
srch_trans_def "srch_trans == trans_of(srch_ioa)"  
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    40
rsch_trans_def "rsch_trans == trans_of(rsch_ioa)"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    41
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    42
srch_ioa_def "srch_ioa == rename ch_ioa srch_actions"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    43
rsch_ioa_def "rsch_ioa == rename ch_ioa rsch_actions"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    44
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    45
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    46
ch_asig_def "ch_asig == (UN b. {S(b)}, UN b. {R(b)}, {})"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    47
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    48
ch_trans_def "ch_trans ==                                       \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    49
\ {tr. let s = fst(tr);                                         \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    50
\          t = snd(snd(tr))                                     \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    51
\      in                                                       \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    52
\      case fst(snd(tr))                                        \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    53
\        of S(b) => ((t = s) | (t = s @ [b]))  |                \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    54
\           R(b) => s ~= [] &                                   \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    55
\	            b = hd(s) &                                 \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    56
\	            ((t = s) | (t = tl(s)))    }"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    57
  
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    58
ch_ioa_def "ch_ioa == (ch_asig, {[]}, ch_trans)"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    59
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    60
rsch_actions_def "rsch_actions (akt) ==                      \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    61
\	    case akt of   \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    62
\           Next    =>  None |          \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    63
\           S_msg(m) => None |         \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    64
\	    R_msg(m) => None |         \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    65
\           S_pkt(packet) => None |    \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    66
\	    R_pkt(packet) => None |    \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    67
\	    S_ack(b) => Some(S(b)) |   \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    68
\	    R_ack(b) => Some(R(b))"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    69
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    70
srch_actions_def "srch_actions (akt) ==                      \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    71
\	    case akt of   \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    72
\	    Next    =>  None |          \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    73
\           S_msg(m) => None |         \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    74
\	    R_msg(m) => None |         \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    75
\           S_pkt(p) => Some(S(p)) |   \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    76
\	    R_pkt(p) => Some(R(p)) |   \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    77
\	    S_ack(b) => None |         \
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    78
\	    R_ack(b) => None"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    79
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    80
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    81
end  
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    82
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    83
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    84
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    85
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    86
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    87
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    88
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    89
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    90
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    91
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    92
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    93
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    94
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    95
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    96
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    97
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    98
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    99