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

unprovable condition for Available_Space #995

Closed
kanigsson opened this issue Apr 25, 2022 · 0 comments · Fixed by #1091
Closed

unprovable condition for Available_Space #995

kanigsson opened this issue Apr 25, 2022 · 0 comments · Fixed by #1091
Assignees
Labels
bug generator Related to generator package (SPARK code generation)

Comments

@kanigsson
Copy link
Collaborator

This ticket uses the same reproducer as #974. I'm creating a new ticket as this seems to be an independent issue. When modifying the code by hand to help proof, one check still does not get proved:

rflx-over-repr.ads:905:61: medium: precondition might fail, cannot prove Available_Space (Ctx, Fld) >= Field_Size (Ctx, Fld)

The line number is probably off due to local modifications, in any case it comes from this expression in Field_Condition:

             U64 (Ctx.Cursors (F_Length).Value) * 8 >= U64 (Field_Last (Ctx, F_Hash)) - U64 (Ctx.Cursors (F_Count).First) + 17,

Available_Space is defined as follows;

   function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is
     (Ctx.Last - Field_First (Ctx, Fld) + 1);

note the Ctx.Last. The Valid_Context predicate only provides a condition like this:

                                             Cursors (F_Hash).Last - Cursors (F_Hash).First + 1 = 32

There seems to be something missing that links Ctx.Last with Cursors (Fld).Last for some field Fld. Does that make sense? Or am I missing something?

@kanigsson kanigsson added the bug label Apr 25, 2022
@treiher treiher added this to To do in RecordFlux 0.6 via automation Jun 13, 2022
@treiher treiher moved this from To do to Implementation in RecordFlux 0.6 Jun 13, 2022
@treiher treiher moved this from Implementation to To do in RecordFlux 0.6 Jun 13, 2022
@treiher treiher added the generator Related to generator package (SPARK code generation) label Jun 27, 2022
@kanigsson kanigsson moved this from To do to Design in RecordFlux 0.6 Jun 28, 2022
@senier senier moved this from Design to Review in RecordFlux 0.6 Jun 30, 2022
kanigsson added a commit that referenced this issue Jun 30, 2022
kanigsson added a commit that referenced this issue Jun 30, 2022
kanigsson added a commit that referenced this issue Jun 30, 2022
RecordFlux 0.6 automation moved this from Review to Done Jul 4, 2022
kanigsson added a commit that referenced this issue Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug generator Related to generator package (SPARK code generation)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants