]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove references to Might_Not_Return and Always_Return
authorClaire Dross <dross@adacore.com>
Thu, 30 Mar 2023 09:09:33 +0000 (11:09 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 20 Jun 2023 07:30:48 +0000 (09:30 +0200)
The Might_Not_Return and Always_Return annotations for GNATprove
should now be replaced by the two more precise aspects
Exceptional_Cases and Always_Terminates.
They allow to specify whether a subprogram is allowed to raise
exceptions or fail to complete.

gcc/ada/

* libgnat/a-strfix.ads: Replace Might_Not_Return annotations by
Exceptional_Cases and Always_Terminates aspects.
* libgnat/a-tideio.ads: Idem.
* libgnat/a-tienio.ads: Idem.
* libgnat/a-tifiio.ads: Idem.
* libgnat/a-tiflio.ads: Idem.
* libgnat/a-tiinio.ads: Idem.
* libgnat/a-timoio.ads: Idem.
* libgnat/a-textio.ads: Idem. Also mark functions Name, Col, Line,
and Page as out of SPARK as they might raise Layout_Error.
* libgnarl/a-reatim.ads: Replace Always_Return annotations by
Always_Terminates aspects.
* libgnat/a-chahan.ads: Idem.
* libgnat/a-nbnbig.ads: Idem.
* libgnat/a-nbnbin.ads: Idem.
* libgnat/a-nbnbre.ads: Idem.
* libgnat/a-ngelfu.ads: Idem.
* libgnat/a-nlelfu.ads: Idem.
* libgnat/a-nllefu.ads: Idem.
* libgnat/a-nselfu.ads: Idem.
* libgnat/a-nuelfu.ads: Idem.
* libgnat/a-strbou.ads: Idem.
* libgnat/a-strmap.ads: Idem.
* libgnat/a-strsea.ads: Idem.
* libgnat/a-strsup.ads: Idem.
* libgnat/a-strunb.ads: Idem.
* libgnat/a-strunb__shared.ads: Idem.
* libgnat/g-souinf.ads: Idem.
* libgnat/i-c.ads: Idem.
* libgnat/interfac.ads: Idem.
* libgnat/interfac__2020.ads: Idem.
* libgnat/s-aridou.adb: Idem.
* libgnat/s-arit32.adb: Idem.
* libgnat/s-atacco.ads: Idem.
* libgnat/s-spcuop.ads: Idem.
* libgnat/s-stoele.ads: Idem.
* libgnat/s-vaispe.ads: Idem.
* libgnat/s-vauspe.ads: Idem.
* libgnat/i-cstrin.ads: Add a precondition instead of a
Might_Not_Return annotation.

36 files changed:
gcc/ada/libgnarl/a-reatim.ads
gcc/ada/libgnat/a-chahan.ads
gcc/ada/libgnat/a-nbnbig.ads
gcc/ada/libgnat/a-nbnbin.ads
gcc/ada/libgnat/a-nbnbre.ads
gcc/ada/libgnat/a-ngelfu.ads
gcc/ada/libgnat/a-nlelfu.ads
gcc/ada/libgnat/a-nllefu.ads
gcc/ada/libgnat/a-nselfu.ads
gcc/ada/libgnat/a-nuelfu.ads
gcc/ada/libgnat/a-strbou.ads
gcc/ada/libgnat/a-strfix.ads
gcc/ada/libgnat/a-strmap.ads
gcc/ada/libgnat/a-strsea.ads
gcc/ada/libgnat/a-strsup.ads
gcc/ada/libgnat/a-strunb.ads
gcc/ada/libgnat/a-strunb__shared.ads
gcc/ada/libgnat/a-textio.ads
gcc/ada/libgnat/a-tideio.ads
gcc/ada/libgnat/a-tienio.ads
gcc/ada/libgnat/a-tifiio.ads
gcc/ada/libgnat/a-tiflio.ads
gcc/ada/libgnat/a-tiinio.ads
gcc/ada/libgnat/a-timoio.ads
gcc/ada/libgnat/g-souinf.ads
gcc/ada/libgnat/i-c.ads
gcc/ada/libgnat/i-cstrin.ads
gcc/ada/libgnat/interfac.ads
gcc/ada/libgnat/interfac__2020.ads
gcc/ada/libgnat/s-aridou.adb
gcc/ada/libgnat/s-arit32.adb
gcc/ada/libgnat/s-atacco.ads
gcc/ada/libgnat/s-spcuop.ads
gcc/ada/libgnat/s-stoele.ads
gcc/ada/libgnat/s-vaispe.ads
gcc/ada/libgnat/s-vauspe.ads

index c5009d25cff8298ecb0824f6e26faf092677db57..a616d57963391475e173877eb203c1dd67c4450b 100644 (file)
@@ -39,9 +39,9 @@ pragma Elaborate_All (System.Task_Primitives.Operations);
 package Ada.Real_Time with
   SPARK_Mode,
   Abstract_State => (Clock_Time with Synchronous),
-  Initializes    => Clock_Time
+  Initializes    => Clock_Time,
+  Always_Terminates
 is
-   pragma Annotate (GNATprove, Always_Return, Real_Time);
 
    pragma Compile_Time_Error
      (Duration'Size /= 64,
index 159cd70218ede803140bddb19b30afc8e404911e..89b2d68ccc2d7c833151feb5ee5ea2e3d1707e43 100644 (file)
@@ -40,14 +40,13 @@ pragma Assertion_Policy (Post => Ignore);
 
 with Ada.Characters.Latin_1;
 
-package Ada.Characters.Handling
-  with SPARK_Mode
+package Ada.Characters.Handling with
+  SPARK_Mode,
+  Always_Terminates
 is
    pragma Pure;
    --  In accordance with Ada 2005 AI-362
 
-   pragma Annotate (GNATprove, Always_Return, Handling);
-
    ----------------------------------------
    -- Character Classification Functions --
    ----------------------------------------
index f83bf5276b36bd53d74db65fd3a7d11f2b2fbdc6..382a7b60d18661c07012483daee24b88de236808 100644 (file)
@@ -30,9 +30,9 @@ pragma Assertion_Policy (Ghost => Ignore);
 package Ada.Numerics.Big_Numbers.Big_Integers_Ghost with
    SPARK_Mode,
    Ghost,
-   Pure
+   Pure,
+   Always_Terminates
 is
-   pragma Annotate (GNATprove, Always_Return, Big_Integers_Ghost);
 
    type Big_Integer is private
      with Integer_Literal => From_Universal_Image;
index ffb96d4d98be75384d80059dec8910d4af8989af..c4d74ee513bec17dc61ab87f43595f7cf69459a9 100644 (file)
@@ -18,10 +18,10 @@ with Ada.Strings.Text_Buffers; use Ada.Strings.Text_Buffers;
 private with Ada.Finalization;
 private with System;
 
-package Ada.Numerics.Big_Numbers.Big_Integers
-  with Preelaborate
+package Ada.Numerics.Big_Numbers.Big_Integers with
+  Preelaborate,
+  Always_Terminates
 is
-   pragma Annotate (GNATprove, Always_Return, Big_Integers);
 
    type Big_Integer is private
      with Integer_Literal => From_Universal_Image,
index 350d0497ed490b207bd8c1c9e11b9a66949532c1..d342eebd6b64a59d8f115c834c7d23fbada1d61b 100644 (file)
@@ -17,10 +17,10 @@ with Ada.Numerics.Big_Numbers.Big_Integers;
 
 with Ada.Strings.Text_Buffers; use Ada.Strings.Text_Buffers;
 
-package Ada.Numerics.Big_Numbers.Big_Reals
-  with Preelaborate
+package Ada.Numerics.Big_Numbers.Big_Reals with
+  Preelaborate,
+  Always_Terminates
 is
-   pragma Annotate (GNATprove, Always_Return, Big_Reals);
 
    type Big_Real is private with
      Real_Literal => From_Universal_Image,
index f6d6c9643af9b9fb2daeb72746782e48c66bab09..444d1a31724dbbebf88465e45aa1411e21a867b3 100644 (file)
@@ -37,10 +37,10 @@ generic
    type Float_Type is digits <>;
 
 package Ada.Numerics.Generic_Elementary_Functions with
-  SPARK_Mode => On
+  SPARK_Mode => On,
+  Always_Terminates
 is
    pragma Pure;
-   pragma Annotate (GNATprove, Always_Return, Generic_Elementary_Functions);
 
    --  Preconditions in this unit are meant for analysis only, not for run-time
    --  checking, so that the expected exceptions are raised when calling
index b3afd1fc997cb7e8811d4597a0cd8fa043c0c671..10b33e9cb3c7a9dc8ddb033a1e2dfa702db05053 100644 (file)
@@ -19,4 +19,3 @@ package Ada.Numerics.Long_Elementary_Functions is
   new Ada.Numerics.Generic_Elementary_Functions (Long_Float);
 
 pragma Pure (Long_Elementary_Functions);
-pragma Annotate (GNATprove, Always_Return, Long_Elementary_Functions);
index e137c67e78641b23fa75574c3da78c27f0869c2f..7089fc3efb0daef2721039cc7b324c907f359bf5 100644 (file)
@@ -19,4 +19,3 @@ package Ada.Numerics.Long_Long_Elementary_Functions is
   new Ada.Numerics.Generic_Elementary_Functions (Long_Long_Float);
 
 pragma Pure (Long_Long_Elementary_Functions);
-pragma Annotate (GNATprove, Always_Return, Long_Long_Elementary_Functions);
index 6797efd70e98e2352866613e4d127e6e430a9dae..10b04acdeb9432ef838acafa3cdc0ac2c505f5c4 100644 (file)
@@ -19,4 +19,3 @@ package Ada.Numerics.Short_Elementary_Functions is
   new Ada.Numerics.Generic_Elementary_Functions (Short_Float);
 
 pragma Pure (Short_Elementary_Functions);
-pragma Annotate (GNATprove, Always_Return, Short_Elementary_Functions);
index d4fe74572f686d2038951fe0865d3b5b73adb2a1..149939babea13b193dd7807aee0781f25fd5c255 100644 (file)
@@ -19,4 +19,3 @@ package Ada.Numerics.Elementary_Functions is
   new Ada.Numerics.Generic_Elementary_Functions (Float);
 
 pragma Pure (Elementary_Functions);
-pragma Annotate (GNATprove, Always_Return, Elementary_Functions);
index 1e4a366c5fe37eaf48e8fa9d02e66a8835bf4f4f..ea0cc3f7a512832850d9a3fbcd166086334566d0 100644 (file)
@@ -47,9 +47,11 @@ with Ada.Strings.Maps; use type Ada.Strings.Maps.Character_Mapping_Function;
 with Ada.Strings.Superbounded;
 with Ada.Strings.Search;
 
-package Ada.Strings.Bounded with SPARK_Mode is
+package Ada.Strings.Bounded with
+  SPARK_Mode,
+  Always_Terminates
+is
    pragma Preelaborate;
-   pragma Annotate (GNATprove, Always_Return, Bounded);
 
    generic
       Max : Positive;
@@ -57,7 +59,8 @@ package Ada.Strings.Bounded with SPARK_Mode is
 
    package Generic_Bounded_Length with SPARK_Mode,
      Initial_Condition => Length (Null_Bounded_String) = 0,
-     Abstract_State    => null
+     Abstract_State    => null,
+     Always_Terminates
    is
       --  Preconditions in this unit are meant for analysis only, not for
       --  run-time checking, so that the expected exceptions are raised. This
@@ -69,7 +72,6 @@ package Ada.Strings.Bounded with SPARK_Mode is
                                Post           => Ignore,
                                Contract_Cases => Ignore,
                                Ghost          => Ignore);
-      pragma Annotate (GNATprove, Always_Return, Generic_Bounded_Length);
 
       Max_Length : constant Positive := Max;
 
index 0838d59d5f7cc1caa6669a65a9e746105b9e209f..9d5e9d9234161e3afb77e512ca7967d647f1b944 100644 (file)
@@ -46,7 +46,10 @@ pragma Assertion_Policy (Pre            => Ignore,
 with Ada.Strings.Maps; use type Ada.Strings.Maps.Character_Mapping_Function;
 with Ada.Strings.Search;
 
-package Ada.Strings.Fixed with SPARK_Mode is
+package Ada.Strings.Fixed with
+  SPARK_Mode,
+  Always_Terminates
+is
    pragma Preelaborate;
 
    --------------------------------------------------------------
@@ -60,11 +63,9 @@ package Ada.Strings.Fixed with SPARK_Mode is
       Justify : Alignment  := Left;
       Pad     : Character  := Space)
    with
-
-     --  Incomplete contract
-
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases =>
+       (Length_Error => Target'Length'Old < Source'Length and Drop = Error);
    --  The Move procedure copies characters from Source to Target. If Source
    --  has the same length as Target, then the effect is to assign Source to
    --  Target. If Source is shorter than Target then:
@@ -169,8 +170,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
         others
         =>
           Index'Result = 0),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
    pragma Ada_05 (Index);
 
    function Index
@@ -233,8 +233,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
         others
         =>
           Index'Result = 0),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
    pragma Ada_05 (Index);
 
    --  Each Index function searches, starting from From, for a slice of
@@ -303,8 +302,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
         others
         =>
           Index'Result = 0),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
 
    function Index
      (Source  : String;
@@ -359,8 +357,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
         others
         =>
           Index'Result = 0),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
 
    --  If Going = Forward, returns:
    --
@@ -413,8 +410,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                        and then (J < Index'Result) = (Going = Forward)
                   then (Test = Inside)
                        /= Ada.Strings.Maps.Is_In (Source (J), Set)))),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
 
    function Index
      (Source  : String;
@@ -470,8 +466,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                                 or else (J > From) = (Going = Forward))
                   then (Test = Inside)
                        /= Ada.Strings.Maps.Is_In (Source (J), Set)))),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
    pragma Ada_05 (Index);
    --  Index searches for the first or last occurrence of any of a set of
    --  characters (when Test=Inside), or any of the complement of a set of
@@ -531,8 +526,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                        and then (J = From or else (J > From)
                                 = (Going = Forward))
                   then Source (J) = ' '))),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
    pragma Ada_05 (Index_Non_Blank);
    --  Returns Index (Source, Maps.To_Set(Space), From, Outside, Going)
 
@@ -570,8 +564,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                        and then (J < Index_Non_Blank'Result)
                               = (Going = Forward)
                   then Source (J) = ' '))),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
    --  Returns Index (Source, Maps.To_Set(Space), Outside, Going)
 
    function Count
@@ -579,18 +572,16 @@ package Ada.Strings.Fixed with SPARK_Mode is
       Pattern : String;
       Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
    with
-     Pre      => Pattern'Length /= 0,
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Pre    => Pattern'Length /= 0,
+     Global => null;
 
    function Count
      (Source  : String;
       Pattern : String;
       Mapping : Maps.Character_Mapping_Function) return Natural
    with
-     Pre      => Pattern'Length /= 0 and then Mapping /= null,
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Pre    => Pattern'Length /= 0 and then Mapping /= null,
+     Global => null;
 
    --  Returns the maximum number of nonoverlapping slices of Source that match
    --  Pattern with respect to Mapping. If Pattern is the null string then
@@ -600,8 +591,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
      (Source : String;
       Set    : Maps.Character_Set) return Natural
    with
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Global => null;
    --  Returns the number of occurrences in Source of characters that are in
    --  Set.
 
@@ -659,8 +649,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                then
                  (Test = Inside)
                  /= Ada.Strings.Maps.Is_In (Source (Last + 1), Set))),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
    pragma Ada_2012 (Find_Token);
    --  If Source is not the null string and From is not in Source'Range, then
    --  Index_Error is raised. Otherwise, First is set to the index of the first
@@ -722,8 +711,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                then
                  (Test = Inside)
                  /= Ada.Strings.Maps.Is_In (Source (Last + 1), Set))),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
    --  Equivalent to Find_Token (Source, Set, Source'First, Test, First, Last)
 
    ------------------------------------
@@ -752,8 +740,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
            (for all J in Source'Range =>
               Translate'Result (J - Source'First + 1)
               = Mapping (Source (J))),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global => null;
    pragma Annotate (GNATprove, False_Positive,
                     "call via access-to-subprogram",
                     "function Mapping must always terminate");
@@ -779,8 +766,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
            (for all J in Source'Range =>
               Translate'Result (J - Source'First + 1)
               = Ada.Strings.Maps.Value (Mapping, Source (J))),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global => null;
 
    --  Returns the string S whose length is Source'Length and such that S (I)
    --  is the character to which Mapping maps the corresponding element of
@@ -790,15 +776,14 @@ package Ada.Strings.Fixed with SPARK_Mode is
      (Source  : in out String;
       Mapping : Maps.Character_Mapping_Function)
    with
-     Pre      => Mapping /= null,
-     Post     =>
+     Pre    => Mapping /= null,
+     Post   =>
 
        --  Each character in Source after the call is the translation of the
        --  character at the same position before the call, through Mapping.
 
        (for all J in Source'Range => Source (J) = Mapping (Source'Old (J))),
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Global => null;
    pragma Annotate (GNATprove, False_Positive,
                     "call via access-to-subprogram",
                     "function Mapping must always terminate");
@@ -807,15 +792,14 @@ package Ada.Strings.Fixed with SPARK_Mode is
      (Source  : in out String;
       Mapping : Maps.Character_Mapping)
    with
-     Post     =>
+     Post   =>
 
        --  Each character in Source after the call is the translation of the
        --  character at the same position before the call, through Mapping.
 
        (for all J in Source'Range =>
           Source (J) = Ada.Strings.Maps.Value (Mapping, Source'Old (J))),
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Global => null;
 
    --  Equivalent to Source := Translate(Source, Mapping)
 
@@ -908,8 +892,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                   (Low - Source'First + By'Length + 1
                    .. Replace_Slice'Result'Last)
                 = Source (Low .. Source'Last))),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
    --  If Low > Source'Last + 1, or High < Source'First - 1, then Index_Error
    --  is propagated. Otherwise:
    --
@@ -929,7 +912,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
       Justify : Alignment  := Left;
       Pad     : Character  := Space)
    with
-     Pre      =>
+     Pre               =>
        Low - 1 <= Source'Last
          and then High >= Source'First - 1
          and then (if High >= Low
@@ -938,11 +921,8 @@ package Ada.Strings.Fixed with SPARK_Mode is
                            - By'Length
                            - Natural'Max (Source'Last - High, 0)
                    else Source'Length <= Natural'Last - By'Length),
-
-   --  Incomplete contract
-
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Length_Error => Drop = Error);
    --  Equivalent to:
    --
    --    Move (Replace_Slice (Source, Low, High, By),
@@ -988,8 +968,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                 (Before - Source'First + New_Item'Length + 1
                  .. Insert'Result'Last)
               = Source (Before .. Source'Last)),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
    --  Propagates Index_Error if Before is not in
    --  Source'First .. Source'Last + 1; otherwise, returns
    --  Source (Source'First .. Before - 1)
@@ -1001,14 +980,11 @@ package Ada.Strings.Fixed with SPARK_Mode is
       New_Item : String;
       Drop     : Truncation := Error)
    with
-     Pre      =>
+     Pre               =>
        Before - 1 in Source'First - 1 .. Source'Last
          and then Source'Length <= Natural'Last - New_Item'Length,
-
-     --  Incomplete contract
-
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Length_Error => Drop = Error);
    --  Equivalent to Move (Insert (Source, Before, New_Item), Source, Drop)
 
    function Overwrite
@@ -1057,8 +1033,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                 (Position - Source'First + New_Item'Length + 1
                  .. Overwrite'Result'Last)
               = Source (Position + New_Item'Length .. Source'Last)),
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Global   => null;
    --  Propagates Index_Error if Position is not in
    --  Source'First .. Source'Last + 1; otherwise, returns the string obtained
    --  from Source by consecutively replacing characters starting at Position
@@ -1072,16 +1047,13 @@ package Ada.Strings.Fixed with SPARK_Mode is
       New_Item : String;
       Drop     : Truncation := Right)
    with
-     Pre      =>
+     Pre               =>
        Position - 1 in Source'First - 1 .. Source'Last
          and then
            (if Position - Source'First >= Source'Length - New_Item'Length
             then Position - Source'First <= Natural'Last - New_Item'Length),
-
-     --  Incomplete contract
-
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Length_Error => Drop = Error);
    --  Equivalent to Move(Overwrite(Source, Position, New_Item), Source, Drop)
 
    function Delete
@@ -1129,8 +1101,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
         others          =>
           Delete'Result'Length = Source'Length
             and then Delete'Result = Source),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
    --  If From <= Through, the returned string is
    --  Replace_Slice(Source, From, Through, ""); otherwise, it is Source with
    --  lower bound 1.
@@ -1142,14 +1113,10 @@ package Ada.Strings.Fixed with SPARK_Mode is
       Justify : Alignment := Left;
       Pad     : Character := Space)
    with
-     Pre      => (if From <= Through
+     Pre    => (if From <= Through
                   then (From in Source'Range
                           and then Through <= Source'Last)),
-
-     --  Incomplete contract
-
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global => null;
    --  Equivalent to:
    --
    --     Move (Delete (Source, From, Through),
@@ -1163,7 +1130,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
      (Source : String;
       Side   : Trim_End) return String
    with
-     Post     =>
+     Post   =>
 
        --  Lower bound of the returned string is 1
 
@@ -1188,8 +1155,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                     else Index_Non_Blank (Source, Backward));
                begin
                  Trim'Result = Source (Low .. High))),
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Global => null;
    --  Returns the string obtained by removing from Source all leading Space
    --  characters (if Side = Left), all trailing Space characters (if
    --  Side = Right), or all leading and trailing Space characters (if
@@ -1201,11 +1167,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
       Justify : Alignment := Left;
       Pad     : Character := Space)
    with
-
-     --  Incomplete contract
-
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global => null;
    --  Equivalent to:
    --
    --     Move (Trim (Source, Side), Source, Justify=>Justify, Pad=>Pad).
@@ -1242,8 +1204,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                 Index (Source, Right, Outside, Backward);
             begin
               Trim'Result = Source (Low .. High))),
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Global => null;
    --  Returns the string obtained by removing from Source all leading
    --  characters in Left and all trailing characters in Right.
 
@@ -1254,11 +1215,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
       Justify : Alignment := Strings.Left;
       Pad     : Character := Space)
    with
-
-     --  Incomplete contract
-
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global => null;
    --  Equivalent to:
    --
    --     Move (Trim (Source, Left, Right),
@@ -1295,8 +1252,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
             and then
               Head'Result (Source'Length + 1 .. Count)
               = [1 .. Count - Source'Length => Pad]),
-     Global         => null,
-     Annotate       => (GNATprove, Always_Return);
+     Global         => null;
    --  Returns a string of length Count. If Count <= Source'Length, the string
    --  comprises the first Count characters of Source. Otherwise, its contents
    --  are Source concatenated with Count - Source'Length Pad characters.
@@ -1307,11 +1263,8 @@ package Ada.Strings.Fixed with SPARK_Mode is
       Justify : Alignment := Left;
       Pad     : Character := Space)
    with
-
-     --  Incomplete contract
-
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Length_Error => Count > Source'Length'Old);
    --  Equivalent to:
    --
    --     Move (Head (Source, Count, Pad),
@@ -1360,8 +1313,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
                and then
                  Tail'Result (Count - Source'Length + 1 .. Tail'Result'Last)
                  = Source)),
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Global         => null;
    --  Returns a string of length Count. If Count <= Source'Length, the string
    --  comprises the last Count characters of Source. Otherwise, its contents
    --  are Count-Source'Length Pad characters concatenated with Source.
@@ -1372,11 +1324,8 @@ package Ada.Strings.Fixed with SPARK_Mode is
       Justify : Alignment := Left;
       Pad     : Character := Space)
    with
-
-     --  Incomplete contract
-
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Length_Error => Count > Source'Length'Old);
    --  Equivalent to:
    --
    --     Move (Tail (Source, Count, Pad),
@@ -1390,7 +1339,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
      (Left  : Natural;
       Right : Character) return String
    with
-     Post     =>
+     Post   =>
 
        --  Lower bound of the returned string is 1
 
@@ -1403,8 +1352,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
          --  All characters of the returned string are Right
 
          and then (for all C of "*"'Result => C = Right),
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Global => null;
 
    function "*"
      (Left  : Natural;
@@ -1427,8 +1375,7 @@ package Ada.Strings.Fixed with SPARK_Mode is
          and then
            (for all K in "*"'Result'Range =>
               "*"'Result (K) = Right (Right'First + (K - 1) mod Right'Length)),
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Global => null;
 
    --  These functions replicate a character or string a specified number of
    --  times. The first function returns a string whose length is Left and each
index 73dd3d92a180b10079243d2dd1a3df8e1f5f3d75..a070da016b1a3ad1ccdd138c7002ee068427b3cb 100644 (file)
@@ -48,14 +48,13 @@ pragma Assertion_Policy (Pre   => Ignore,
 
 with Ada.Characters.Latin_1;
 
-package Ada.Strings.Maps
-  with SPARK_Mode
+package Ada.Strings.Maps with
+  SPARK_Mode,
+  Always_Terminates
 is
    pragma Pure;
    --  In accordance with Ada 2005 AI-362
 
-   pragma Annotate (GNATprove, Always_Return, Maps);
-
    --------------------------------
    -- Character Set Declarations --
    --------------------------------
index 5651bdcdf3cfb5e57da405384d97685f6a636abb..df1b3429529ca72ecdcbca44bbe20765fc7bcef4 100644 (file)
@@ -50,9 +50,11 @@ pragma Assertion_Policy (Pre            => Ignore,
 
 with Ada.Strings.Maps; use type Ada.Strings.Maps.Character_Mapping_Function;
 
-package Ada.Strings.Search with SPARK_Mode is
+package Ada.Strings.Search with
+  SPARK_Mode,
+  Always_Terminates
+is
    pragma Preelaborate;
-   pragma Annotate (GNATprove, Always_Return, Search);
 
    --  The ghost function Match tells whether the slice of Source starting at
    --  From and of length Pattern'Length matches with Pattern with respect to
index 2e0cd98f8d4c46da93b1b2cca2ff3774d857f730..339cb17f5dfda998fdd949f7b1e0d10e022a172e 100644 (file)
@@ -51,9 +51,11 @@ with Ada.Strings.Maps; use type Ada.Strings.Maps.Character_Mapping_Function;
 with Ada.Strings.Search;
 with Ada.Strings.Text_Buffers;
 
-package Ada.Strings.Superbounded with SPARK_Mode is
+package Ada.Strings.Superbounded with
+  SPARK_Mode,
+  Always_Terminates
+is
    pragma Preelaborate;
-   pragma Annotate (GNATprove, Always_Return, Superbounded);
 
    --  Type Bounded_String in Ada.Strings.Bounded.Generic_Bounded_Length is
    --  derived from Super_String, with the constraint of the maximum length.
index d3e88d0b4b62cfe14085447cc7ba09e1bfe8408b..be76ad2bec5734b94cefdc417bd473f0185a5761 100644 (file)
@@ -54,10 +54,10 @@ private with Ada.Strings.Text_Buffers;
 
 package Ada.Strings.Unbounded with
   SPARK_Mode,
-  Initial_Condition => Length (Null_Unbounded_String) = 0
+  Initial_Condition => Length (Null_Unbounded_String) = 0,
+  Always_Terminates
 is
    pragma Preelaborate;
-   pragma Annotate (GNATprove, Always_Return, Unbounded);
 
    type Unbounded_String is private with
      Default_Initial_Condition => Length (Unbounded_String) = 0;
index 3f5d56e0a8cef46f725ab82b408a6723a4422d8a..2da9dc72b3b533ad847c61615c112f9682123160 100644 (file)
@@ -83,10 +83,10 @@ private with System.Atomic_Counters;
 private with Ada.Strings.Text_Buffers;
 
 package Ada.Strings.Unbounded with
-  Initial_Condition => Length (Null_Unbounded_String) = 0
+  Initial_Condition => Length (Null_Unbounded_String) = 0,
+  Always_Terminates
 is
    pragma Preelaborate;
-   pragma Annotate (GNATprove, Always_Return, Unbounded);
 
    type Unbounded_String is private with
      Default_Initial_Condition => Length (Unbounded_String) = 0;
index 9cedab6a22237fb860bb651fcdb95dd04e81c4c4..ddbbd8592ccf2fe8c46c59bec14567592e7627b8 100644 (file)
@@ -59,7 +59,8 @@ package Ada.Text_IO with
   SPARK_Mode,
   Abstract_State    => File_System,
   Initializes       => File_System,
-  Initial_Condition => Line_Length = 0 and Page_Length = 0
+  Initial_Condition => Line_Length = 0 and Page_Length = 0,
+  Always_Terminates
 is
    pragma Elaborate_Body;
 
@@ -101,15 +102,15 @@ is
       Name : String := "";
       Form : String := "")
    with
-     Pre      => not Is_Open (File),
-     Post     =>
+     Pre               => not Is_Open (File),
+     Post              =>
        Is_Open (File)
        and then Ada.Text_IO.Mode (File) = Mode
        and then (if Mode /= In_File
                    then (Line_Length (File) = 0
                          and then Page_Length (File) = 0)),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Name_Error | Use_Error => Standard.True);
 
    procedure Open
      (File : in out File_Type;
@@ -117,57 +118,56 @@ is
       Name : String;
       Form : String := "")
    with
-     Pre      => not Is_Open (File),
-     Post     =>
+     Pre               => not Is_Open (File),
+     Post              =>
       Is_Open (File)
       and then Ada.Text_IO.Mode (File) = Mode
       and then (if Mode /= In_File
                   then (Line_Length (File) = 0
                         and then Page_Length (File) = 0)),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Name_Error | Use_Error => Standard.True);
 
    procedure Close  (File : in out File_Type) with
-     Pre      => Is_Open (File),
-     Post     => not Is_Open (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Pre    => Is_Open (File),
+     Post   => not Is_Open (File),
+     Global => (In_Out => File_System);
 
    procedure Delete (File : in out File_Type) with
-     Pre      => Is_Open (File),
-     Post     => not Is_Open (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File),
+     Post              => not Is_Open (File),
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Use_Error => Standard.True);
 
    procedure Reset  (File : in out File_Type; Mode : File_Mode) with
-     Pre      => Is_Open (File),
-     Post     =>
+     Pre               => Is_Open (File),
+     Post              =>
        Is_Open (File)
        and then Ada.Text_IO.Mode (File) = Mode
        and then (if Mode /= In_File
                    then (Line_Length (File) = 0
                          and then Page_Length (File) = 0)),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Use_Error => Standard.True);
 
    procedure Reset  (File : in out File_Type) with
-     Pre      => Is_Open (File),
-     Post     =>
+     Pre               => Is_Open (File),
+     Post              =>
        Is_Open (File)
        and Mode (File)'Old = Mode (File)
        and (if Mode (File) /= In_File
                 then (Line_Length (File) = 0
                       and then Page_Length (File) = 0)),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Use_Error => Standard.True);
 
    function Mode (File : File_Type) return File_Mode with
      Pre    => Is_Open (File),
      Global => null;
 
    function Name (File : File_Type) return String with
-     Pre    => Is_Open (File),
-     Global => null;
+     Pre        => Is_Open (File),
+     SPARK_Mode => Off;
 
    function Form (File : File_Type) return String with
      Pre    => Is_Open (File),
@@ -210,53 +210,51 @@ is
    --  an oversight, and was intended to be IN, see AI95-00057.
 
    procedure Flush (File : File_Type) with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre    => Is_Open (File) and then Mode (File) /= In_File,
+     Post   =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    procedure Flush with
-     Post     =>
+     Post   =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    --------------------------------------------
    -- Specification of line and page lengths --
    --------------------------------------------
 
    procedure Set_Line_Length (File : File_Type; To : Count) with
-     Pre      => Is_Open (File)  and then Mode (File) /= In_File,
-     Post     =>
+     Pre               => Is_Open (File)  and then Mode (File) /= In_File,
+     Post              =>
        Line_Length (File) = To
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Use_Error => Standard.True);
 
    procedure Set_Line_Length (To : Count) with
-     Post     =>
+     Post              =>
        Line_Length = To
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Use_Error => Standard.True);
 
    procedure Set_Page_Length (File : File_Type; To : Count) with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre               => Is_Open (File) and then Mode (File) /= In_File,
+     Post              =>
        Page_Length (File) = To
        and Line_Length (File)'Old = Line_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Use_Error => Standard.True);
 
    procedure Set_Page_Length (To : Count) with
-     Post     =>
+     Post              =>
        Page_Length = To
        and Line_Length'Old = Line_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Use_Error => Standard.True);
 
    function Line_Length (File : File_Type) return Count with
      Pre    => Is_Open (File) and then Mode (File) /= In_File,
@@ -277,31 +275,29 @@ is
    ------------------------------------
 
    procedure New_Line (File : File_Type; Spacing : Positive_Count := 1) with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre    => Is_Open (File) and then Mode (File) /= In_File,
+     Post   =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    procedure New_Line (Spacing : Positive_Count := 1) with
-     Post     =>
+     Post   =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    procedure Skip_Line (File : File_Type; Spacing : Positive_Count := 1) with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    procedure Skip_Line (Spacing : Positive_Count := 1) with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    function End_Of_Line (File : File_Type) return Boolean with
      Pre    => Is_Open (File) and then Mode (File) = In_File,
@@ -311,31 +307,29 @@ is
      Global => (Input => File_System);
 
    procedure New_Page (File : File_Type) with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre    => Is_Open (File) and then Mode (File) /= In_File,
+     Post   =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    procedure New_Page with
-     Post     =>
+     Post   =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    procedure Skip_Page (File : File_Type) with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    procedure Skip_Page with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    function End_Of_Page (File : File_Type) return Boolean with
      Pre    => Is_Open (File) and then Mode (File) = In_File,
@@ -352,209 +346,201 @@ is
      Global => (Input => File_System);
 
    procedure Set_Col (File : File_Type;  To : Positive_Count) with
-     Pre            =>
+     Pre               =>
        Is_Open (File)
        and then (if Mode (File) /= In_File
                      then (Line_Length (File) = 0
                            or else To <= Line_Length (File))),
-     Contract_Cases =>
+     Contract_Cases    =>
        (Mode (File) /= In_File =>
               Line_Length (File)'Old = Line_Length (File)
               and Page_Length (File)'Old = Page_Length (File),
         others                 => True),
-     Global         => (In_Out => File_System),
-     Annotate       => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    procedure Set_Col (To : Positive_Count) with
-     Pre      => Line_Length = 0 or To <= Line_Length,
-     Post     =>
+     Pre               => Line_Length = 0 or To <= Line_Length,
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    procedure Set_Line (File : File_Type; To : Positive_Count) with
-     Pre            =>
+     Pre               =>
        Is_Open (File)
        and then (if Mode (File) /= In_File
                      then (Page_Length (File) = 0
                            or else To <= Page_Length (File))),
-     Contract_Cases =>
+     Contract_Cases    =>
        (Mode (File) /= In_File =>
               Line_Length (File)'Old = Line_Length (File)
               and Page_Length (File)'Old = Page_Length (File),
         others                 => True),
-     Global         => (In_Out => File_System),
-     Annotate       => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    procedure Set_Line (To : Positive_Count) with
-     Pre      => Page_Length = 0 or To <= Page_Length,
-     Post     =>
+     Pre               => Page_Length = 0 or To <= Page_Length,
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    function Col (File : File_Type) return Positive_Count with
-     Pre    => Is_Open (File),
-     Global => (Input => File_System);
+     SPARK_Mode => Off;
 
    function Col return Positive_Count with
-     Global => (Input => File_System);
+     SPARK_Mode => Off;
 
    function Line (File : File_Type) return Positive_Count with
-     Pre    => Is_Open (File),
-     Global => (Input => File_System);
+     SPARK_Mode => Off;
 
    function Line return Positive_Count with
-     Global => (Input => File_System);
+     SPARK_Mode => Off;
 
    function Page (File : File_Type) return Positive_Count with
-     Pre    => Is_Open (File),
-     Global => (Input => File_System);
+     SPARK_Mode => Off;
 
    function Page return Positive_Count with
-     Global => (Input => File_System);
+     SPARK_Mode => Off;
 
    ----------------------------
    -- Character Input-Output --
    ----------------------------
 
    procedure Get (File : File_Type; Item : out Character) with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    procedure Get (Item : out Character) with
-     Post   =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    procedure Put (File : File_Type; Item : Character) with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre    => Is_Open (File) and then Mode (File) /= In_File,
+     Post   =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    procedure Put (Item : Character) with
-     Post     =>
+     Post   =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    procedure Look_Ahead
      (File        : File_Type;
       Item        : out Character;
       End_Of_Line : out Boolean)
    with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (Input => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Pre    => Is_Open (File) and then Mode (File) = In_File,
+     Global => (Input => File_System);
 
    procedure Look_Ahead
      (Item        : out Character;
       End_Of_Line : out Boolean)
    with
-     Post     =>
+     Post   =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (Input => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (Input => File_System);
 
    procedure Get_Immediate
      (File : File_Type;
       Item : out Character)
    with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    procedure Get_Immediate
      (Item : out Character)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    procedure Get_Immediate
      (File      : File_Type;
       Item      : out Character;
       Available : out Boolean)
    with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    procedure Get_Immediate
      (Item      : out Character;
       Available : out Boolean)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Standard.True);
 
    -------------------------
    -- String Input-Output --
    -------------------------
 
    procedure Get (File : File_Type; Item : out String) with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Item'Length'Old > 0);
 
    procedure Get (Item : out String) with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Item'Length'Old > 0);
 
    procedure Put (File : File_Type; Item : String) with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre    => Is_Open (File) and then Mode (File) /= In_File,
+     Post   =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    procedure Put (Item : String) with
-     Post     =>
+     Post   =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    procedure Get_Line
      (File : File_Type;
       Item : out String;
       Last : out Natural)
    with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Post     => (if Item'Length > 0 then Last in Item'First - 1 .. Item'Last
-               else Last = Item'First - 1),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Post              =>
+       (if Item'Length > 0 then Last in Item'First - 1 .. Item'Last
+        else Last = Item'First - 1),
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Item'Length'Old > 0);
 
    procedure Get_Line
      (Item : out String;
       Last : out Natural)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length
        and (if Item'Length > 0 then Last in Item'First - 1 .. Item'Last
             else Last = Item'First - 1),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (End_Error => Item'Length'Old > 0);
 
    function Get_Line (File : File_Type) return String with SPARK_Mode => Off;
    pragma Ada_05 (Get_Line);
@@ -566,21 +552,19 @@ is
      (File : File_Type;
       Item : String)
    with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre    => Is_Open (File) and then Mode (File) /= In_File,
+     Post   =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    procedure Put_Line
      (Item : String)
    with
-     Post     =>
+     Post   =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Always_Return);
+     Global => (In_Out => File_System);
 
    ---------------------------------------
    -- Generic packages for Input-Output --
index b62d251201a5f76f8dff8899f1dca3a06a85cba6..7f8fa1915758196b17e1a8d345d997375e159aaa 100644 (file)
@@ -43,7 +43,9 @@
 private generic
    type Num is delta <> digits <>;
 
-package Ada.Text_IO.Decimal_IO is
+package Ada.Text_IO.Decimal_IO with
+  Always_Terminates
+is
 
    Default_Fore : Field := Num'Fore;
    Default_Aft  : Field := Num'Aft;
@@ -54,19 +56,19 @@ package Ada.Text_IO.Decimal_IO is
       Item  : out Num;
       Width : Field := 0)
    with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
 
    procedure Get
      (Item  : out Num;
       Width : Field := 0)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
 
    procedure Put
      (File : File_Type;
@@ -75,12 +77,12 @@ package Ada.Text_IO.Decimal_IO is
       Aft  : Field := Default_Aft;
       Exp  : Field := Default_Exp)
    with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre               => Is_Open (File) and then Mode (File) /= In_File,
+     Post              =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Line_Length (File) /= 0);
 
    procedure Put
      (Item : Num;
@@ -88,11 +90,11 @@ package Ada.Text_IO.Decimal_IO is
       Aft  : Field := Default_Aft;
       Exp  : Field := Default_Exp)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Ada.Text_IO.Line_Length /= 0);
 
    procedure Get
      (From : String;
@@ -100,7 +102,7 @@ package Ada.Text_IO.Decimal_IO is
       Last : out Positive)
    with
      Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Exceptional_Cases => (Data_Error => Standard.True);
 
    procedure Put
      (To   : out String;
@@ -108,8 +110,8 @@ package Ada.Text_IO.Decimal_IO is
       Aft  : Field := Default_Aft;
       Exp  : Field := Default_Exp)
    with
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Layout_Error => Standard.True);
 
 private
    pragma Inline (Get);
index aac90f767ba6804e95fd7c599f8d3cba5153ba1d..e4cdaeec514fb0fde0b7841ff807f9572f8424ea 100644 (file)
 private generic
    type Enum is (<>);
 
-package Ada.Text_IO.Enumeration_IO is
+package Ada.Text_IO.Enumeration_IO with
+  Always_Terminates
+is
 
    Default_Width : Field := 0;
    Default_Setting : Type_Set := Upper_Case;
 
    procedure Get (File : File_Type; Item : out Enum) with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
+
    procedure Get (Item : out Enum) with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
 
    procedure Put
      (File  : File_Type;
@@ -45,38 +48,38 @@ package Ada.Text_IO.Enumeration_IO is
       Width : Field := Default_Width;
       Set   : Type_Set := Default_Setting)
    with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre               => Is_Open (File) and then Mode (File) /= In_File,
+     Post              =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Line_Length (File) /= 0);
 
    procedure Put
      (Item  : Enum;
       Width : Field := Default_Width;
       Set   : Type_Set := Default_Setting)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Ada.Text_IO.Line_Length /= 0);
 
    procedure Get
      (From : String;
       Item : out Enum;
       Last : out Positive)
    with
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Data_Error => Standard.True);
 
    procedure Put
      (To   : out String;
       Item : Enum;
       Set  : Type_Set := Default_Setting)
    with
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Layout_Error => Standard.True);
 
 end Ada.Text_IO.Enumeration_IO;
index bbf8e90ffef8caff16c43ffef779f59c48420bc0..0e3e71c82f0c0464c792e38359ebd1f348ac0158 100644 (file)
 private generic
    type Num is delta <>;
 
-package Ada.Text_IO.Fixed_IO with SPARK_Mode => On is
+package Ada.Text_IO.Fixed_IO with
+  SPARK_Mode => On,
+  Always_Terminates
+is
 
    Default_Fore : Field := Num'Fore;
    Default_Aft  : Field := Num'Aft;
@@ -34,19 +37,19 @@ package Ada.Text_IO.Fixed_IO with SPARK_Mode => On is
       Item  : out Num;
       Width : Field := 0)
    with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
 
    procedure Get
      (Item  : out Num;
       Width : Field := 0)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
 
    procedure Put
      (File : File_Type;
@@ -55,12 +58,12 @@ package Ada.Text_IO.Fixed_IO with SPARK_Mode => On is
       Aft  : Field := Default_Aft;
       Exp  : Field := Default_Exp)
    with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre               => Is_Open (File) and then Mode (File) /= In_File,
+     Post              =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Line_Length (File) /= 0);
 
    procedure Put
      (Item : Num;
@@ -68,19 +71,19 @@ package Ada.Text_IO.Fixed_IO with SPARK_Mode => On is
       Aft  : Field := Default_Aft;
       Exp  : Field := Default_Exp)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Ada.Text_IO.Line_Length /= 0);
 
    procedure Get
      (From : String;
       Item : out Num;
       Last : out Positive)
    with
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Data_Error => Standard.True);
 
    procedure Put
      (To   : out String;
@@ -88,8 +91,8 @@ package Ada.Text_IO.Fixed_IO with SPARK_Mode => On is
       Aft  : Field := Default_Aft;
       Exp  : Field := Default_Exp)
    with
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Layout_Error => Standard.True);
 
 private
    pragma Inline (Get);
index 82ff84bf3458a3d52c3e6133a6ef493544c20fe6..fcfa76a963e8c81f1d1adc4571326a433716d271 100644 (file)
 private generic
    type Num is digits <>;
 
-package Ada.Text_IO.Float_IO with SPARK_Mode => On is
+package Ada.Text_IO.Float_IO with
+  SPARK_Mode => On,
+  Always_Terminates
+is
 
    Default_Fore : Field := 2;
    Default_Aft  : Field := Num'Digits - 1;
@@ -54,19 +57,19 @@ package Ada.Text_IO.Float_IO with SPARK_Mode => On is
       Item  : out Num;
       Width : Field := 0)
    with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
 
    procedure Get
      (Item  : out Num;
       Width : Field := 0)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
 
    procedure Put
      (File : File_Type;
@@ -75,12 +78,12 @@ package Ada.Text_IO.Float_IO with SPARK_Mode => On is
       Aft  : Field := Default_Aft;
       Exp  : Field := Default_Exp)
    with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre               => Is_Open (File) and then Mode (File) /= In_File,
+     Post              =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Line_Length (File) /= 0);
 
    procedure Put
      (Item : Num;
@@ -88,19 +91,19 @@ package Ada.Text_IO.Float_IO with SPARK_Mode => On is
       Aft  : Field := Default_Aft;
       Exp  : Field := Default_Exp)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Line_Length /= 0);
 
    procedure Get
      (From : String;
       Item : out Num;
       Last : out Positive)
    with
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Data_Error => Standard.True);
 
    procedure Put
      (To   : out String;
@@ -108,8 +111,8 @@ package Ada.Text_IO.Float_IO with SPARK_Mode => On is
       Aft  : Field := Default_Aft;
       Exp  : Field := Default_Exp)
    with
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Layout_Error => Standard.True);
 
 private
    pragma Inline (Get);
index 0299cc0eed1f185642021133584ad625fd70e7de..60f21cc19b6a42d5e0fb11000dbcd30f3a7ff72e 100644 (file)
@@ -43,7 +43,9 @@
 private generic
    type Num is range <>;
 
-package Ada.Text_IO.Integer_IO is
+package Ada.Text_IO.Integer_IO with
+  Always_Terminates
+is
 
    Default_Width : Field := Num'Width;
    Default_Base  : Number_Base := 10;
@@ -53,19 +55,19 @@ package Ada.Text_IO.Integer_IO is
       Item  : out Num;
       Width : Field := 0)
    with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
 
    procedure Get
      (Item  : out Num;
       Width : Field := 0)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
 
    procedure Put
      (File  : File_Type;
@@ -73,39 +75,39 @@ package Ada.Text_IO.Integer_IO is
       Width : Field := Default_Width;
       Base  : Number_Base := Default_Base)
    with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre               => Is_Open (File) and then Mode (File) /= In_File,
+     Post              =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Line_Length (File) /= 0);
 
    procedure Put
      (Item  : Num;
       Width : Field := Default_Width;
       Base  : Number_Base := Default_Base)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Line_Length /= 0);
 
    procedure Get
      (From : String;
       Item : out Num;
       Last : out Positive)
    with
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Data_Error => Standard.True);
 
    procedure Put
      (To   : out String;
       Item : Num;
       Base : Number_Base := Default_Base)
    with
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Layout_Error => Standard.True);
 
 private
    pragma Inline (Get);
index c8554b8f0aa22d03448dfd2ee39899a779b6fa70..40d91ed5eabfd405dd2d9f16e9021dc942d82799 100644 (file)
@@ -43,7 +43,9 @@
 private generic
    type Num is mod <>;
 
-package Ada.Text_IO.Modular_IO is
+package Ada.Text_IO.Modular_IO with
+  Always_Terminates
+is
 
    Default_Width : Field := Num'Width;
    Default_Base  : Number_Base := 10;
@@ -53,19 +55,19 @@ package Ada.Text_IO.Modular_IO is
       Item  : out Num;
       Width : Field := 0)
    with
-     Pre      => Is_Open (File) and then Mode (File) = In_File,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Pre               => Is_Open (File) and then Mode (File) = In_File,
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
 
    procedure Get
      (Item  : out Num;
       Width : Field := 0)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Data_Error | End_Error => Standard.True);
 
    procedure Put
      (File  : File_Type;
@@ -73,39 +75,39 @@ package Ada.Text_IO.Modular_IO is
       Width : Field := Default_Width;
       Base  : Number_Base := Default_Base)
    with
-     Pre      => Is_Open (File) and then Mode (File) /= In_File,
-     Post     =>
+     Pre               => Is_Open (File) and then Mode (File) /= In_File,
+     Post              =>
        Line_Length (File)'Old = Line_Length (File)
        and Page_Length (File)'Old = Page_Length (File),
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Line_Length (File) /= 0);
 
    procedure Put
      (Item  : Num;
       Width : Field := Default_Width;
       Base  : Number_Base := Default_Base)
    with
-     Post     =>
+     Post              =>
        Line_Length'Old = Line_Length
        and Page_Length'Old = Page_Length,
-     Global   => (In_Out => File_System),
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => (In_Out => File_System),
+     Exceptional_Cases => (Layout_Error => Line_Length /= 0);
 
    procedure Get
      (From : String;
       Item : out Num;
       Last : out Positive)
    with
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Data_Error => Standard.True);
 
    procedure Put
      (To   : out String;
       Item : Num;
       Base : Number_Base := Default_Base)
    with
-     Global   => null,
-     Annotate => (GNATprove, Might_Not_Return);
+     Global            => null,
+     Exceptional_Cases => (Layout_Error => Standard.True);
 
 private
    pragma Inline (Get);
index b6598b503d567ac56753204cc50bbc7262e4612e..ea65c73e9354e60136ecc4d42d82d4b9c0bd2bd0 100644 (file)
@@ -41,7 +41,7 @@ package GNAT.Source_Info with
    Abstract_State =>
      (Source_Code_Information with
          External => (Async_Writers, Async_Readers)),
-   Annotate => (GNATprove, Always_Return)
+   Always_Terminates
 is
    pragma Preelaborate;
    --  Note that this unit is Preelaborate, but not Pure, that's because the
index 70af56a783655274d53e7234e5bfd953d457ea1c..fe87fba32b609fc0727ab53bb54aabac279f16de 100644 (file)
@@ -27,10 +27,11 @@ pragma Assertion_Policy (Pre            => Ignore,
 with System;
 with System.Parameters;
 
-package Interfaces.C
-  with SPARK_Mode, Pure
+package Interfaces.C with
+  SPARK_Mode,
+  Pure,
+  Always_Terminates
 is
-   pragma Annotate (GNATprove, Always_Return, C);
 
    --  Each of the types declared in Interfaces.C is C-compatible.
 
index 49b1f137270096dcc3511d1b10a5a1380adde856..e486f03a5851bd9c78c2b5d7bf3d35d8f70c60c5 100644 (file)
@@ -44,7 +44,8 @@ pragma Assertion_Policy (Pre => Ignore);
 package Interfaces.C.Strings with
   SPARK_Mode     => On,
   Abstract_State => (C_Memory),
-  Initializes    => (C_Memory)
+  Initializes    => (C_Memory),
+  Always_Terminates
 is
    pragma Preelaborate;
 
@@ -118,16 +119,11 @@ is
       Chars  : char_array;
       Check  : Boolean := True)
    with
-     Pre      =>
+     Pre    =>
        Item /= Null_Ptr
-         and then
-      (if Check then
-         Strlen (Item) <= size_t'Last - Offset
-           and then Strlen (Item) + Offset <= Chars'Length),
-     Global   => (In_Out => C_Memory),
-     Annotate => (GNATprove, Might_Not_Return);
-     --  Update may not return if Check is False and the null terminator
-     --  is overwritten or skipped with Offset.
+         and then Strlen (Item) <= size_t'Last - Offset
+         and then Strlen (Item) + Offset <= Chars'Length,
+     Global => (In_Out => C_Memory);
 
    procedure Update
      (Item   : chars_ptr;
@@ -135,16 +131,11 @@ is
       Str    : String;
       Check  : Boolean := True)
    with
-     Pre      =>
+     Pre    =>
        Item /= Null_Ptr
-         and then
-      (if Check then
-         Strlen (Item) <= size_t'Last - Offset
-           and then Strlen (Item) + Offset <= Str'Length),
-     Global   => (In_Out => C_Memory),
-     Annotate => (GNATprove, Might_Not_Return);
-     --  Update may not return if Check is False and the null terminator
-     --  is overwritten or skipped with Offset.
+         and then Strlen (Item) <= size_t'Last - Offset
+         and then Strlen (Item) + Offset <= Str'Length,
+     Global => (In_Out => C_Memory);
 
    Update_Error : exception;
 
index edd3f36207b144526b12200ee2eda6dd03066991..bc37a8e339e062e586b4179777f7a31add7ef68b 100644 (file)
 
 --  This is the compiler version of this unit
 
-package Interfaces is
+package Interfaces with
+  Always_Terminates
+is
    pragma No_Elaboration_Code_All;
    pragma Pure;
-   pragma Annotate (GNATprove, Always_Return, Interfaces);
 
    --  All identifiers in this unit are implementation defined
 
index 89557bf5ea6f11111f88d47c2a46a51f977d48de..70d82be5759e66969aca5797bd402d28edb6bd37 100644 (file)
 
 --  This is the runtime version of this unit (not used during GNAT build)
 
-package Interfaces is
+package Interfaces with
+  Always_Terminates
+is
    pragma No_Elaboration_Code_All;
    pragma Pure;
-   pragma Annotate (GNATprove, Always_Return, Interfaces);
 
    --  All identifiers in this unit are implementation defined
 
index 041478538a737bdde4d2e4c392557c4b6cb84478..66ace8071ffbc063e5331852681ffabd8564cb03 100644 (file)
@@ -165,9 +165,8 @@ is
 
    function To_Neg_Int (A : Double_Uns) return Double_Int
    with
-     Annotate => (GNATprove, Always_Return),
-     Pre      => In_Double_Int_Range (-Big (A)),
-     Post     => Big (To_Neg_Int'Result) = -Big (A);
+     Pre  => In_Double_Int_Range (-Big (A)),
+     Post => Big (To_Neg_Int'Result) = -Big (A);
    --  Convert to negative integer equivalent. If the input is in the range
    --  0 .. 2 ** (Double_Size - 1), then the corresponding nonpositive signed
    --  integer (obtained by negating the given value) is returned, otherwise
@@ -175,9 +174,8 @@ is
 
    function To_Pos_Int (A : Double_Uns) return Double_Int
    with
-     Annotate => (GNATprove, Always_Return),
-     Pre      => In_Double_Int_Range (Big (A)),
-     Post     => Big (To_Pos_Int'Result) = Big (A);
+     Pre  => In_Double_Int_Range (Big (A)),
+     Post => Big (To_Pos_Int'Result) = Big (A);
    --  Convert to positive integer equivalent. If the input is in the range
    --  0 .. 2 ** (Double_Size - 1) - 1, then the corresponding non-negative
    --  signed integer is returned, otherwise constraint error is raised.
index 219523b00f27b37d916d6709757c8d0cd4c48e41..d19b9e182fd79a539c711a8d57acf739c7a9a119 100644 (file)
@@ -104,9 +104,8 @@ is
 
    function To_Neg_Int (A : Uns32) return Int32
    with
-     Annotate => (GNATprove, Always_Return),
-     Pre      => In_Int32_Range (-Big (A)),
-     Post     => Big (To_Neg_Int'Result) = -Big (A);
+     Pre  => In_Int32_Range (-Big (A)),
+     Post => Big (To_Neg_Int'Result) = -Big (A);
    --  Convert to negative integer equivalent. If the input is in the range
    --  0 .. 2**31, then the corresponding nonpositive signed integer (obtained
    --  by negating the given value) is returned, otherwise constraint error is
@@ -114,9 +113,8 @@ is
 
    function To_Pos_Int (A : Uns32) return Int32
    with
-     Annotate => (GNATprove, Always_Return),
-     Pre      => In_Int32_Range (Big (A)),
-     Post     => Big (To_Pos_Int'Result) = Big (A);
+     Pre  => In_Int32_Range (Big (A)),
+     Post => Big (To_Pos_Int'Result) = Big (A);
    --  Convert to positive integer equivalent. If the input is in the range
    --  0 .. 2**31 - 1, then the corresponding nonnegative signed integer is
    --  returned, otherwise constraint error is raised.
index bd920cc905ca36d94684d1fe474d789ea52620ee..157ca52a4f2628eaf85eab322194c88724a88d9f 100644 (file)
@@ -55,11 +55,9 @@ package System.Address_To_Access_Conversions is
    --  of no strict aliasing.
 
    function To_Pointer (Value : Address)        return Object_Pointer with
-     Global   => null,
-     Annotate => (GNATprove, Always_Return);
+     Global => null;
    function To_Address (Value : Object_Pointer) return Address with
-     SPARK_Mode => Off,
-     Annotate => (GNATprove, Always_Return);
+     SPARK_Mode => Off;
 
    pragma Import (Intrinsic, To_Pointer);
    pragma Import (Intrinsic, To_Address);
index daf550b69d8927dd83d64664104e58f6bb1ea8ac..642ded7daacbaf904bbae382ee3dda3f9227a9b2 100644 (file)
@@ -45,7 +45,7 @@
 package System.SPARK.Cut_Operations with
   SPARK_Mode,
   Pure,
-  Annotate => (GNATprove, Always_Return)
+  Always_Terminates
 is
 
    function By (Consequence, Premise : Boolean) return Boolean with
index 7de150dab59cc7949cd05a71039001c4a3b90d30..d5d70428a5d4477acfbf4104c60779f95e77d5bf 100644 (file)
@@ -37,7 +37,9 @@
 --  extra declarations that can be introduced into System using Extend_System.
 --  It is a good idea to avoid use clauses for this package.
 
-package System.Storage_Elements is
+package System.Storage_Elements with
+  Always_Terminates
+is
    pragma Pure;
    --  Note that we take advantage of the implementation permission to make
    --  this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada 2005,
@@ -46,8 +48,6 @@ package System.Storage_Elements is
    pragma No_Elaboration_Code_All;
    --  Allow the use of that restriction in units that WITH this unit
 
-   pragma Annotate (GNATprove, Always_Return, Storage_Elements);
-
    type Storage_Offset is range -Memory_Size / 2 .. Memory_Size / 2 - 1;
 
    subtype Storage_Count is Storage_Offset range 0 .. Storage_Offset'Last;
index 28efcede4c745b4ea11809b9e3d72667f2d96fc5..e74202d736e38adfa5c25f5eae698dc83a9744a5 100644 (file)
@@ -62,7 +62,7 @@ generic
 package System.Value_I_Spec with
    Ghost,
    SPARK_Mode,
-   Annotate => (GNATprove, Always_Return)
+   Always_Terminates
 is
    pragma Preelaborate;
    use all type Uns_Params.Uns_Option;
index 960ad8ec4862deaf60ce644016aac4f721918b44..bdd97b52e07decbc50562e1f180cd3e029a5ce40 100644 (file)
@@ -53,7 +53,7 @@ generic
 package System.Value_U_Spec with
    Ghost,
    SPARK_Mode,
-   Annotate => (GNATprove, Always_Return)
+   Always_Terminates
 is
    pragma Preelaborate;