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

Allow adding a global invariant to a message #554

Open
jklmnn opened this issue Jan 19, 2021 · 1 comment
Open

Allow adding a global invariant to a message #554

jklmnn opened this issue Jan 19, 2021 · 1 comment
Labels
model Related to model package (e.g., model verification) specification Related to specification package (e.g., specification parsing)

Comments

@jklmnn
Copy link
Member

jklmnn commented Jan 19, 2021

Some invariants are valid for a whole message including all its paths. Instead of adding these to all links to the final field separately a shortcut should be available.
Instead of:

package Test is

   type T is mod 2**8;

   type Test is
      message
         A : T
            then B
               with Size => A * 8
               if Size > 0;
            then null
               if Size = 0 and Message'Size mod 8 = 0;
         B : Opaque
            then null
               if Message'Size mod 8 = 0;
      end message;
end Test;

a predicate aspect can be used:

package Test is

   type T is mod 2**8;

   type Test is
      message
         A : T
            then B
               with Size => A * 8
               if Size > 0;
            then null
               if Size = 0;
         B : Opaque;
      end message with
         Predicate => Message'Size mod 8 = 0;

end Test;
@treiher
Copy link
Collaborator

treiher commented Jan 19, 2021

         B : Opaque;
      end message;
end Test with
   Predicate => Message'Size mod 8 = 0;

The predicate should be at the message, not at the package.

@treiher treiher added model Related to model package (e.g., model verification) specification Related to specification package (e.g., specification parsing) labels Jan 19, 2021
@treiher treiher removed this from To do in RecordFlux 0.5 Jan 21, 2021
@treiher treiher added this to To do in RecordFlux 0.7 via automation Jan 21, 2021
@senier senier removed this from To do in RecordFlux 0.7 Aug 23, 2022
@senier senier added this to To do in RecordFlux Future via automation Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
model Related to model package (e.g., model verification) specification Related to specification package (e.g., specification parsing)
Projects
No open projects
Development

No branches or pull requests

2 participants