Skip to content

Commit

Permalink
generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
kanigsson committed Sep 7, 2023
1 parent b3fabe0 commit 9ca4fab
Show file tree
Hide file tree
Showing 25 changed files with 949 additions and 449 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,26 @@ private

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

pragma Warnings (Off, "formal parameter ""*"" is not referenced");

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

pragma Warnings (Off, "unused variable ""*""");

function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Buffer : RFLX_Types.Bytes_Ptr) return Boolean is
(True)
with
Pre =>
Cursors_Invariant (Cursors, First, Verified_Last),
Post =>
True;

pragma Warnings (On, "formal parameter ""*"" is not referenced");

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

pragma Warnings (On, "unused variable ""*""");

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

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -587,7 +607,7 @@ private
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then (True)
and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer)
and then (True)
and then ((if
Well_Formed (Cursors (F_Data))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,31 @@ private

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

pragma Warnings (Off, "formal parameter ""*"" is not referenced");

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

pragma Warnings (Off, "unused variable ""*""");

function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Buffer : RFLX_Types.Bytes_Ptr; Length : Test.Length; Extended : Boolean) return Boolean is
((if
Well_Formed (Cursors (F_Extension))
then
(Well_Formed (Cursors (F_Data))
and then Cursors (F_Extension).Predecessor = F_Data
and then RFLX_Types.Base_Integer (To_Base_Integer (Extended)) = RFLX_Types.Base_Integer (To_Base_Integer (True)))))
with
Pre =>
Cursors_Invariant (Cursors, First, Verified_Last),
Post =>
True;

pragma Warnings (On, "formal parameter ""*"" is not referenced");

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

pragma Warnings (On, "unused variable ""*""");

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

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -699,12 +724,7 @@ private
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if
Well_Formed (Cursors (F_Extension))
then
(Well_Formed (Cursors (F_Data))
and then Cursors (F_Extension).Predecessor = F_Data
and then RFLX_Types.Base_Integer (To_Base_Integer (Extended)) = RFLX_Types.Base_Integer (To_Base_Integer (True)))))
and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended)
and then ((if Invalid (Cursors (F_Data)) then Invalid (Cursors (F_Extension))))
and then ((if
Well_Formed (Cursors (F_Data))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,26 @@ private

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

pragma Warnings (Off, "formal parameter ""*"" is not referenced");

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

pragma Warnings (Off, "unused variable ""*""");

function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Buffer : RFLX_Types.Bytes_Ptr) return Boolean is
(True)
with
Pre =>
Cursors_Invariant (Cursors, First, Verified_Last),
Post =>
True;

pragma Warnings (On, "formal parameter ""*"" is not referenced");

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

pragma Warnings (On, "unused variable ""*""");

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

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -521,7 +541,7 @@ private
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then (True)
and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer)
and then (True)
and then ((if
Well_Formed (Cursors (F_Value))
Expand Down
22 changes: 21 additions & 1 deletion tests/feature/session_endianness/generated/rflx-messages-msg.ads
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,26 @@ private

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

pragma Warnings (Off, "formal parameter ""*"" is not referenced");

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

pragma Warnings (Off, "unused variable ""*""");

function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Buffer : RFLX_Types.Bytes_Ptr) return Boolean is
((if Well_Formed (Cursors (F_B)) then (Valid (Cursors (F_A)) and then Cursors (F_B).Predecessor = F_A)))
with
Pre =>
Cursors_Invariant (Cursors, First, Verified_Last),
Post =>
True;

pragma Warnings (On, "formal parameter ""*"" is not referenced");

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

pragma Warnings (On, "unused variable ""*""");

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

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -557,7 +577,7 @@ private
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer)
and then ((if Invalid (Cursors (F_A)) then Invalid (Cursors (F_B))))
and then ((if
Well_Formed (Cursors (F_A))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,26 @@ private

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

pragma Warnings (Off, "formal parameter ""*"" is not referenced");

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

pragma Warnings (Off, "unused variable ""*""");

function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Buffer : RFLX_Types.Bytes_Ptr) return Boolean is
((if Well_Formed (Cursors (F_D)) then (Valid (Cursors (F_C)) and then Cursors (F_D).Predecessor = F_C)))
with
Pre =>
Cursors_Invariant (Cursors, First, Verified_Last),
Post =>
True;

pragma Warnings (On, "formal parameter ""*"" is not referenced");

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

pragma Warnings (On, "unused variable ""*""");

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

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -557,7 +577,7 @@ private
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer)
and then ((if Invalid (Cursors (F_C)) then Invalid (Cursors (F_D))))
and then ((if
Well_Formed (Cursors (F_C))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,35 @@ private

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

pragma Warnings (Off, "formal parameter ""*"" is not referenced");

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

pragma Warnings (Off, "unused variable ""*""");

function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Buffer : RFLX_Types.Bytes_Ptr) return Boolean is
((if
Well_Formed (Cursors (F_X_B))
then
(Valid (Cursors (F_X_A))
and then Cursors (F_X_B).Predecessor = F_X_A))
and then (if
Well_Formed (Cursors (F_Y))
then
(Valid (Cursors (F_X_B))
and then Cursors (F_Y).Predecessor = F_X_B)))
with
Pre =>
Cursors_Invariant (Cursors, First, Verified_Last),
Post =>
True;

pragma Warnings (On, "formal parameter ""*"" is not referenced");

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

pragma Warnings (On, "unused variable ""*""");

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

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -595,16 +624,7 @@ private
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if
Well_Formed (Cursors (F_X_B))
then
(Valid (Cursors (F_X_A))
and then Cursors (F_X_B).Predecessor = F_X_A))
and then (if
Well_Formed (Cursors (F_Y))
then
(Valid (Cursors (F_X_B))
and then Cursors (F_Y).Predecessor = F_X_B)))
and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer)
and then ((if Invalid (Cursors (F_X_A)) then Invalid (Cursors (F_X_B)))
and then (if Invalid (Cursors (F_X_B)) then Invalid (Cursors (F_Y))))
and then ((if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,35 @@ private

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

pragma Warnings (Off, "formal parameter ""*"" is not referenced");

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

pragma Warnings (Off, "unused variable ""*""");

function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Buffer : RFLX_Types.Bytes_Ptr) return Boolean is
((if
Well_Formed (Cursors (F_Length))
then
(Valid (Cursors (F_Message_Type))
and then Cursors (F_Length).Predecessor = F_Message_Type))
and then (if
Well_Formed (Cursors (F_Data))
then
(Valid (Cursors (F_Length))
and then Cursors (F_Data).Predecessor = F_Length)))
with
Pre =>
Cursors_Invariant (Cursors, First, Verified_Last),
Post =>
True;

pragma Warnings (On, "formal parameter ""*"" is not referenced");

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

pragma Warnings (On, "unused variable ""*""");

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

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -705,16 +734,7 @@ private
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if
Well_Formed (Cursors (F_Length))
then
(Valid (Cursors (F_Message_Type))
and then Cursors (F_Length).Predecessor = F_Message_Type))
and then (if
Well_Formed (Cursors (F_Data))
then
(Valid (Cursors (F_Length))
and then Cursors (F_Data).Predecessor = F_Length)))
and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer)
and then ((if Invalid (Cursors (F_Message_Type)) then Invalid (Cursors (F_Length)))
and then (if Invalid (Cursors (F_Length)) then Invalid (Cursors (F_Data))))
and then ((if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,31 @@ private

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

pragma Warnings (Off, "formal parameter ""*"" is not referenced");

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

pragma Warnings (Off, "unused variable ""*""");

function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Buffer : RFLX_Types.Bytes_Ptr) return Boolean is
((if
Well_Formed (Cursors (F_Data))
then
(Valid (Cursors (F_Length))
and then Cursors (F_Data).Predecessor = F_Length
and then Cursors (F_Length).Value > 1)))
with
Pre =>
Cursors_Invariant (Cursors, First, Verified_Last),
Post =>
True;

pragma Warnings (On, "formal parameter ""*"" is not referenced");

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

pragma Warnings (On, "unused variable ""*""");

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

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -643,12 +668,7 @@ private
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if
Well_Formed (Cursors (F_Data))
then
(Valid (Cursors (F_Length))
and then Cursors (F_Data).Predecessor = F_Length
and then Cursors (F_Length).Value > 1)))
and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer)
and then ((if Invalid (Cursors (F_Length)) then Invalid (Cursors (F_Data))))
and then ((if
Well_Formed (Cursors (F_Length))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,36 @@ private

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

pragma Warnings (Off, "formal parameter ""*"" is not referenced");

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

pragma Warnings (Off, "unused variable ""*""");

function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Buffer : RFLX_Types.Bytes_Ptr) return Boolean is
((if
Well_Formed (Cursors (F_Length))
then
(Valid (Cursors (F_Tag))
and then Cursors (F_Length).Predecessor = F_Tag
and then RFLX_Types.Base_Integer (Cursors (F_Tag).Value) = RFLX_Types.Base_Integer (To_Base_Integer (RFLX.TLV.Msg_Data))))
and then (if
Well_Formed (Cursors (F_Value))
then
(Valid (Cursors (F_Length))
and then Cursors (F_Value).Predecessor = F_Length)))
with
Pre =>
Cursors_Invariant (Cursors, First, Verified_Last),
Post =>
True;

pragma Warnings (On, "formal parameter ""*"" is not referenced");

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

pragma Warnings (On, "unused variable ""*""");

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

pragma Warnings (Off, "postcondition does not mention function result");
Expand All @@ -666,17 +696,7 @@ private
and then Verified_Last rem RFLX_Types.Byte'Size = 0
and then Written_Last rem RFLX_Types.Byte'Size = 0
and then Cursors_Invariant (Cursors, First, Verified_Last)
and then ((if
Well_Formed (Cursors (F_Length))
then
(Valid (Cursors (F_Tag))
and then Cursors (F_Length).Predecessor = F_Tag
and then RFLX_Types.Base_Integer (Cursors (F_Tag).Value) = RFLX_Types.Base_Integer (To_Base_Integer (RFLX.TLV.Msg_Data))))
and then (if
Well_Formed (Cursors (F_Value))
then
(Valid (Cursors (F_Length))
and then Cursors (F_Value).Predecessor = F_Length)))
and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer)
and then ((if Invalid (Cursors (F_Tag)) then Invalid (Cursors (F_Length)))
and then (if Invalid (Cursors (F_Length)) then Invalid (Cursors (F_Value))))
and then ((if
Expand Down
Loading

0 comments on commit 9ca4fab

Please sign in to comment.