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

Potentially undefined field not detected #522

Closed
treiher opened this issue Dec 7, 2020 · 2 comments · Fixed by #523
Closed

Potentially undefined field not detected #522

treiher opened this issue Dec 7, 2020 · 2 comments · Fixed by #523
Assignees
Labels
bug model Related to model package (e.g., model verification)

Comments

@treiher
Copy link
Collaborator

treiher commented Dec 7, 2020

The use of a potentially undefined field value is not detected in all cases. For example:

package Test is

   type T is mod 2**8;

   type M is
      message
         A : T
            then B
               if A = 1
            then C
               if A /= 1;
         B : T;
         C : T;
         D : Opaque
            with Size => B * 8;
      end message;

end Test;

The value of B cannot be used in the size aspect of D if A /= 1, as B is not present in this case: A -> C -> D.

@treiher treiher added bug model Related to model package (e.g., model verification) labels Dec 7, 2020
@treiher treiher added this to To do in RecordFlux 0.5 via automation Dec 7, 2020
@senier
Copy link
Member

senier commented Dec 7, 2020

Looks like this class of issue is hitting us over and over again. @treiher Do you have an idea how to tackle this more systematically?

@treiher
Copy link
Collaborator Author

treiher commented Dec 8, 2020

Looks like this class of issue is hitting us over and over again.

Is that really the case? In the last related issue that I can remember we had the opposite case: the checks were too strict (#492).

I cannot see a more systematic approach than the one we are already using: Each message path is separately analyzed using our type system. The current issue seems to be an implementation bug. The analysis of each of path is not that separate as it should be. The typing information for the expression B * 8 is kept from an analysis of another path which contains B.

treiher added a commit that referenced this issue Dec 8, 2020
@treiher treiher self-assigned this Dec 8, 2020
@treiher treiher moved this from To do to Done in RecordFlux 0.5 Dec 8, 2020
RecordFlux 0.5 automation moved this from Done to Merged Dec 8, 2020
treiher added a commit that referenced this issue Dec 8, 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