2 package Predicate14
with
6 type Field_Type
is (F_Initial
, F_Payload
, F_Final
);
8 type State_Type
is (S_Valid
, S_Invalid
);
10 type Cursor_Type
(State
: State_Type
:= S_Invalid
) is private;
12 type Cursors_Type
is array (Field_Type
) of Cursor_Type
;
14 type Context_Type
is private;
16 type Result_Type
(Field
: Field_Type
:= F_Initial
) is
19 when F_Initial | F_Final
=>
26 function Valid_Context
(Context
: Context_Type
) return Boolean;
30 function Valid_Type
(Result
: Result_Type
) return Boolean is
31 (Result
.Field
= F_Initial
);
33 type Cursor_Type
(State
: State_Type
:= S_Invalid
) is
42 with Dynamic_Predicate
=>
43 (if State
= S_Valid
then Valid_Type
(Value
));
47 Field
: Field_Type
:= F_Initial
;
48 Cursors
: Cursors_Type
:= (others => (State
=> S_Invalid
));
51 function Valid_Context
(Context
: Context_Type
) return Boolean is
52 (for all F
in Context
.Cursors
'Range =>
53 (Context
.Cursors
(F
).Value
.Field
= F
));