[Ada] Proof of 'Image support for unsigned integers
authorYannick Moy <moy@adacore.com>
Tue, 1 Feb 2022 11:33:54 +0000 (12:33 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 11 May 2022 08:53:22 +0000 (08:53 +0000)
commitb0fd3e3120e83bcd783d5c2443bade7cef20814a
treedf06a6aebedbae5b9613493b22eaa40f96d48d60
parent48a2e84929bba9aa60497c39c18c332ebfbd256e
[Ada] Proof of 'Image support for unsigned integers

Prove System.Image_U, making the connection with the space available in
the string as computed with System.Width_U and the functions that
support the other direction of 'Value in System.Value_U.

The units that support 'Image cannot be marked Pure anymore, as they now
depend on non-pure units.

gcc/ada/

* libgnat/s-imaged.ads: Remove Pure.
* libgnat/s-imagef.ads: Remove Pure.
* libgnat/s-imager.ads: Remove Pure.
* libgnat/s-imageu.adb: Add ghost code.
* libgnat/s-imageu.ads: Add contracts.
* libgnat/s-imde128.ads: Remove Pure.
* libgnat/s-imde32.ads: Remove Pure.
* libgnat/s-imde64.ads: Remove Pure.
* libgnat/s-imfi128.ads: Remove Pure.
* libgnat/s-imfi32.ads: Remove Pure.
* libgnat/s-imfi64.ads: Remove Pure.
* libgnat/s-imgflt.ads: Remove Pure.
* libgnat/s-imglfl.ads: Remove Pure.
* libgnat/s-imgllf.ads: Remove Pure.
* libgnat/s-imglllu.ads: Instantiate with ghost subprograms.
* libgnat/s-imgllu.ads: Instantiate with ghost subprograms.
* libgnat/s-imgrea.ads: Remove Pure.
* libgnat/s-imguns.ads: Instantiate with ghost subprograms.
* libgnat/s-imguti.ads: Remove Pure.
* libgnat/s-valueu.adb (Prove_Iter_Scan_Based_Number_Ghost,
Prove_Scan_Only_Decimal_Ghost): New lemmas.
* libgnat/s-valueu.ads (Uns_Option): Do not make type ghost to
be able to use it as formal in instantiations.
(Only_Decimal_Ghost): New ghost query.
(Prove_Iter_Scan_Based_Number_Ghost,
Prove_Scan_Only_Decimal_Ghost): New lemmas.
* libgnat/s-widlllu.ads: Adapt to changes in Width_U.
* libgnat/s-widllu.ads: Adapt to changes in Width_U.
* libgnat/s-widthu.adb: Change generic function in generic
package in order to complete the postcondition. Tighten the
upper bound on the result by 1.
* libgnat/s-widthu.ads: Same.
* libgnat/s-widuns.ads: Adapt to changes in Width_U.
* gcc-interface/Make-lang.in: Add dependencies on a-nubinu,
a-numeri.ads and a-widuns.ads.
27 files changed:
gcc/ada/gcc-interface/Make-lang.in
gcc/ada/libgnat/s-imaged.ads
gcc/ada/libgnat/s-imagef.ads
gcc/ada/libgnat/s-imager.ads
gcc/ada/libgnat/s-imageu.adb
gcc/ada/libgnat/s-imageu.ads
gcc/ada/libgnat/s-imde128.ads
gcc/ada/libgnat/s-imde32.ads
gcc/ada/libgnat/s-imde64.ads
gcc/ada/libgnat/s-imfi128.ads
gcc/ada/libgnat/s-imfi32.ads
gcc/ada/libgnat/s-imfi64.ads
gcc/ada/libgnat/s-imgflt.ads
gcc/ada/libgnat/s-imglfl.ads
gcc/ada/libgnat/s-imgllf.ads
gcc/ada/libgnat/s-imglllu.ads
gcc/ada/libgnat/s-imgllu.ads
gcc/ada/libgnat/s-imgrea.ads
gcc/ada/libgnat/s-imguns.ads
gcc/ada/libgnat/s-imguti.ads
gcc/ada/libgnat/s-valueu.adb
gcc/ada/libgnat/s-valueu.ads
gcc/ada/libgnat/s-widlllu.ads
gcc/ada/libgnat/s-widllu.ads
gcc/ada/libgnat/s-widthu.adb
gcc/ada/libgnat/s-widthu.ads
gcc/ada/libgnat/s-widuns.ads