src/HOL/IOA/ABP/Abschannel.thy
author clasohm
Fri, 01 Dec 1995 12:03:13 +0100
changeset 1376 92f83b9d17e1
parent 1151 c820b3cc3df0
child 1476 608483c2122a
permissions -rw-r--r--
removed quotes from consts and syntax sections
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1138
mueller
parents: 1050
diff changeset
     1
(*  Title:      HOL/IOA/example/Abschannels.thy
1050
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
1138
mueller
parents: 1050
diff changeset
     4
    Copyright   1994  TU Muenchen
1050
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 +
1138
mueller
parents: 1050
diff changeset
    10
mueller
parents: 1050
diff changeset
    11
1050
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    12
datatype ('a)act =   S('a) | R('a)
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    13
1138
mueller
parents: 1050
diff changeset
    14
1050
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    15
consts
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    16
 
1376
92f83b9d17e1 removed quotes from consts and syntax sections
clasohm
parents: 1151
diff changeset
    17
ch_asig  :: 'a act signature
92f83b9d17e1 removed quotes from consts and syntax sections
clasohm
parents: 1151
diff changeset
    18
ch_trans :: ('a act, 'a list)transition set
92f83b9d17e1 removed quotes from consts and syntax sections
clasohm
parents: 1151
diff changeset
    19
ch_ioa   :: ('a act, 'a list)ioa
1050
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    20
1376
92f83b9d17e1 removed quotes from consts and syntax sections
clasohm
parents: 1151
diff changeset
    21
rsch_actions  :: 'm action => bool act option
1050
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, 
1376
92f83b9d17e1 removed quotes from consts and syntax sections
clasohm
parents: 1151
diff changeset
    25
rsch_asig  :: 'm action signature
1050
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    26
1376
92f83b9d17e1 removed quotes from consts and syntax sections
clasohm
parents: 1151
diff changeset
    27
srch_trans :: ('m action, 'm packet list)transition set
92f83b9d17e1 removed quotes from consts and syntax sections
clasohm
parents: 1151
diff changeset
    28
rsch_trans :: ('m action, bool list)transition set
1050
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    29
1376
92f83b9d17e1 removed quotes from consts and syntax sections
clasohm
parents: 1151
diff changeset
    30
srch_ioa   :: ('m action, 'm packet list)ioa
92f83b9d17e1 removed quotes from consts and syntax sections
clasohm
parents: 1151
diff changeset
    31
rsch_ioa   :: ('m action, bool list)ioa   
1050
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
1138
mueller
parents: 1050
diff changeset
    45
  
mueller
parents: 1050
diff changeset
    46
(**********************************************************
mueller
parents: 1050
diff changeset
    47
       G e n e r i c   C h a n n e l
mueller
parents: 1050
diff changeset
    48
 *********************************************************)
mueller
parents: 1050
diff changeset
    49
  
1050
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    50
ch_asig_def "ch_asig == (UN b. {S(b)}, UN b. {R(b)}, {})"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    51
1151
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    52
ch_trans_def "ch_trans ==                                       
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    53
 {tr. let s = fst(tr);                                         
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    54
          t = snd(snd(tr))                                     
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    55
      in                                                       
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    56
      case fst(snd(tr))                                        
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    57
        of S(b) => ((t = s) | (t = s @ [b]))  |                
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    58
           R(b) => s ~= [] &                                   
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    59
	            b = hd(s) &                                 
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    60
	            ((t = s) | (t = tl(s)))    }"
1050
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    61
  
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    62
ch_ioa_def "ch_ioa == (ch_asig, {[]}, ch_trans)"
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    63
1138
mueller
parents: 1050
diff changeset
    64
(**********************************************************
mueller
parents: 1050
diff changeset
    65
  C o n c r e t e  C h a n n e l s  b y   R e n a m i n g 
mueller
parents: 1050
diff changeset
    66
 *********************************************************)
mueller
parents: 1050
diff changeset
    67
  
1151
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    68
rsch_actions_def "rsch_actions (akt) ==                      
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    69
	    case akt of   
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    70
           Next    =>  None |          
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    71
           S_msg(m) => None |         
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    72
	    R_msg(m) => None |         
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    73
           S_pkt(packet) => None |    
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    74
	    R_pkt(packet) => None |    
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    75
	    S_ack(b) => Some(S(b)) |   
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    76
	    R_ack(b) => Some(R(b))"
1050
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
    77
1151
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    78
srch_actions_def "srch_actions (akt) ==                      
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    79
	    case akt of   
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    80
	    Next    =>  None |          
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    81
           S_msg(m) => None |         
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    82
	    R_msg(m) => None |         
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    83
           S_pkt(p) => Some(S(p)) |   
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    84
	    R_pkt(p) => Some(R(p)) |   
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    85
	    S_ack(b) => None |         
c820b3cc3df0 removed \...\ inside strings
clasohm
parents: 1138
diff changeset
    86
	    R_ack(b) => None"
1050
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
end  
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
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
   100
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
   101
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
   102
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
   103
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
   104
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
   105
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
   106
0c36c6a52a1d ABP: Alternating bit protocol example
nipkow
parents:
diff changeset
   107