Definition of the protocol  
Postscript version of the protocol definition. 
The BRP protocol 
is a variant of the alternating bit protocol, where not single messages,
but packages of arbitrary length are transmitted and 
the number of possible retransmissions per message is bounded by 
some number  max. We consider a fully parameterized
version of the
protocol where the packages can be of any size, and  max  any 
positive number. 
Each package contains an arbitrary number of messages.
There are three possible confirmations that the sender may deliver to its
client at the end of the transmission phase:  OK if all
 messages have been transmitted and acknowledged,  NOT_OK
 if the transmission has been aborted because 
more than max retransmissions would have been necessary to deliver a
message,  DONT_KNOW
 if the last message has not been acknowledged 
(in this case  it is not possible
to know if this message or its 
acknowledgment  has been lost).
The receiver acknowledges each received message, and delivers an indication to 
the receiving client. The indication is 
  FIRST for
the first received message of a package,  INCOMPLETE for any intermediate
 message, and
 OK for  the last message of the package.
In the case that the sender abandons the transmission of a package 
after sending
successfully at least one message, the receiver delivers
a not   NOT_OK indication.
There are two timers  T1
and  T2. Timeout of  T1 indicates to the sender that 
a message (or its acknowledgment) has been lost. Timeout of  T2
 indicates to the receiver that
the sender has  definitively abandoned the transmission of the package. 
The protocol is described in a syntax close to the Dijkstra guarded command language
with explicit control. The system consist in the parallel composition of a sender, 
a receiver and the environment (loss of messages).
The channels are not represented as processes, but just as shared variables.
 L_IN and L_OUT are respectively the list of acknowledged
and received messages. 
 
We consider only packages of messages with at least 3 messages, in
order to have the three possible indication: FIRST,INCOMPLETE and OK. 
The channels are not represented as processes, but just as shared variables.