// example 6 <' struct packet_s { length : uint; keep length >= 10 and length <=20; with_checksum : bool; // This Boolean variable will be generated randomly. If it is FALSE the packet will not have a field called // “checksum” at the end and the LSB of the field “header1” will be '0'. If it is TRUE a field called // “checksum” will be added to the packet through a WHEN inheritance and the LSB of the field // “header1” will be '1'. %header1 : byte; keep header1 != 0; keep with_checksum == FALSE => header1[0] == '0'; // If the packet is without checksum the first bit of the field “header1” will be '0' keep with_checksum == TRUE => header1[0] == '1'; // otherwise it will be '1' %header2 : byte; keep header1 < 128 => header2 != 0; %data : list of byte; keep data.size() == length-2; when TRUE'with_checksum { // When the field “with_checksum” is TRUE %checksum : byte; // an extra field called “checksum” is added to the packet. keep checksum == data.xor(); // The value of the new field is equal to the “xor()” of all the bytes in the data list // You can look up the “xor()” method of a list on the e manual on the net. }; }; '>