diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fd0cb40a..f7470003d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rejection of variable declarations with type `Opaque` (eng/recordflux/RecordFlux#633) - Fatal error caused by variable in case expression (eng/recordflux/RecordFlux#1800) +### Changed + +- Remove unused `Buffer` arguments in generated code (eng/recordflux/RecordFlux#1802) + ## [0.24.0] - 2024-09-12 ### Added diff --git a/examples/apps/spdm_responder/build_lib.gpr b/examples/apps/spdm_responder/build_lib.gpr index 22ba30e9d..ca66a2195 100644 --- a/examples/apps/spdm_responder/build_lib.gpr +++ b/examples/apps/spdm_responder/build_lib.gpr @@ -107,7 +107,7 @@ project Build_Lib is package Prove is for Proof_Switches ("Ada") use Defaults.Proof_Switches; for Proof_Switches ("responder.adb") use ("--prover=z3,cvc5", "--steps=64000", "--memlimit=6000", "--timeout=600"); - for Proof_Switches ("rflx-spdm_responder-session-fsm.adb") use ("--timeout=120"); + for Proof_Switches ("rflx-spdm_responder-session-fsm.adb") use ("--timeout=240"); end Prove; end Build_Lib; diff --git a/rflx/generator/common.py b/rflx/generator/common.py index ef8c5158a..84ea07952 100644 --- a/rflx/generator/common.py +++ b/rflx/generator/common.py @@ -549,7 +549,7 @@ def invalid_successors_invariant() -> Expr: Variable("First"), Variable("Verified_Last"), Variable("Written_Last"), - Variable("Buffer"), + *([Variable("Buffer")] if message.has_aggregate_dependent_condition() else []), *[Variable(p.identifier) for p in message.parameter_types], ], ), @@ -779,7 +779,7 @@ def field_condition_call( # noqa: PLR0913 Variable(context), Variable(package * field.affixed_name), *([value] if has_scalar_value_dependent_condition(message) else []), - *([aggregate] if has_aggregate_dependent_condition(message) else []), + *([aggregate] if message.has_aggregate_dependent_condition() else []), *([size] if has_size_dependent_condition(message, field) else []), ], ) @@ -832,25 +832,6 @@ def has_scalar_value_dependent_condition(message: model.Message) -> bool: ) -def has_aggregate_dependent_condition( - message: model.Message, - field: model.Field | None = None, -) -> bool: - links = message.outgoing(field) if field else message.structure - fields = [field] if field else message.fields - return any( - r - for l in links - for r in l.condition.findall(lambda x: isinstance(x, (expr.Equal, expr.NotEqual))) - if isinstance(r, (expr.Equal, expr.NotEqual)) - and r.findall(lambda x: isinstance(x, expr.Aggregate)) - and any( - r.left == expr.Variable(f.identifier) or r.right == expr.Variable(f.identifier) - for f in fields - ) - ) - - def has_size_dependent_condition( message: model.Message, field: model.Field | None = None, diff --git a/rflx/generator/message.py b/rflx/generator/message.py index f7eb19d49..2a82258aa 100644 --- a/rflx/generator/message.py +++ b/rflx/generator/message.py @@ -381,7 +381,11 @@ def create_valid_predecessors_invariant_function( Parameter(["First"], const.TYPES_BIT_INDEX), Parameter(["Verified_Last"], const.TYPES_BIT_LENGTH), Parameter(["Written_Last"], const.TYPES_BIT_LENGTH), - Parameter(["Buffer"], const.TYPES_BYTES_PTR), + *( + [Parameter(["Buffer"], const.TYPES_BYTES_PTR)] + if message.has_aggregate_dependent_condition() + else [] + ), *common.message_parameters(message), ], ) @@ -484,7 +488,11 @@ def create_valid_next_internal_function( Parameter(["First"], const.TYPES_BIT_INDEX), Parameter(["Verified_Last"], const.TYPES_BIT_LENGTH), Parameter(["Written_Last"], const.TYPES_BIT_LENGTH), - Parameter(["Buffer"], const.TYPES_BYTES_PTR), + *( + [Parameter(["Buffer"], const.TYPES_BYTES_PTR)] + if message.has_aggregate_dependent_condition() + else [] + ), *common.message_parameters(message), Parameter(["Fld"], "Field"), ], @@ -541,7 +549,11 @@ def valid_next_expr(fld: Field) -> Expr: Variable("First"), Variable("Verified_Last"), Variable("Written_Last"), - Variable("Buffer"), + *( + [Variable("Buffer")] + if message.has_aggregate_dependent_condition() + else [] + ), *param_args, ], ), @@ -564,7 +576,11 @@ def create_field_size_internal_function(message: Message, prefix: str) -> UnitPa Parameter(["First"], const.TYPES_BIT_INDEX), Parameter(["Verified_Last"], const.TYPES_BIT_LENGTH), Parameter(["Written_Last"], const.TYPES_BIT_LENGTH), - Parameter(["Buffer"], const.TYPES_BYTES_PTR), + *( + [Parameter(["Buffer"], const.TYPES_BYTES_PTR)] + if message.has_aggregate_dependent_condition() + else [] + ), *common.message_parameters(message), Parameter(["Fld"], "Field"), ], @@ -610,7 +626,11 @@ def create_field_size_internal_function(message: Message, prefix: str) -> UnitPa Variable("First"), Variable("Verified_Last"), Variable("Written_Last"), - Variable("Buffer"), + *( + [Variable("Buffer")] + if message.has_aggregate_dependent_condition() + else [] + ), *param_args, ], ), @@ -621,7 +641,11 @@ def create_field_size_internal_function(message: Message, prefix: str) -> UnitPa Variable("First"), Variable("Verified_Last"), Variable("Written_Last"), - Variable("Buffer"), + *( + [Variable("Buffer")] + if message.has_aggregate_dependent_condition() + else [] + ), *param_args, Variable("Fld"), ], @@ -645,7 +669,7 @@ def recursive_call(fld: Field) -> expr.Expr: expr.Variable("First"), expr.Variable("Verified_Last"), expr.Variable("Written_Last"), - expr.Variable("Buffer"), + *([expr.Variable("Buffer")] if message.has_aggregate_dependent_condition() else []), *[expr.Variable(param.name) for param in message.parameter_types], ], ) @@ -659,7 +683,7 @@ def field_size_internal_call(fld: expr.Variable) -> expr.Expr: expr.Variable("First"), expr.Variable("Verified_Last"), expr.Variable("Written_Last"), - expr.Variable("Buffer"), + *([expr.Variable("Buffer")] if message.has_aggregate_dependent_condition() else []), *[expr.Variable(param.name) for param in message.parameter_types], fld, ], @@ -736,7 +760,11 @@ def precond(fld: str) -> Precondition: Variable("First"), Variable("Verified_Last"), Variable("Written_Last"), - Variable("Buffer"), + *( + [Variable("Buffer")] + if message.has_aggregate_dependent_condition() + else [] + ), *param_args, ], ), @@ -747,7 +775,11 @@ def precond(fld: str) -> Precondition: Variable("First"), Variable("Verified_Last"), Variable("Written_Last"), - Variable("Buffer"), + *( + [Variable("Buffer")] + if message.has_aggregate_dependent_condition() + else [] + ), *param_args, Variable(fld), ], @@ -765,7 +797,11 @@ def fld_first_func(fld: Field) -> ExpressionFunctionDeclaration: Parameter(["First"], const.TYPES_BIT_INDEX), Parameter(["Verified_Last"], const.TYPES_BIT_LENGTH), Parameter(["Written_Last"], const.TYPES_BIT_LENGTH), - Parameter(["Buffer"], const.TYPES_BYTES_PTR), + *( + [Parameter(["Buffer"], const.TYPES_BYTES_PTR)] + if message.has_aggregate_dependent_condition() + else [] + ), *common.message_parameters(message), ], ), @@ -781,7 +817,11 @@ def fld_first_func(fld: Field) -> ExpressionFunctionDeclaration: Parameter(["First"], const.TYPES_BIT_INDEX), Parameter(["Verified_Last"], const.TYPES_BIT_LENGTH), Parameter(["Written_Last"], const.TYPES_BIT_LENGTH), - Parameter(["Buffer"], const.TYPES_BYTES_PTR), + *( + [Parameter(["Buffer"], const.TYPES_BYTES_PTR)] + if message.has_aggregate_dependent_condition() + else [] + ), *common.message_parameters(message), Parameter(["Fld"], "Field"), ], @@ -2004,7 +2044,11 @@ def create_field_size_function( Variable("Ctx.First"), Variable("Ctx.Verified_Last"), Variable("Ctx.Written_Last"), - Variable("Ctx.Buffer"), + *( + [Variable("Ctx.Buffer")] + if message.has_aggregate_dependent_condition() + else [] + ), *[Selected(Variable("Ctx"), fld.name) for fld in message.parameter_types], Variable("Fld"), ], @@ -2057,7 +2101,11 @@ def create_field_first_function(prefix: str, message: Message) -> UnitPart: Variable("Ctx.First"), Variable("Ctx.Verified_Last"), Variable("Ctx.Written_Last"), - Variable("Ctx.Buffer"), + *( + [Variable("Ctx.Buffer")] + if message.has_aggregate_dependent_condition() + else [] + ), *[Selected(Variable("Ctx"), fld.name) for fld in message.parameter_types], Variable("Fld"), ], @@ -2192,7 +2240,7 @@ def condition(field: Field, message: Message) -> Expr: elif isinstance( message.field_types[field], Composite, - ) and common.has_aggregate_dependent_condition(message, field): + ) and message.has_aggregate_dependent_condition(field): c = c.substituted( lambda x: expr.Variable("Agg") if x == expr.Variable(field.name) else x, ) @@ -2208,7 +2256,7 @@ def condition(field: Field, message: Message) -> Expr: ), *( [Parameter(["Agg"], const.TYPES_BYTES)] - if common.has_aggregate_dependent_condition(message) + if message.has_aggregate_dependent_condition() else [] ), *( @@ -2528,7 +2576,11 @@ def create_valid_next_function(message: Message) -> UnitPart: Variable("Ctx.First"), Variable("Ctx.Verified_Last"), Variable("Ctx.Written_Last"), - Variable("Ctx.Buffer"), + *( + [Variable("Ctx.Buffer")] + if message.has_aggregate_dependent_condition() + else [] + ), *[Selected(Variable("Ctx"), fld.name) for fld in message.parameter_types], Variable("Fld"), ], diff --git a/rflx/generator/parser.py b/rflx/generator/parser.py index 0f8fd6e44..07d3375b2 100644 --- a/rflx/generator/parser.py +++ b/rflx/generator/parser.py @@ -79,7 +79,7 @@ def create_get_function( return UnitPart() comparison_to_aggregate = any( - (isinstance(t, Composite) and common.has_aggregate_dependent_condition(message, f)) + (isinstance(t, Composite) and message.has_aggregate_dependent_condition(f)) for f, t in message.field_types.items() ) @@ -271,7 +271,7 @@ def create_verify_procedure( ), ), ] - if common.has_aggregate_dependent_condition(message) + if message.has_aggregate_dependent_condition() else [] ), *( diff --git a/rflx/model/message.py b/rflx/model/message.py index 9f4f477ef..746e6726d 100644 --- a/rflx/model/message.py +++ b/rflx/model/message.py @@ -562,6 +562,24 @@ def has_fixed_size(self) -> bool: def has_implicit_size(self) -> bool: return any(l.has_implicit_size for l in self.structure) + def has_aggregate_dependent_condition( + self, + field: Field | None = None, + ) -> bool: + links = self.outgoing(field) if field else self.structure + fields = [field] if field else self.fields + return any( + r + for l in links + for r in l.condition.findall(lambda x: isinstance(x, (expr.Equal, expr.NotEqual))) + if isinstance(r, (expr.Equal, expr.NotEqual)) + and r.findall(lambda x: isinstance(x, expr.Aggregate)) + and any( + r.left == expr.Variable(f.identifier) or r.right == expr.Variable(f.identifier) + for f in fields + ) + ) + @property def is_definite(self) -> bool: """ diff --git a/tests/feature/fsm_case_expression_numeric/generated/rflx-test-message.ads b/tests/feature/fsm_case_expression_numeric/generated/rflx-test-message.ads index 681ae009a..63a58b0a7 100644 --- a/tests/feature/fsm_case_expression_numeric/generated/rflx-test-message.ads +++ b/tests/feature/fsm_case_expression_numeric/generated/rflx-test-message.ads @@ -490,7 +490,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Value)) then True)) with Pre => @@ -506,14 +506,14 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Value => True)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -523,15 +523,15 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Value => 8)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -545,23 +545,23 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Value (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 RFLX_Types.Bit_Index'Base is + function Field_First_Value (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Value); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Value); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Value => - Field_First_Value (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Value (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -600,7 +600,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then (True) and then ((if Well_Formed (Cursors (F_Value)) @@ -667,16 +667,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/fsm_endianness/generated/rflx-messages-msg.ads b/tests/feature/fsm_endianness/generated/rflx-messages-msg.ads index 2fb264651..4824311e1 100644 --- a/tests/feature/fsm_endianness/generated/rflx-messages-msg.ads +++ b/tests/feature/fsm_endianness/generated/rflx-messages-msg.ads @@ -524,7 +524,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_A)) then True) and then (if Well_Formed (Cursors (F_B)) then Valid (Cursors (F_A)))) with @@ -541,7 +541,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_A => True, @@ -551,7 +551,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -561,15 +561,15 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_A | F_B => 32)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -583,33 +583,33 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_A (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 RFLX_Types.Bit_Index'Base is + function Field_First_A (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_A); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_A); - function Field_First_B (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 RFLX_Types.Bit_Index'Base is + function Field_First_B (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 32) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_B); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_B); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_A => - Field_First_A (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_A (Cursors, First, Verified_Last, Written_Last), when F_B => - Field_First_B (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_B (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -648,7 +648,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_A)) then Invalid (Cursors (F_B)))) and then ((if Well_Formed (Cursors (F_A)) @@ -723,16 +723,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/fsm_endianness/generated/rflx-messages-msg_le.ads b/tests/feature/fsm_endianness/generated/rflx-messages-msg_le.ads index 8457d0528..b78dcc346 100644 --- a/tests/feature/fsm_endianness/generated/rflx-messages-msg_le.ads +++ b/tests/feature/fsm_endianness/generated/rflx-messages-msg_le.ads @@ -524,7 +524,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_C)) then True) and then (if Well_Formed (Cursors (F_D)) then Valid (Cursors (F_C)))) with @@ -541,7 +541,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_C => True, @@ -551,7 +551,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -561,15 +561,15 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_C | F_D => 32)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -583,33 +583,33 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_C (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 RFLX_Types.Bit_Index'Base is + function Field_First_C (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_C); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_C); - function Field_First_D (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 RFLX_Types.Bit_Index'Base is + function Field_First_D (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 32) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_D); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_D); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_C => - Field_First_C (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_C (Cursors, First, Verified_Last, Written_Last), when F_D => - Field_First_D (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_D (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -648,7 +648,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_C)) then Invalid (Cursors (F_D)))) and then ((if Well_Formed (Cursors (F_C)) @@ -723,16 +723,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/fsm_endianness/generated/rflx-messages-msg_le_nested.ads b/tests/feature/fsm_endianness/generated/rflx-messages-msg_le_nested.ads index adf06eade..290135e1f 100644 --- a/tests/feature/fsm_endianness/generated/rflx-messages-msg_le_nested.ads +++ b/tests/feature/fsm_endianness/generated/rflx-messages-msg_le_nested.ads @@ -560,7 +560,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_X_A)) then True) and then (if Well_Formed (Cursors (F_X_B)) then Valid (Cursors (F_X_A))) and then (if Well_Formed (Cursors (F_Y)) then Valid (Cursors (F_X_B)))) @@ -578,7 +578,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_X_A => True, @@ -591,7 +591,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -601,15 +601,15 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_X_A | F_X_B | F_Y => 32)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -623,43 +623,43 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_X_A (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 RFLX_Types.Bit_Index'Base is + function Field_First_X_A (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_X_A); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_X_A); - function Field_First_X_B (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 RFLX_Types.Bit_Index'Base is + function Field_First_X_B (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 32) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_X_B); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_X_B); - function Field_First_Y (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 RFLX_Types.Bit_Index'Base is + function Field_First_Y (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 64) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Y); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Y); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_X_A => - Field_First_X_A (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_X_A (Cursors, First, Verified_Last, Written_Last), when F_X_B => - Field_First_X_B (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_X_B (Cursors, First, Verified_Last, Written_Last), when F_Y => - Field_First_Y (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Y (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -698,7 +698,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) 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 @@ -779,16 +779,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/fsm_functions/generated/rflx-test-definite_message.ads b/tests/feature/fsm_functions/generated/rflx-test-definite_message.ads index 09aa11eb7..3a29f97b5 100644 --- a/tests/feature/fsm_functions/generated/rflx-test-definite_message.ads +++ b/tests/feature/fsm_functions/generated/rflx-test-definite_message.ads @@ -667,7 +667,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Message_Type)) then True) and then (if Well_Formed (Cursors (F_Length)) then Valid (Cursors (F_Message_Type))) and then (if Well_Formed (Cursors (F_Data)) then Valid (Cursors (F_Length)))) @@ -685,7 +685,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Message_Type => True, @@ -698,7 +698,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -708,7 +708,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Message_Type | F_Length => 8, @@ -717,8 +717,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -732,43 +732,43 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Message_Type (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 RFLX_Types.Bit_Index'Base is + function Field_First_Message_Type (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Message_Type); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Message_Type); - function Field_First_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Length); - function Field_First_Data (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 RFLX_Types.Bit_Index'Base is + function Field_First_Data (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Data); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Data); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Message_Type => - Field_First_Message_Type (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Message_Type (Cursors, First, Verified_Last, Written_Last), when F_Length => - Field_First_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Length (Cursors, First, Verified_Last, Written_Last), when F_Data => - Field_First_Data (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Data (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -807,7 +807,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) 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 @@ -890,16 +890,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/fsm_message_optimization/generated/rflx-test-option_data.ads b/tests/feature/fsm_message_optimization/generated/rflx-test-option_data.ads index 9be6b1ad3..13f49625a 100644 --- a/tests/feature/fsm_message_optimization/generated/rflx-test-option_data.ads +++ b/tests/feature/fsm_message_optimization/generated/rflx-test-option_data.ads @@ -609,7 +609,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Length)) then True) and then (if Well_Formed (Cursors (F_Data)) @@ -630,7 +630,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Length => True, @@ -640,7 +640,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -650,7 +650,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Length => 16, @@ -659,8 +659,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -674,33 +674,33 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Length); - function Field_First_Data (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 RFLX_Types.Bit_Index'Base is + function Field_First_Data (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Data); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Data); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Length => - Field_First_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Length (Cursors, First, Verified_Last, Written_Last), when F_Data => - Field_First_Data (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Data (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -739,7 +739,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Length)) then Invalid (Cursors (F_Data)))) and then ((if Well_Formed (Cursors (F_Length)) @@ -816,16 +816,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/fsm_sequence_append_head/generated/rflx-tlv-message.ads b/tests/feature/fsm_sequence_append_head/generated/rflx-tlv-message.ads index e52a7e0de..3c85c922b 100644 --- a/tests/feature/fsm_sequence_append_head/generated/rflx-tlv-message.ads +++ b/tests/feature/fsm_sequence_append_head/generated/rflx-tlv-message.ads @@ -628,7 +628,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Tag)) then True) and then (if Well_Formed (Cursors (F_Length)) @@ -650,7 +650,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Tag => True, @@ -663,7 +663,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -673,7 +673,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Tag => 8, @@ -684,8 +684,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -699,43 +699,43 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Tag (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 RFLX_Types.Bit_Index'Base is + function Field_First_Tag (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Tag); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Tag); - function Field_First_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Length); - function Field_First_Value (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 RFLX_Types.Bit_Index'Base is + function Field_First_Value (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 24) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Value); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Value); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Tag => - Field_First_Tag (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Tag (Cursors, First, Verified_Last, Written_Last), when F_Length => - Field_First_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Length (Cursors, First, Verified_Last, Written_Last), when F_Value => - Field_First_Value (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Value (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -774,7 +774,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) 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 @@ -860,16 +860,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/message_with_variable_as_condition_on_same_field/generated/rflx-test-m.ads b/tests/feature/message_with_variable_as_condition_on_same_field/generated/rflx-test-m.ads index 96876b37e..5cfdfbc2e 100644 --- a/tests/feature/message_with_variable_as_condition_on_same_field/generated/rflx-test-m.ads +++ b/tests/feature/message_with_variable_as_condition_on_same_field/generated/rflx-test-m.ads @@ -527,7 +527,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_A)) then True) and then (if Well_Formed (Cursors (F_B)) then (Valid (Cursors (F_A)) and then To_Actual (Cursors (F_A).Value)))) with @@ -544,7 +544,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_A => True, @@ -554,7 +554,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -564,7 +564,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_A => 1, @@ -573,8 +573,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -588,33 +588,33 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_A (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 RFLX_Types.Bit_Index'Base is + function Field_First_A (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_A); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_A); - function Field_First_B (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 RFLX_Types.Bit_Index'Base is + function Field_First_B (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 1) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_B); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_B); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_A => - Field_First_A (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_A (Cursors, First, Verified_Last, Written_Last), when F_B => - Field_First_B (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_B (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -653,7 +653,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_A)) then Invalid (Cursors (F_B)))) and then ((if Well_Formed (Cursors (F_A)) @@ -730,16 +730,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/message_with_variable_as_condition_on_subsequent_field/generated/rflx-test-m.ads b/tests/feature/message_with_variable_as_condition_on_subsequent_field/generated/rflx-test-m.ads index 660ba2c75..c966ec095 100644 --- a/tests/feature/message_with_variable_as_condition_on_subsequent_field/generated/rflx-test-m.ads +++ b/tests/feature/message_with_variable_as_condition_on_subsequent_field/generated/rflx-test-m.ads @@ -526,7 +526,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_A)) then True) and then (if Well_Formed (Cursors (F_B)) then Valid (Cursors (F_A)))) with @@ -543,7 +543,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_A => True, @@ -553,7 +553,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -563,7 +563,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_A => 1, @@ -572,8 +572,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -587,33 +587,33 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_A (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 RFLX_Types.Bit_Index'Base is + function Field_First_A (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_A); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_A); - function Field_First_B (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 RFLX_Types.Bit_Index'Base is + function Field_First_B (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 1) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_B); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_B); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_A => - Field_First_A (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_A (Cursors, First, Verified_Last, Written_Last), when F_B => - Field_First_B (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_B (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -652,7 +652,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_A)) then Invalid (Cursors (F_B)))) and then ((if Well_Formed (Cursors (F_A)) @@ -729,16 +729,16 @@ private To_Actual (Ctx.Cursors (F_A).Value))); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/messages_with_multiple_initial_links/generated/rflx-test-m.ads b/tests/feature/messages_with_multiple_initial_links/generated/rflx-test-m.ads index eb52e6a48..364eaef3b 100644 --- a/tests/feature/messages_with_multiple_initial_links/generated/rflx-test-m.ads +++ b/tests/feature/messages_with_multiple_initial_links/generated/rflx-test-m.ads @@ -497,7 +497,7 @@ private 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; P : Boolean) return Boolean is + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; P : Boolean) return Boolean is ((if Well_Formed (Cursors (F_F1)) then P) and then (if Well_Formed (Cursors (F_F2)) then Valid (Cursors (F_F1)) or not P)) with @@ -514,7 +514,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; P : Boolean; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; P : Boolean; Fld : Field) return Boolean is ((case Fld is when F_F1 => True, @@ -525,7 +525,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, P), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, P), Post => True; @@ -535,15 +535,15 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; P : Boolean; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; P : Boolean; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_F1 | F_F2 => 8)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, P) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, P, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, P) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, P, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -557,15 +557,15 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_F1 (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; P : Boolean) return RFLX_Types.Bit_Index'Base is + function Field_First_F1 (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; P : Boolean) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, P) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, P, F_F1); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, P) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, P, F_F1); - function Field_First_F2 (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; P : Boolean) return RFLX_Types.Bit_Index'Base is + function Field_First_F2 (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; P : Boolean) return RFLX_Types.Bit_Index'Base is ((if Well_Formed (Cursors (F_F1)) and then True @@ -580,20 +580,20 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, P) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, P, F_F2); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, P) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, P, F_F2); - function Field_First_Internal (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; P : Boolean; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; P : Boolean; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_F1 => - Field_First_F1 (Cursors, First, Verified_Last, Written_Last, Buffer, P), + Field_First_F1 (Cursors, First, Verified_Last, Written_Last, P), when F_F2 => - Field_First_F2 (Cursors, First, Verified_Last, Written_Last, Buffer, P))) + Field_First_F2 (Cursors, First, Verified_Last, Written_Last, P))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, P) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, P, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, P) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, P, Fld), Post => True; @@ -632,7 +632,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, P) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, P) and then (True) and then ((if Well_Formed (Cursors (F_F1)) @@ -711,16 +711,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Ctx.P, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.P, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Ctx.P, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.P, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Ctx.P, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.P, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/messages_with_single_opaque_field/generated/rflx-test-message.ads b/tests/feature/messages_with_single_opaque_field/generated/rflx-test-message.ads index e13fb17da..176526093 100644 --- a/tests/feature/messages_with_single_opaque_field/generated/rflx-test-message.ads +++ b/tests/feature/messages_with_single_opaque_field/generated/rflx-test-message.ads @@ -553,7 +553,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Data)) then True)) with Pre => @@ -569,14 +569,14 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Data => True)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -586,15 +586,15 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Data => RFLX_Types.Bit_Length (Written_Last - First + 1))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -608,23 +608,23 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Data (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 RFLX_Types.Bit_Index'Base is + function Field_First_Data (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Data); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Data); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Data => - Field_First_Data (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Data (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -663,7 +663,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then (True) and then ((if Well_Formed (Cursors (F_Data)) @@ -728,16 +728,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/parameterized_messages/generated/rflx-test-message.ads b/tests/feature/parameterized_messages/generated/rflx-test-message.ads index a008ced85..f5b2864d1 100644 --- a/tests/feature/parameterized_messages/generated/rflx-test-message.ads +++ b/tests/feature/parameterized_messages/generated/rflx-test-message.ads @@ -648,7 +648,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Length : Test.Length; Extended : Boolean) return Boolean is ((if Well_Formed (Cursors (F_Data)) then True) and then (if Well_Formed (Cursors (F_Extension)) then (Well_Formed (Cursors (F_Data)) and then Extended))) with @@ -665,7 +665,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Length : Test.Length; Extended : Boolean; Fld : Field) return Boolean is ((case Fld is when F_Data => True, @@ -675,7 +675,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Length, Extended), Post => True; @@ -685,15 +685,15 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Length : Test.Length; Extended : Boolean; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Data | F_Extension => RFLX_Types.Bit_Length (Length) * 8)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Length, Extended) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Length, Extended, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -707,33 +707,33 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Data (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 RFLX_Types.Bit_Index'Base is + function Field_First_Data (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Length : Test.Length; Extended : Boolean) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended, F_Data); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Length, Extended) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Length, Extended, F_Data); - function Field_First_Extension (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 RFLX_Types.Bit_Index'Base is - (Field_First_Data (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended) + Field_Size_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended, F_Data)) + function Field_First_Extension (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Length : Test.Length; Extended : Boolean) return RFLX_Types.Bit_Index'Base is + (Field_First_Data (Cursors, First, Verified_Last, Written_Last, Length, Extended) + Field_Size_Internal (Cursors, First, Verified_Last, Written_Last, Length, Extended, F_Data)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended, F_Extension); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Length, Extended) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Length, Extended, F_Extension); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Length : Test.Length; Extended : Boolean; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Data => - Field_First_Data (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended), + Field_First_Data (Cursors, First, Verified_Last, Written_Last, Length, Extended), when F_Extension => - Field_First_Extension (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended))) + Field_First_Extension (Cursors, First, Verified_Last, Written_Last, Length, Extended))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Length, Extended) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Length, Extended, Fld), Post => True; @@ -772,7 +772,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer, Length, Extended) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Length, Extended) and then ((if Invalid (Cursors (F_Data)) then Invalid (Cursors (F_Extension)))) and then ((if Well_Formed (Cursors (F_Data)) @@ -846,16 +846,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Ctx.Length, Ctx.Extended, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Length, Ctx.Extended, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Ctx.Length, Ctx.Extended, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Length, Ctx.Extended, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Ctx.Length, Ctx.Extended, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Length, Ctx.Extended, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/shared/generated/rflx-universal-message.ads b/tests/feature/shared/generated/rflx-universal-message.ads index 116d35990..e694ef5d1 100644 --- a/tests/feature/shared/generated/rflx-universal-message.ads +++ b/tests/feature/shared/generated/rflx-universal-message.ads @@ -1151,7 +1151,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Message_Type)) then True) and then (if Well_Formed (Cursors (F_Length)) @@ -1204,7 +1204,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Message_Type => True, @@ -1236,7 +1236,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -1246,7 +1246,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Message_Type => 8, @@ -1287,8 +1287,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -1302,23 +1302,23 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Message_Type (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 RFLX_Types.Bit_Index'Base is + function Field_First_Message_Type (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Message_Type); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Message_Type); - function Field_First_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Length); - function Field_First_Data (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 RFLX_Types.Bit_Index'Base is + function Field_First_Data (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is ((if Well_Formed (Cursors (F_Length)) and then RFLX_Types.Base_Integer (Cursors (F_Message_Type).Value) = RFLX_Types.Base_Integer (To_Base_Integer (RFLX.Universal.MT_Data)) @@ -1334,18 +1334,18 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Data); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Data); - function Field_First_Option_Types (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 RFLX_Types.Bit_Index'Base is + function Field_First_Option_Types (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 24) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Option_Types); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Option_Types); - function Field_First_Options (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 RFLX_Types.Bit_Index'Base is + function Field_First_Options (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is ((if Well_Formed (Cursors (F_Length)) and then RFLX_Types.Base_Integer (Cursors (F_Message_Type).Value) = RFLX_Types.Base_Integer (To_Base_Integer (RFLX.Universal.MT_Options)) @@ -1361,46 +1361,46 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Options); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Options); - function Field_First_Value (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 RFLX_Types.Bit_Index'Base is + function Field_First_Value (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 24) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Value); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Value); - function Field_First_Values (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 RFLX_Types.Bit_Index'Base is + function Field_First_Values (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 24) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Values); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Values); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Message_Type => - Field_First_Message_Type (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Message_Type (Cursors, First, Verified_Last, Written_Last), when F_Length => - Field_First_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Length (Cursors, First, Verified_Last, Written_Last), when F_Data => - Field_First_Data (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Data (Cursors, First, Verified_Last, Written_Last), when F_Option_Types => - Field_First_Option_Types (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Option_Types (Cursors, First, Verified_Last, Written_Last), when F_Options => - Field_First_Options (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Options (Cursors, First, Verified_Last, Written_Last), when F_Value => - Field_First_Value (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Value (Cursors, First, Verified_Last, Written_Last), when F_Values => - Field_First_Values (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Values (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -1439,7 +1439,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Message_Type)) then Invalid (Cursors (F_Length))) and then (if Invalid (Cursors (F_Length)) @@ -1592,16 +1592,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/feature/shared/generated/rflx-universal-option.ads b/tests/feature/shared/generated/rflx-universal-option.ads index 58184d909..70795865e 100644 --- a/tests/feature/shared/generated/rflx-universal-option.ads +++ b/tests/feature/shared/generated/rflx-universal-option.ads @@ -628,7 +628,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Option_Type)) then True) and then (if Well_Formed (Cursors (F_Length)) @@ -650,7 +650,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Option_Type => True, @@ -663,7 +663,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -673,7 +673,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Option_Type => 8, @@ -684,8 +684,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -699,43 +699,43 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Option_Type (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 RFLX_Types.Bit_Index'Base is + function Field_First_Option_Type (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Option_Type); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Option_Type); - function Field_First_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Length); - function Field_First_Data (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 RFLX_Types.Bit_Index'Base is + function Field_First_Data (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 24) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Data); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Data); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Option_Type => - Field_First_Option_Type (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Option_Type (Cursors, First, Verified_Last, Written_Last), when F_Length => - Field_First_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Length (Cursors, First, Verified_Last, Written_Last), when F_Data => - Field_First_Data (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Data (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -774,7 +774,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Option_Type)) then Invalid (Cursors (F_Length))) and then (if Invalid (Cursors (F_Length)) then Invalid (Cursors (F_Data)))) and then ((if @@ -860,16 +860,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-derivation-message.ads b/tests/spark/generated/rflx-derivation-message.ads index fe59016f0..6862625f7 100644 --- a/tests/spark/generated/rflx-derivation-message.ads +++ b/tests/spark/generated/rflx-derivation-message.ads @@ -630,7 +630,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Tag)) then True) and then (if Well_Formed (Cursors (F_Length)) @@ -652,7 +652,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Tag => True, @@ -665,7 +665,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -675,7 +675,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Tag => 8, @@ -686,8 +686,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -701,43 +701,43 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Tag (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 RFLX_Types.Bit_Index'Base is + function Field_First_Tag (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Tag); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Tag); - function Field_First_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Length); - function Field_First_Value (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 RFLX_Types.Bit_Index'Base is + function Field_First_Value (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 24) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Value); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Value); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Tag => - Field_First_Tag (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Tag (Cursors, First, Verified_Last, Written_Last), when F_Length => - Field_First_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Length (Cursors, First, Verified_Last, Written_Last), when F_Value => - Field_First_Value (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Value (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -776,7 +776,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) 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 @@ -862,16 +862,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-enumeration-message.ads b/tests/spark/generated/rflx-enumeration-message.ads index 7747e8363..e6b35a2d9 100644 --- a/tests/spark/generated/rflx-enumeration-message.ads +++ b/tests/spark/generated/rflx-enumeration-message.ads @@ -490,7 +490,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Priority)) then True)) with Pre => @@ -506,14 +506,14 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Priority => True)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -523,15 +523,15 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Priority => 8)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -545,23 +545,23 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Priority (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 RFLX_Types.Bit_Index'Base is + function Field_First_Priority (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Priority); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Priority); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Priority => - Field_First_Priority (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Priority (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -600,7 +600,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then (True) and then ((if Well_Formed (Cursors (F_Priority)) @@ -667,16 +667,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-ethernet-frame.ads b/tests/spark/generated/rflx-ethernet-frame.ads index b1b6c10f9..3f17637d9 100644 --- a/tests/spark/generated/rflx-ethernet-frame.ads +++ b/tests/spark/generated/rflx-ethernet-frame.ads @@ -749,7 +749,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Destination)) then True) and then (if Well_Formed (Cursors (F_Source)) then Valid (Cursors (F_Destination))) and then (if Well_Formed (Cursors (F_Type_Length_TPID)) then Valid (Cursors (F_Source))) @@ -786,7 +786,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Destination => True, @@ -815,7 +815,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -825,7 +825,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Destination | F_Source => 48, @@ -847,8 +847,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -862,47 +862,47 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Destination (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 RFLX_Types.Bit_Index'Base is + function Field_First_Destination (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Destination); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Destination); - function Field_First_Source (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 RFLX_Types.Bit_Index'Base is + function Field_First_Source (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 48) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Source); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Source); - function Field_First_Type_Length_TPID (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 RFLX_Types.Bit_Index'Base is + function Field_First_Type_Length_TPID (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 96) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Type_Length_TPID); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Type_Length_TPID); - function Field_First_TPID (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 RFLX_Types.Bit_Index'Base is + function Field_First_TPID (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 96) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_TPID); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_TPID); - function Field_First_TCI (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 RFLX_Types.Bit_Index'Base is + function Field_First_TCI (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 112) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_TCI); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_TCI); - function Field_First_Type_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Type_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is ((if Well_Formed (Cursors (F_TCI)) and then True @@ -918,38 +918,38 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Type_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Type_Length); - function Field_First_Payload (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 RFLX_Types.Bit_Index'Base is - (Field_First_Type_Length (Cursors, First, Verified_Last, Written_Last, Buffer) + 16) + function Field_First_Payload (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Type_Length (Cursors, First, Verified_Last, Written_Last) + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Payload); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Payload); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Destination => - Field_First_Destination (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Destination (Cursors, First, Verified_Last, Written_Last), when F_Source => - Field_First_Source (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Source (Cursors, First, Verified_Last, Written_Last), when F_Type_Length_TPID => - Field_First_Type_Length_TPID (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Type_Length_TPID (Cursors, First, Verified_Last, Written_Last), when F_TPID => - Field_First_TPID (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_TPID (Cursors, First, Verified_Last, Written_Last), when F_TCI => - Field_First_TCI (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_TCI (Cursors, First, Verified_Last, Written_Last), when F_Type_Length => - Field_First_Type_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Type_Length (Cursors, First, Verified_Last, Written_Last), when F_Payload => - Field_First_Payload (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Payload (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -988,7 +988,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Destination)) then Invalid (Cursors (F_Source))) and then (if Invalid (Cursors (F_Source)) then Invalid (Cursors (F_Type_Length_TPID))) and then (if Invalid (Cursors (F_Type_Length_TPID)) then Invalid (Cursors (F_TPID))) @@ -1131,16 +1131,16 @@ private and then RFLX_Types.Base_Integer (Size) / 8 <= 1500)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-fixed_size-simple_message.ads b/tests/spark/generated/rflx-fixed_size-simple_message.ads index 2951f084e..76bca12d8 100644 --- a/tests/spark/generated/rflx-fixed_size-simple_message.ads +++ b/tests/spark/generated/rflx-fixed_size-simple_message.ads @@ -612,7 +612,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Message_Type)) then True) and then (if Well_Formed (Cursors (F_Data)) @@ -633,7 +633,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Message_Type => True, @@ -643,7 +643,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -653,7 +653,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Message_Type => 8, @@ -662,8 +662,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -677,33 +677,33 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Message_Type (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 RFLX_Types.Bit_Index'Base is + function Field_First_Message_Type (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Message_Type); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Message_Type); - function Field_First_Data (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 RFLX_Types.Bit_Index'Base is + function Field_First_Data (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Data); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Data); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Message_Type => - Field_First_Message_Type (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Message_Type (Cursors, First, Verified_Last, Written_Last), when F_Data => - Field_First_Data (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Data (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -742,7 +742,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Message_Type)) then Invalid (Cursors (F_Data)))) and then ((if Well_Formed (Cursors (F_Message_Type)) @@ -819,16 +819,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-icmp-message.ads b/tests/spark/generated/rflx-icmp-message.ads index 25f44bacb..161d822da 100644 --- a/tests/spark/generated/rflx-icmp-message.ads +++ b/tests/spark/generated/rflx-icmp-message.ads @@ -1184,7 +1184,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Tag)) then True) and then (if Well_Formed (Cursors (F_Code_Destination_Unreachable)) @@ -1280,7 +1280,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Tag => True, @@ -1360,7 +1360,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -1370,7 +1370,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Tag | F_Code_Destination_Unreachable | F_Code_Redirect | F_Code_Time_Exceeded | F_Code_Zero => 8, @@ -1416,8 +1416,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -1431,173 +1431,173 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Tag (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 RFLX_Types.Bit_Index'Base is + function Field_First_Tag (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Tag); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Tag); - function Field_First_Code_Destination_Unreachable (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 RFLX_Types.Bit_Index'Base is + function Field_First_Code_Destination_Unreachable (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Code_Destination_Unreachable); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Code_Destination_Unreachable); - function Field_First_Code_Redirect (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 RFLX_Types.Bit_Index'Base is + function Field_First_Code_Redirect (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Code_Redirect); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Code_Redirect); - function Field_First_Code_Time_Exceeded (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 RFLX_Types.Bit_Index'Base is + function Field_First_Code_Time_Exceeded (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Code_Time_Exceeded); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Code_Time_Exceeded); - function Field_First_Code_Zero (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 RFLX_Types.Bit_Index'Base is + function Field_First_Code_Zero (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Code_Zero); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Code_Zero); - function Field_First_Checksum (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 RFLX_Types.Bit_Index'Base is + function Field_First_Checksum (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Checksum); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Checksum); - function Field_First_Gateway_Internet_Address (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 RFLX_Types.Bit_Index'Base is - (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer) + 16) + function Field_First_Gateway_Internet_Address (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last) + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Gateway_Internet_Address); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Gateway_Internet_Address); - function Field_First_Identifier (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 RFLX_Types.Bit_Index'Base is - (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer) + 16) + function Field_First_Identifier (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last) + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Identifier); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Identifier); - function Field_First_Pointer (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 RFLX_Types.Bit_Index'Base is - (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer) + 16) + function Field_First_Pointer (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last) + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Pointer); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Pointer); - function Field_First_Unused_32 (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 RFLX_Types.Bit_Index'Base is - (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer) + 16) + function Field_First_Unused_32 (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last) + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Unused_32); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Unused_32); - function Field_First_Sequence_Number (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 RFLX_Types.Bit_Index'Base is - (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer) + 32) + function Field_First_Sequence_Number (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last) + 32) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Sequence_Number); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Sequence_Number); - function Field_First_Unused_24 (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 RFLX_Types.Bit_Index'Base is - (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer) + 24) + function Field_First_Unused_24 (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last) + 24) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Unused_24); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Unused_24); - function Field_First_Originate_Timestamp (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 RFLX_Types.Bit_Index'Base is - (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer) + 48) + function Field_First_Originate_Timestamp (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last) + 48) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Originate_Timestamp); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Originate_Timestamp); - function Field_First_Data (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 RFLX_Types.Bit_Index'Base is - (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer) + 48) + function Field_First_Data (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last) + 48) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Data); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Data); - function Field_First_Receive_Timestamp (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 RFLX_Types.Bit_Index'Base is - (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer) + 80) + function Field_First_Receive_Timestamp (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last) + 80) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Receive_Timestamp); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Receive_Timestamp); - function Field_First_Transmit_Timestamp (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 RFLX_Types.Bit_Index'Base is - (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer) + 112) + function Field_First_Transmit_Timestamp (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Checksum (Cursors, First, Verified_Last, Written_Last) + 112) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Transmit_Timestamp); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Transmit_Timestamp); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Tag => - Field_First_Tag (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Tag (Cursors, First, Verified_Last, Written_Last), when F_Code_Destination_Unreachable => - Field_First_Code_Destination_Unreachable (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Code_Destination_Unreachable (Cursors, First, Verified_Last, Written_Last), when F_Code_Redirect => - Field_First_Code_Redirect (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Code_Redirect (Cursors, First, Verified_Last, Written_Last), when F_Code_Time_Exceeded => - Field_First_Code_Time_Exceeded (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Code_Time_Exceeded (Cursors, First, Verified_Last, Written_Last), when F_Code_Zero => - Field_First_Code_Zero (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Code_Zero (Cursors, First, Verified_Last, Written_Last), when F_Checksum => - Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Checksum (Cursors, First, Verified_Last, Written_Last), when F_Gateway_Internet_Address => - Field_First_Gateway_Internet_Address (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Gateway_Internet_Address (Cursors, First, Verified_Last, Written_Last), when F_Identifier => - Field_First_Identifier (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Identifier (Cursors, First, Verified_Last, Written_Last), when F_Pointer => - Field_First_Pointer (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Pointer (Cursors, First, Verified_Last, Written_Last), when F_Unused_32 => - Field_First_Unused_32 (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Unused_32 (Cursors, First, Verified_Last, Written_Last), when F_Sequence_Number => - Field_First_Sequence_Number (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Sequence_Number (Cursors, First, Verified_Last, Written_Last), when F_Unused_24 => - Field_First_Unused_24 (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Unused_24 (Cursors, First, Verified_Last, Written_Last), when F_Originate_Timestamp => - Field_First_Originate_Timestamp (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Originate_Timestamp (Cursors, First, Verified_Last, Written_Last), when F_Data => - Field_First_Data (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Data (Cursors, First, Verified_Last, Written_Last), when F_Receive_Timestamp => - Field_First_Receive_Timestamp (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Receive_Timestamp (Cursors, First, Verified_Last, Written_Last), when F_Transmit_Timestamp => - Field_First_Transmit_Timestamp (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Transmit_Timestamp (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -1636,7 +1636,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Tag)) then Invalid (Cursors (F_Code_Destination_Unreachable))) and then (if Invalid (Cursors (F_Tag)) then Invalid (Cursors (F_Code_Redirect))) and then (if Invalid (Cursors (F_Tag)) then Invalid (Cursors (F_Code_Time_Exceeded))) @@ -1913,16 +1913,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-ipv4-option.ads b/tests/spark/generated/rflx-ipv4-option.ads index 9cdc59889..e9edae83a 100644 --- a/tests/spark/generated/rflx-ipv4-option.ads +++ b/tests/spark/generated/rflx-ipv4-option.ads @@ -715,7 +715,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Copied)) then True) and then (if Well_Formed (Cursors (F_Option_Class)) then Valid (Cursors (F_Copied))) and then (if Well_Formed (Cursors (F_Option_Number)) then Valid (Cursors (F_Option_Class))) @@ -754,7 +754,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Copied => True, @@ -784,7 +784,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -794,7 +794,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Copied => 1, @@ -809,8 +809,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -824,63 +824,63 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Copied (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 RFLX_Types.Bit_Index'Base is + function Field_First_Copied (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Copied); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Copied); - function Field_First_Option_Class (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 RFLX_Types.Bit_Index'Base is + function Field_First_Option_Class (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 1) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Option_Class); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Option_Class); - function Field_First_Option_Number (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 RFLX_Types.Bit_Index'Base is + function Field_First_Option_Number (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 3) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Option_Number); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Option_Number); - function Field_First_Option_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Option_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Option_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Option_Length); - function Field_First_Option_Data (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 RFLX_Types.Bit_Index'Base is + function Field_First_Option_Data (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Option_Data); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Option_Data); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Copied => - Field_First_Copied (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Copied (Cursors, First, Verified_Last, Written_Last), when F_Option_Class => - Field_First_Option_Class (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Option_Class (Cursors, First, Verified_Last, Written_Last), when F_Option_Number => - Field_First_Option_Number (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Option_Number (Cursors, First, Verified_Last, Written_Last), when F_Option_Length => - Field_First_Option_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Option_Length (Cursors, First, Verified_Last, Written_Last), when F_Option_Data => - Field_First_Option_Data (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Option_Data (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -919,7 +919,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Copied)) then Invalid (Cursors (F_Option_Class))) and then (if Invalid (Cursors (F_Option_Class)) then Invalid (Cursors (F_Option_Number))) and then (if Invalid (Cursors (F_Option_Number)) then Invalid (Cursors (F_Option_Length))) @@ -1037,16 +1037,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-ipv4-packet.ads b/tests/spark/generated/rflx-ipv4-packet.ads index 791705cb8..7d882bece 100644 --- a/tests/spark/generated/rflx-ipv4-packet.ads +++ b/tests/spark/generated/rflx-ipv4-packet.ads @@ -1440,7 +1440,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Version)) then True) and then (if Well_Formed (Cursors (F_IHL)) then Valid (Cursors (F_Version))) and then (if Well_Formed (Cursors (F_DSCP)) then Valid (Cursors (F_IHL))) @@ -1480,7 +1480,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Version => True, @@ -1535,7 +1535,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -1545,7 +1545,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Version | F_IHL => 4, @@ -1572,8 +1572,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -1587,183 +1587,183 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Version (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 RFLX_Types.Bit_Index'Base is + function Field_First_Version (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Version); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Version); - function Field_First_IHL (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 RFLX_Types.Bit_Index'Base is + function Field_First_IHL (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 4) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_IHL); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_IHL); - function Field_First_DSCP (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 RFLX_Types.Bit_Index'Base is + function Field_First_DSCP (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_DSCP); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_DSCP); - function Field_First_ECN (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 RFLX_Types.Bit_Index'Base is + function Field_First_ECN (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 14) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_ECN); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_ECN); - function Field_First_Total_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Total_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Total_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Total_Length); - function Field_First_Identification (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 RFLX_Types.Bit_Index'Base is + function Field_First_Identification (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 32) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Identification); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Identification); - function Field_First_Flag_R (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 RFLX_Types.Bit_Index'Base is + function Field_First_Flag_R (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 48) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Flag_R); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Flag_R); - function Field_First_Flag_DF (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 RFLX_Types.Bit_Index'Base is + function Field_First_Flag_DF (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 49) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Flag_DF); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Flag_DF); - function Field_First_Flag_MF (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 RFLX_Types.Bit_Index'Base is + function Field_First_Flag_MF (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 50) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Flag_MF); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Flag_MF); - function Field_First_Fragment_Offset (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 RFLX_Types.Bit_Index'Base is + function Field_First_Fragment_Offset (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 51) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Fragment_Offset); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Fragment_Offset); - function Field_First_TTL (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 RFLX_Types.Bit_Index'Base is + function Field_First_TTL (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 64) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_TTL); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_TTL); - function Field_First_Protocol (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 RFLX_Types.Bit_Index'Base is + function Field_First_Protocol (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 72) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Protocol); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Protocol); - function Field_First_Header_Checksum (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 RFLX_Types.Bit_Index'Base is + function Field_First_Header_Checksum (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 80) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Header_Checksum); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Header_Checksum); - function Field_First_Source (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 RFLX_Types.Bit_Index'Base is + function Field_First_Source (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 96) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Source); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Source); - function Field_First_Destination (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 RFLX_Types.Bit_Index'Base is + function Field_First_Destination (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 128) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Destination); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Destination); - function Field_First_Options (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 RFLX_Types.Bit_Index'Base is + function Field_First_Options (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 160) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Options); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Options); - function Field_First_Payload (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 RFLX_Types.Bit_Index'Base is - (Field_First_Options (Cursors, First, Verified_Last, Written_Last, Buffer) + Field_Size_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Options)) + function Field_First_Payload (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Options (Cursors, First, Verified_Last, Written_Last) + Field_Size_Internal (Cursors, First, Verified_Last, Written_Last, F_Options)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Payload); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Payload); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Version => - Field_First_Version (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Version (Cursors, First, Verified_Last, Written_Last), when F_IHL => - Field_First_IHL (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_IHL (Cursors, First, Verified_Last, Written_Last), when F_DSCP => - Field_First_DSCP (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_DSCP (Cursors, First, Verified_Last, Written_Last), when F_ECN => - Field_First_ECN (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_ECN (Cursors, First, Verified_Last, Written_Last), when F_Total_Length => - Field_First_Total_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Total_Length (Cursors, First, Verified_Last, Written_Last), when F_Identification => - Field_First_Identification (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Identification (Cursors, First, Verified_Last, Written_Last), when F_Flag_R => - Field_First_Flag_R (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Flag_R (Cursors, First, Verified_Last, Written_Last), when F_Flag_DF => - Field_First_Flag_DF (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Flag_DF (Cursors, First, Verified_Last, Written_Last), when F_Flag_MF => - Field_First_Flag_MF (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Flag_MF (Cursors, First, Verified_Last, Written_Last), when F_Fragment_Offset => - Field_First_Fragment_Offset (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Fragment_Offset (Cursors, First, Verified_Last, Written_Last), when F_TTL => - Field_First_TTL (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_TTL (Cursors, First, Verified_Last, Written_Last), when F_Protocol => - Field_First_Protocol (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Protocol (Cursors, First, Verified_Last, Written_Last), when F_Header_Checksum => - Field_First_Header_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Header_Checksum (Cursors, First, Verified_Last, Written_Last), when F_Source => - Field_First_Source (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Source (Cursors, First, Verified_Last, Written_Last), when F_Destination => - Field_First_Destination (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Destination (Cursors, First, Verified_Last, Written_Last), when F_Options => - Field_First_Options (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Options (Cursors, First, Verified_Last, Written_Last), when F_Payload => - Field_First_Payload (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Payload (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -1802,7 +1802,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Version)) then Invalid (Cursors (F_IHL))) and then (if Invalid (Cursors (F_IHL)) then Invalid (Cursors (F_DSCP))) and then (if Invalid (Cursors (F_DSCP)) then Invalid (Cursors (F_ECN))) @@ -1997,16 +1997,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-sequence-inner_message.ads b/tests/spark/generated/rflx-sequence-inner_message.ads index 7011db6de..fe728c270 100644 --- a/tests/spark/generated/rflx-sequence-inner_message.ads +++ b/tests/spark/generated/rflx-sequence-inner_message.ads @@ -626,7 +626,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Length)) then True) and then (if Well_Formed (Cursors (F_Payload)) then Valid (Cursors (F_Length)))) with @@ -643,7 +643,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Length => True, @@ -653,7 +653,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -663,7 +663,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Length => 8, @@ -672,8 +672,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -687,33 +687,33 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Length); - function Field_First_Payload (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 RFLX_Types.Bit_Index'Base is + function Field_First_Payload (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Payload); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Payload); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Length => - Field_First_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Length (Cursors, First, Verified_Last, Written_Last), when F_Payload => - Field_First_Payload (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Payload (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -752,7 +752,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Length)) then Invalid (Cursors (F_Payload)))) and then ((if Well_Formed (Cursors (F_Length)) @@ -827,16 +827,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-sequence-message.ads b/tests/spark/generated/rflx-sequence-message.ads index 1c1e49d70..45550f6e1 100644 --- a/tests/spark/generated/rflx-sequence-message.ads +++ b/tests/spark/generated/rflx-sequence-message.ads @@ -857,7 +857,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Length)) then True) and then (if Well_Formed (Cursors (F_Integer_Vector)) then Valid (Cursors (F_Length))) and then (if Well_Formed (Cursors (F_Enumeration_Vector)) then Well_Formed (Cursors (F_Integer_Vector))) @@ -876,7 +876,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Length => True, @@ -892,7 +892,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -902,7 +902,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Length => 8, @@ -913,8 +913,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -928,53 +928,53 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Length); - function Field_First_Integer_Vector (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 RFLX_Types.Bit_Index'Base is + function Field_First_Integer_Vector (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Integer_Vector); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Integer_Vector); - function Field_First_Enumeration_Vector (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 RFLX_Types.Bit_Index'Base is - (Field_First_Integer_Vector (Cursors, First, Verified_Last, Written_Last, Buffer) + Field_Size_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Integer_Vector)) + function Field_First_Enumeration_Vector (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Integer_Vector (Cursors, First, Verified_Last, Written_Last) + Field_Size_Internal (Cursors, First, Verified_Last, Written_Last, F_Integer_Vector)) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Enumeration_Vector); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Enumeration_Vector); - function Field_First_AV_Enumeration_Vector (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 RFLX_Types.Bit_Index'Base is - (Field_First_Integer_Vector (Cursors, First, Verified_Last, Written_Last, Buffer) + Field_Size_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Integer_Vector) + 16) + function Field_First_AV_Enumeration_Vector (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is + (Field_First_Integer_Vector (Cursors, First, Verified_Last, Written_Last) + Field_Size_Internal (Cursors, First, Verified_Last, Written_Last, F_Integer_Vector) + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_AV_Enumeration_Vector); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_AV_Enumeration_Vector); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Length => - Field_First_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Length (Cursors, First, Verified_Last, Written_Last), when F_Integer_Vector => - Field_First_Integer_Vector (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Integer_Vector (Cursors, First, Verified_Last, Written_Last), when F_Enumeration_Vector => - Field_First_Enumeration_Vector (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Enumeration_Vector (Cursors, First, Verified_Last, Written_Last), when F_AV_Enumeration_Vector => - Field_First_AV_Enumeration_Vector (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_AV_Enumeration_Vector (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -1013,7 +1013,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Length)) then Invalid (Cursors (F_Integer_Vector))) and then (if Invalid (Cursors (F_Integer_Vector)) then Invalid (Cursors (F_Enumeration_Vector))) and then (if Invalid (Cursors (F_Enumeration_Vector)) then Invalid (Cursors (F_AV_Enumeration_Vector)))) @@ -1100,16 +1100,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-sequence-messages_message.ads b/tests/spark/generated/rflx-sequence-messages_message.ads index 655f4c8dd..806993645 100644 --- a/tests/spark/generated/rflx-sequence-messages_message.ads +++ b/tests/spark/generated/rflx-sequence-messages_message.ads @@ -611,7 +611,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Length)) then True) and then (if Well_Formed (Cursors (F_Messages)) then Valid (Cursors (F_Length)))) with @@ -628,7 +628,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Length => True, @@ -638,7 +638,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -648,7 +648,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Length => 8, @@ -657,8 +657,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -672,33 +672,33 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Length); - function Field_First_Messages (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 RFLX_Types.Bit_Index'Base is + function Field_First_Messages (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Messages); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Messages); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Length => - Field_First_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Length (Cursors, First, Verified_Last, Written_Last), when F_Messages => - Field_First_Messages (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Messages (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -737,7 +737,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Length)) then Invalid (Cursors (F_Messages)))) and then ((if Well_Formed (Cursors (F_Length)) @@ -812,16 +812,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-sequence-sequence_size_defined_by_message_size.ads b/tests/spark/generated/rflx-sequence-sequence_size_defined_by_message_size.ads index ec4f52ec9..754b83387 100644 --- a/tests/spark/generated/rflx-sequence-sequence_size_defined_by_message_size.ads +++ b/tests/spark/generated/rflx-sequence-sequence_size_defined_by_message_size.ads @@ -613,7 +613,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Header)) then True) and then (if Well_Formed (Cursors (F_Vector)) then Valid (Cursors (F_Header)))) with @@ -630,7 +630,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Header => True, @@ -640,7 +640,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -650,7 +650,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Header => 8, @@ -659,8 +659,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -674,33 +674,33 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Header (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 RFLX_Types.Bit_Index'Base is + function Field_First_Header (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Header); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Header); - function Field_First_Vector (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 RFLX_Types.Bit_Index'Base is + function Field_First_Vector (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Vector); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Vector); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Header => - Field_First_Header (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Header (Cursors, First, Verified_Last, Written_Last), when F_Vector => - Field_First_Vector (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Vector (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -739,7 +739,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Header)) then Invalid (Cursors (F_Vector)))) and then ((if Well_Formed (Cursors (F_Header)) @@ -814,16 +814,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-tlv-message.ads b/tests/spark/generated/rflx-tlv-message.ads index e52a7e0de..3c85c922b 100644 --- a/tests/spark/generated/rflx-tlv-message.ads +++ b/tests/spark/generated/rflx-tlv-message.ads @@ -628,7 +628,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Tag)) then True) and then (if Well_Formed (Cursors (F_Length)) @@ -650,7 +650,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Tag => True, @@ -663,7 +663,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -673,7 +673,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Tag => 8, @@ -684,8 +684,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -699,43 +699,43 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Tag (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 RFLX_Types.Bit_Index'Base is + function Field_First_Tag (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Tag); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Tag); - function Field_First_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 8) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Length); - function Field_First_Value (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 RFLX_Types.Bit_Index'Base is + function Field_First_Value (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 24) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Value); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Value); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Tag => - Field_First_Tag (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Tag (Cursors, First, Verified_Last, Written_Last), when F_Length => - Field_First_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Length (Cursors, First, Verified_Last, Written_Last), when F_Value => - Field_First_Value (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Value (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -774,7 +774,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) 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 @@ -860,16 +860,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/spark/generated/rflx-udp-datagram.ads b/tests/spark/generated/rflx-udp-datagram.ads index 96e2e90f5..f577c64b1 100644 --- a/tests/spark/generated/rflx-udp-datagram.ads +++ b/tests/spark/generated/rflx-udp-datagram.ads @@ -749,7 +749,7 @@ private 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 + function Valid_Predecessors_Invariant (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return Boolean is ((if Well_Formed (Cursors (F_Source_Port)) then True) and then (if Well_Formed (Cursors (F_Destination_Port)) then Valid (Cursors (F_Source_Port))) and then (if Well_Formed (Cursors (F_Length)) then Valid (Cursors (F_Destination_Port))) @@ -769,7 +769,7 @@ private pragma Warnings (Off, "postcondition does not mention function result"); - function Valid_Next_Internal (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; Fld : Field) return Boolean is + function Valid_Next_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return Boolean is ((case Fld is when F_Source_Port => True, @@ -788,7 +788,7 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last), Post => True; @@ -798,7 +798,7 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_Size_Internal (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; Fld : Field) return RFLX_Types.Bit_Length'Base is + function Field_Size_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Length'Base is ((case Fld is when F_Source_Port | F_Destination_Port | F_Length | F_Checksum => 16, @@ -807,8 +807,8 @@ private with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld); pragma Warnings (On, "formal parameter ""*"" is not referenced"); @@ -822,63 +822,63 @@ private pragma Warnings (Off, "formal parameter ""*"" is not referenced"); - function Field_First_Source_Port (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 RFLX_Types.Bit_Index'Base is + function Field_First_Source_Port (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Source_Port); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Source_Port); - function Field_First_Destination_Port (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 RFLX_Types.Bit_Index'Base is + function Field_First_Destination_Port (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 16) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Destination_Port); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Destination_Port); - function Field_First_Length (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 RFLX_Types.Bit_Index'Base is + function Field_First_Length (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 32) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Length); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Length); - function Field_First_Checksum (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 RFLX_Types.Bit_Index'Base is + function Field_First_Checksum (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 48) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Checksum); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Checksum); - function Field_First_Payload (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 RFLX_Types.Bit_Index'Base is + function Field_First_Payload (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length) return RFLX_Types.Bit_Index'Base is (First + 64) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, F_Payload); + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, F_Payload); - function Field_First_Internal (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; Fld : Field) return RFLX_Types.Bit_Index'Base is + function Field_First_Internal (Cursors : Field_Cursors; First : RFLX_Types.Bit_Index; Verified_Last : RFLX_Types.Bit_Length; Written_Last : RFLX_Types.Bit_Length; Fld : Field) return RFLX_Types.Bit_Index'Base is ((case Fld is when F_Source_Port => - Field_First_Source_Port (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Source_Port (Cursors, First, Verified_Last, Written_Last), when F_Destination_Port => - Field_First_Destination_Port (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Destination_Port (Cursors, First, Verified_Last, Written_Last), when F_Length => - Field_First_Length (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Length (Cursors, First, Verified_Last, Written_Last), when F_Checksum => - Field_First_Checksum (Cursors, First, Verified_Last, Written_Last, Buffer), + Field_First_Checksum (Cursors, First, Verified_Last, Written_Last), when F_Payload => - Field_First_Payload (Cursors, First, Verified_Last, Written_Last, Buffer))) + Field_First_Payload (Cursors, First, Verified_Last, Written_Last))) with Pre => Cursors_Invariant (Cursors, First, Verified_Last) - and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) - and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Buffer, Fld), + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) + and then Valid_Next_Internal (Cursors, First, Verified_Last, Written_Last, Fld), Post => True; @@ -917,7 +917,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 Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last, Buffer) + and then Valid_Predecessors_Invariant (Cursors, First, Verified_Last, Written_Last) and then ((if Invalid (Cursors (F_Source_Port)) then Invalid (Cursors (F_Destination_Port))) and then (if Invalid (Cursors (F_Destination_Port)) then Invalid (Cursors (F_Length))) and then (if Invalid (Cursors (F_Length)) then Invalid (Cursors (F_Checksum))) @@ -1014,16 +1014,16 @@ private True)); function Field_Size (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is - (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_Size_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_First (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Index is - (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Field_First_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Field_Last (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Field_First (Ctx, Fld) + Field_Size (Ctx, Fld) - 1); function Valid_Next (Ctx : Context; Fld : Field) return Boolean is - (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Ctx.Buffer, Fld)); + (Valid_Next_Internal (Ctx.Cursors, Ctx.First, Ctx.Verified_Last, Ctx.Written_Last, Fld)); function Available_Space (Ctx : Context; Fld : Field) return RFLX_Types.Bit_Length is (Ctx.Last - Field_First (Ctx, Fld) + 1); diff --git a/tests/unit/model/message_test.py b/tests/unit/model/message_test.py index 3f9ab85ef..a4653d49a 100644 --- a/tests/unit/model/message_test.py +++ b/tests/unit/model/message_test.py @@ -3354,6 +3354,48 @@ def test_aggregate_equal_invalid_size_field() -> None: ) +@pytest.mark.parametrize( + "condition", + [ + Equal( + Variable(ID("Magic", location=Location((3, 3)))), + Aggregate(Number(1), Number(2), Number(3), Number(4), Number(4)), + location=Location((4, 4)), + ), + Equal( + Aggregate(Number(1), Number(2), Number(3), Number(4), Number(4)), + Variable(ID("Magic", location=Location((3, 3)))), + location=Location((4, 4)), + ), + ], +) +def test_has_aggregate_dependent_condition(condition: Expr) -> None: + structure = [ + Link( + INITIAL, + Field(ID("Magic", location=Location((1, 1)))), + size=Number(40, location=Location((1, 1))), + location=Location((1, 1)), + ), + Link( + Field(ID("Magic", location=Location((2, 2)))), + FINAL, + condition=condition, + location=Location((2, 2)), + ), + ] + types = { + Field(ID("Magic", location=Location((1, 1)))): OPAQUE, + } + m = Message( + ID("P::M", Location((1, 1))), + structure, + types, + location=Location((1, 1), end=(1, 2)), + ) + assert m.has_aggregate_dependent_condition() + + def test_no_unreachable_field_multi() -> None: structure = [ Link(INITIAL, Field(ID("F0", location=Location((1, 1))))),