Skip to content

Commit

Permalink
generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
kanigsson committed Aug 31, 2023
1 parent 4701fae commit e391995
Show file tree
Hide file tree
Showing 25 changed files with 450 additions and 200 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,23 @@ private
(Cursor.State = S_Invalid
or Cursor.State = S_Incomplete);

pragma Warnings (Off, "postcondition does not mention function result");

function Cursors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length) return Boolean is
((for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value))))
with
Post =>
True;

pragma Warnings (On, "postcondition does not mention function result");

pragma Warnings (Off, """Buffer"" is not modified, could be of access constant type");

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -569,14 +586,7 @@ private
and then Last rem RFLX_Types.Byte'Size = 0
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then (for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value)))
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then (True)
and then (True)
and then ((if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,23 @@ private
(Cursor.State = S_Invalid
or Cursor.State = S_Incomplete);

pragma Warnings (Off, "postcondition does not mention function result");

function Cursors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length) return Boolean is
((for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value))))
with
Post =>
True;

pragma Warnings (On, "postcondition does not mention function result");

pragma Warnings (Off, """Buffer"" is not modified, could be of access constant type");

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -681,14 +698,7 @@ private
and then Last rem RFLX_Types.Byte'Size = 0
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then (for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value)))
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if
Well_Formed (Cursors (F_Extension))
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,23 @@ private
(Cursor.State = S_Invalid
or Cursor.State = S_Incomplete);

pragma Warnings (Off, "postcondition does not mention function result");

function Cursors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length) return Boolean is
((for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value))))
with
Post =>
True;

pragma Warnings (On, "postcondition does not mention function result");

pragma Warnings (Off, """Buffer"" is not modified, could be of access constant type");

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -503,14 +520,7 @@ private
and then Last rem RFLX_Types.Byte'Size = 0
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then (for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value)))
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then (True)
and then (True)
and then ((if
Expand Down
26 changes: 18 additions & 8 deletions tests/feature/session_endianness/generated/rflx-messages-msg.ads
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,23 @@ private
(Cursor.State = S_Invalid
or Cursor.State = S_Incomplete);

pragma Warnings (Off, "postcondition does not mention function result");

function Cursors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length) return Boolean is
((for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value))))
with
Post =>
True;

pragma Warnings (On, "postcondition does not mention function result");

pragma Warnings (Off, """Buffer"" is not modified, could be of access constant type");

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -539,14 +556,7 @@ private
and then Last rem RFLX_Types.Byte'Size = 0
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then (for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value)))
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if Well_Formed (Cursors (F_B)) then (Valid (Cursors (F_A)) and then Cursors (F_B).Predecessor = F_A)))
and then ((if Invalid (Cursors (F_A)) then Invalid (Cursors (F_B))))
and then ((if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,23 @@ private
(Cursor.State = S_Invalid
or Cursor.State = S_Incomplete);

pragma Warnings (Off, "postcondition does not mention function result");

function Cursors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length) return Boolean is
((for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value))))
with
Post =>
True;

pragma Warnings (On, "postcondition does not mention function result");

pragma Warnings (Off, """Buffer"" is not modified, could be of access constant type");

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -539,14 +556,7 @@ private
and then Last rem RFLX_Types.Byte'Size = 0
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then (for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value)))
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if Well_Formed (Cursors (F_D)) then (Valid (Cursors (F_C)) and then Cursors (F_D).Predecessor = F_C)))
and then ((if Invalid (Cursors (F_C)) then Invalid (Cursors (F_D))))
and then ((if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,23 @@ private
(Cursor.State = S_Invalid
or Cursor.State = S_Incomplete);

pragma Warnings (Off, "postcondition does not mention function result");

function Cursors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length) return Boolean is
((for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value))))
with
Post =>
True;

pragma Warnings (On, "postcondition does not mention function result");

pragma Warnings (Off, """Buffer"" is not modified, could be of access constant type");

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -577,14 +594,7 @@ private
and then Last rem RFLX_Types.Byte'Size = 0
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then (for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value)))
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if
Well_Formed (Cursors (F_X_B))
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,23 @@ private
(Cursor.State = S_Invalid
or Cursor.State = S_Incomplete);

pragma Warnings (Off, "postcondition does not mention function result");

function Cursors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length) return Boolean is
((for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value))))
with
Post =>
True;

pragma Warnings (On, "postcondition does not mention function result");

pragma Warnings (Off, """Buffer"" is not modified, could be of access constant type");

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -687,14 +704,7 @@ private
and then Last rem RFLX_Types.Byte'Size = 0
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then (for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value)))
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if
Well_Formed (Cursors (F_Length))
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,23 @@ private
(Cursor.State = S_Invalid
or Cursor.State = S_Incomplete);

pragma Warnings (Off, "postcondition does not mention function result");

function Cursors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length) return Boolean is
((for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value))))
with
Post =>
True;

pragma Warnings (On, "postcondition does not mention function result");

pragma Warnings (Off, """Buffer"" is not modified, could be of access constant type");

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -625,14 +642,7 @@ private
and then Last rem RFLX_Types.Byte'Size = 0
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then (for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value)))
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if
Well_Formed (Cursors (F_Data))
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,23 @@ private
(Cursor.State = S_Invalid
or Cursor.State = S_Incomplete);

pragma Warnings (Off, "postcondition does not mention function result");

function Cursors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length) return Boolean is
((for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value))))
with
Post =>
True;

pragma Warnings (On, "postcondition does not mention function result");

pragma Warnings (Off, """Buffer"" is not modified, could be of access constant type");

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -648,14 +665,7 @@ private
and then Last rem RFLX_Types.Byte'Size = 0
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then (for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value)))
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if
Well_Formed (Cursors (F_Length))
then
Expand Down
26 changes: 18 additions & 8 deletions tests/feature/shared/generated/rflx-universal-message.ads
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,23 @@ private
(Cursor.State = S_Invalid
or Cursor.State = S_Incomplete);

pragma Warnings (Off, "postcondition does not mention function result");

function Cursors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length) return Boolean is
((for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value))))
with
Post =>
True;

pragma Warnings (On, "postcondition does not mention function result");

pragma Warnings (Off, """Buffer"" is not modified, could be of access constant type");

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -1187,14 +1204,7 @@ private
and then Last rem RFLX_Types.Byte'Size = 0
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then (for all F in Field =>
(if
Well_Formed (Cursors (F))
then
Cursors (F).First >= First
and Cursors (F).Last <= Verified_Last
and Cursors (F).First <= Cursors (F).Last + 1
and Valid_Value (F, Cursors (F).Value)))
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if
Well_Formed (Cursors (F_Length))
then
Expand Down
Loading

0 comments on commit e391995

Please sign in to comment.