Skip to content
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

Definition of initial and final state of session #700

Closed
treiher opened this issue Jul 16, 2021 · 0 comments · Fixed by #1192
Closed

Definition of initial and final state of session #700

treiher opened this issue Jul 16, 2021 · 0 comments · Fixed by #1192
Assignees
Labels
architectural decision Discussion of design decision model Related to model package (e.g., model verification) small Effort of one person-day or less specification Related to specification package (e.g., specification parsing)

Comments

@treiher
Copy link
Collaborator

treiher commented Jul 16, 2021

Context and Problem Statement

The definition of the initial state requires the session aspect Initial and the definition of the final state requires the session aspect Final and a null state declaration. A minimal session specification looks as follows:

generic
session S with
   Initial => Foo,
   Final => Bar
is
begin
   state Foo is
   begin
   transition
      then Bar
   end Foo;

   state Bar is null state;
end S;

The current approach requires a lot of boilerplate just to be able to give individual names to the initial and final states. I have the impression that this is unnecessary.

Considered Options

O1 Remove null state

Having the Final aspect is sufficient, as the declaration of a null state doesn't add any information.

generic
session S with
   Initial => Foo,
   Final => Bar
is
begin
   state Foo is
   begin
   transition
      then Bar
   end Foo;
end S;

+ Less boilerplate
Inconsistent to Initial aspect, as Final aspect doesn't refer to declared state

O2 Use keyword instead of null state and Final aspect

Similar to message specifications, null could be used to refer to the final state. Also, another keyword like Final would be possible, as it is very improbable that a user would like to use Final as a state name with another semantics.

generic
session S with
   Initial => Foo
is
begin
   state Foo is
   begin
   transition
      then null
   end Foo;
end S;

+ Less boilerplate
No individual name for final state

O3 Define initial state by name instead of Initial aspect

The initial state must have a specific name (e.g., Initial).

In combination with O2:

generic
session S is
begin
   state Initial is
   begin
   transition
      then null
   end Initial;
end S;

+ Least boilerplate
No individual name for initial state

O4 Define initial state by position instead of Initial aspect

The first declared state is considered as the initial state.

In combination with O2:

generic
session S is
begin
   state Foo is
   begin
   transition
      then null
   end Foo;
end S;

+ Least boilerplate

Decision Outcome

O2 and O4

@treiher treiher added model Related to model package (e.g., model verification) architectural decision Discussion of design decision labels Jul 16, 2021
@treiher treiher added this to To do in RecordFlux 0.5 via automation Jul 16, 2021
@treiher treiher added the specification Related to specification package (e.g., specification parsing) label Jul 20, 2021
@senier senier removed this from To do in RecordFlux 0.5 Jul 22, 2021
@senier senier added this to To do in RecordFlux Future via automation Jul 22, 2021
@treiher treiher added the small Effort of one person-day or less label Oct 14, 2021
@senier senier moved this from To do to Backlog in RecordFlux Future Aug 24, 2022
@senier senier removed this from High in RecordFlux Future Aug 30, 2022
@senier senier added this to To do in RecordFlux 0.7 via automation Aug 30, 2022
@treiher treiher self-assigned this Sep 19, 2022
@treiher treiher moved this from To do to Implementation in RecordFlux 0.7 Sep 19, 2022
treiher added a commit to AdaCore/RecordFlux-parser that referenced this issue Sep 19, 2022
treiher added a commit to AdaCore/RecordFlux-parser that referenced this issue Sep 19, 2022
@treiher treiher moved this from Implementation to Review in RecordFlux 0.7 Sep 19, 2022
treiher added a commit to AdaCore/RecordFlux-parser that referenced this issue Sep 20, 2022
treiher added a commit to AdaCore/RecordFlux-parser that referenced this issue Sep 20, 2022
treiher added a commit to AdaCore/RecordFlux-parser that referenced this issue Sep 20, 2022
RecordFlux 0.7 automation moved this from Review to Done Sep 22, 2022
adacore-bot pushed a commit that referenced this issue May 15, 2023
adacore-bot pushed a commit that referenced this issue May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architectural decision Discussion of design decision model Related to model package (e.g., model verification) small Effort of one person-day or less specification Related to specification package (e.g., specification parsing)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant