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

Unaccessible conditional fields in message types #410

Closed
senier opened this issue Aug 19, 2020 · 2 comments · Fixed by #411
Closed

Unaccessible conditional fields in message types #410

senier opened this issue Aug 19, 2020 · 2 comments · Fixed by #411
Assignees
Labels
bug model Related to model package (e.g., model verification)

Comments

@senier
Copy link
Member

senier commented Aug 19, 2020

package Test is
   type M1 is
      message
         F1 : Boolean
            then F2
               if F1 = True
            then null
               if F1 = False;
         F2 : Boolean;
      end message;
   type M2 is
      message
         F3 : M1
            then null if F3_F1 = True and F3_F2 = False;
      end message;
end Test;
$ rflx check test.rflx 
Parsing test.rflx
Processing Test
test.rflx:14:43: model: error: subsequent field "F3_F2" referenced
@senier senier created this issue from a note in RecordFlux 0.5 (To do) Aug 19, 2020
@senier senier added bug model Related to model package (e.g., model verification) labels Aug 19, 2020
@senier
Copy link
Member Author

senier commented Aug 20, 2020

This is not strictly a bug. The resulting substituted message M2 is:

type M2 is
   message
      F3_F1 : Boolean
         then F3_F2
            if F3_F1 = True
         then null
            if F3_F1 = False
               and F3_F1 = True
               and F3_F2 = False;
      F3_F2 : Boolean
         then null
            if F3_F1 = True
               and F3_F2 = False;
   end message

The replacement algorithm adds the condition present between F3 and Final to every edge to Final present in M1. Consequently, the condition must be compatible with all those edges an mention no fields that come after the first of those transitions. While the reason is clear, this is a usability issue as well as a sever limitation.

Idea: Prune edges with conditions that are statically false (like the second condition of F3_F1 in the above example) when merging messages.

@senier senier self-assigned this Aug 20, 2020
@senier senier moved this from To do to In progress in RecordFlux 0.5 Aug 20, 2020
senier pushed a commit that referenced this issue Aug 20, 2020
@treiher
Copy link
Collaborator

treiher commented Aug 21, 2020

Idea: Prune edges with conditions that are statically false (like the second condition of F3_F1 in the above example) when merging messages.

I'm not sure if that is a good idea. I suppose there are cases which are hard to handle correctly and could lead to unexpected results (e.g., fields with no successor or no path to FINAL). Would this approach even work in general? Is a condition referencing a subsequent field detected as statically false?

Maybe it would be better to only remove all references to subsequent fields (e.g., replace all such relations by TRUE), but this is probably also not easy to implement correctly.

senier pushed a commit that referenced this issue Aug 23, 2020
senier pushed a commit that referenced this issue Aug 23, 2020
@senier senier moved this from In progress to Ready in RecordFlux 0.5 Aug 23, 2020
senier pushed a commit that referenced this issue Aug 24, 2020
senier pushed a commit that referenced this issue Aug 24, 2020
@senier senier linked a pull request Aug 24, 2020 that will close this issue
senier pushed a commit that referenced this issue Aug 24, 2020
senier pushed a commit that referenced this issue Aug 24, 2020
senier pushed a commit that referenced this issue Aug 24, 2020
senier pushed a commit that referenced this issue Aug 24, 2020
RecordFlux 0.5 automation moved this from Ready to Merged Aug 25, 2020
senier pushed a commit that referenced this issue Aug 25, 2020
senier pushed a commit that referenced this issue Aug 25, 2020
senier pushed a commit that referenced this issue Aug 25, 2020
senier pushed a commit that referenced this issue Aug 25, 2020
@treiher treiher mentioned this issue Aug 4, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug model Related to model package (e.g., model verification)
Projects
No open projects
RecordFlux 0.5
  
Merged
Development

Successfully merging a pull request may close this issue.

2 participants