/* TROJKA version: * based on the conf-solo13.trojka; assumed correct specification * * conf-solo14.trojka: Fri Feb 26 13:44:15 MET 1999 * changed: no nick change allowed again by receiving an answer/join PDU * from an already joined conference partner, although a join PDU results * always in an answer PDU. written to find other failures in Jan F. * implementation. * */ /* [file: conf-solo.pr, started: 19-May-98] * based on: conference.pr draft version: Theo C. Ruys * draft version: Rene G. de Vries * * DESCRIPTION * The Conference Protocol in Promela. Modelling the PE. * * * * NOTES * o SOURCE. See the reader [Pires 1997], i.e. * "Protocol Implementation" by Luis Pires, 1995-1997 * for details on the Conference Protocol. * * o NUMBER OF USERS. The current default for the number of users N * is set to 3. The maxium number of users (participating PE is 256) * * * * * * CHANGES * 98.05.19 ruys Started. * 98.05.26 ruys First version that can be simulated with Spin v3.2.0. * 98.06.03 ruys Changes: * - Several errors have been removed. * - The operations on set of addresses (T_AddressSet) * are now implemented by macros. * - The specification is heavily parameterized by N, * the number of Users. * Currently N can be either 2 or 3. * 98.06.xx ruys Changes: * - TODO: MOST CHANGES NEEDS SOME COMMENTS * - Various optimizations: * - removed redundant parameters from messages * - added atomic clauses * - added xs/xr declarations * - made User() process finite * - Splitted User() process into * UserSend() and UserRecv() process. * 98.11.27 de Vries Changes: * - stripped... modelling only one Protocol Entity (PE) * 98.11.30 de Vries Changes: * - TODO: including different conference: include confid */ /* ------------------------------ constants ------------------------------- */ #define N 3 /* MAX Number of participants to CS */ #define ZZ 0 /* Null message */ /* -------------------------------- macros -------------------------------- */ #define IF if :: #define FI :: else fi /* -------------------------- user defined types -------------------------- */ #define T_Msg byte #define T_Address byte mtype = { JOIN, LEAVE, DREQ, DIND, /* Conference Service - SP's */ U_DREQ, U_DIND, /* Multicast Service - SP's */ PDU_JOIN, PDU_LEAVE, PDU_DATA, PDU_ANSWER /* PDU Types */ } ; /* NOTE: The distinction between JOIN and PDU_JOIN, etc. only serves to */ /* make the 'Conf_PE' process more readable. */ /* ----------------------------- T_AddressSet ----------------------------- */ /* T_AddressSet * An T_Address of a SAP (or PE) is modelled by a * byte (i.e. 0, 1, 2, 3, etc.) * * A set of addresses is implemented as a bit-set and mapped upon * a single byte. An address is a member of a set if the position in * corresponding bit-set is set. The position is counted from the * right side (least significant bit) of the bit-set. * So, a set consisting of a single address 'i' is represented * by 2**i or as a bit-operation: 1<