-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial support of protocol sessions in SPARK #292
Comments
I1: Ensuring validity of sequence elements in list comprehensions state Receive_Ack is
Ack_Message_Types : DHCP_Message_Types;
begin
Channel'Read (Ack); -- sequence field `Ack.Options` could contain invalid elements
Ack_Message_Types := [for O in Ack.Options => O.DHCP_Message_Type when O.Code = DHCP::DHCP_MESSAGE_TYPE_OPTION]; Considered OptionsO1: Use exception transition+ Easy to realize O2: Check validity of sequence and switch state dependent on result
- Requires preconditions for states O3: Hierarchical state machine
+ Solves also other problems (e.g., global variables) Decision OutcomeLong term: O3 I2: Ensuring successful access to optional message fieldsFor optional message fields the access to a message field state A is
Foo : Field_Type;
begin
Channel'Read (Some_Message);
Foo := Some_Message.Foo; -- `Foo` could be an optional field and not present in `Some_Message` Considered OptionsO1: Implicitly check validity of message field and use exception transition in case of invalid field+ Easy to realize O2: Hierarchical state machine and 'Valid attribute for message fields
+ Solves also other problems (e.g., global variables) Decision OutcomeLong term: O2 I3: Ensuring successful access to (optional) message fields in sequences (combination of I1 and I2) state Receive_Ack is
Message_Types : Message_Types;
begin
Channel'Read (M); -- sequence field `M.Values` could contain invalid elements
Message_Types := [for V in M.Values => V.Message_Type when M.Code = Test::Msg]; -- `Message_Type` could be an optional field and not present in `V` Decision OutcomeSame as for I1 and I2. |
Generate SPARK code for the protocol sessions added in #47.
The text was updated successfully, but these errors were encountered: