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

Generation of VCs for state actions #861

Open
treiher opened this issue Nov 30, 2021 · 0 comments
Open

Generation of VCs for state actions #861

treiher opened this issue Nov 30, 2021 · 0 comments
Labels
model Related to model package (e.g., model verification)

Comments

@treiher
Copy link
Collaborator

treiher commented Nov 30, 2021

The VCs for each action in a session state is generated. The VCs are used in the code generator to add checks to ensure that the needed properties are fulfilled.

Model

Action VC
X := Func (Y) preconditions of expression Y
X := P::M (Y.Data) "P.Contains.M_In_Y_Type_Data (Y)"
X := Y'Head "Has_Element (Y)"
X := [for E in Y if E.Z => E] Y'Valid
X := [for E in M.Y if E.Z => E] M.Y'Valid
X := P::M'(A => Y, B => 1, C => [42]) path condition of P::M with A = Y, B = 1 and C = [42], and A = Y and B = 1 -> C'Size = [42]'Size
X := X + Y X + Y <= X'Type'Last
X := X - Y X - Y >= X'Type'First
X := Y.Z Y.Z'Valid
X'Append (Y) available space in X >= Y'Size
X'Append (P::M'(A => Y, B => 1, C => [42])) path condition of P::M with A = Y, B = 1 and C = [42], and A = Y and B = 1 -> C'Size = [42]'Size, and available space in >= size of message
X ``

SPARK

  • If an action has VCs, the preconditions are checked before the actual code for the action is executed.
  • If a precondition is not fulfilled, the execution is aborted and the state is changed according to the exception transition.
  • Optimization: Filter out statically true checks.
@treiher treiher added the model Related to model package (e.g., model verification) label Nov 30, 2021
@treiher treiher self-assigned this Nov 30, 2021
@treiher treiher removed their assignment Apr 25, 2023
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)
Projects
None yet
Development

No branches or pull requests

1 participant