public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <derodat@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Yannick Moy <moy@adacore.com>
Subject: [Ada] Proof of 'Image support for signed integers
Date: Thu, 12 May 2022 12:39:56 +0000	[thread overview]
Message-ID: <20220512123956.GA780522@adacore.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1803 bytes --]

Prove System.Image_I, similarly to the proof done for System.Image_U.
The contracts make the connection between the result of Image_Integer,
the available space computed with System.Width_U and the result of
'Value as computed by Value_Integer.

I/O units that now depend on non-pure units are also marked not Pure
anymore.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* libgnat/s-imagef.adb: Adapt to new signature of Image_I, by
	providing ghost imported subprograms. For now, no contract is
	used on these subprograms, as System.Image_F is not proved.
	* libgnat/s-imagef.ads: Add modular type Uns as formal
	parameter, to use in defining Int_Params for instantiating
	Image_I.
	* libgnat/s-imagei.adb: Add contracts and ghost code.
	* libgnat/s-imagei.ads: Replace Int formal parameter by package
	Int_Params, which bundles type Int and Uns with ghost
	subprograms.  Add contracts.
	* libgnat/s-imfi128.ads: Adapt to new formal of Image_F.
	* libgnat/s-imfi32.ads: Adapt to new formal of Image_F.
	* libgnat/s-imfi64.ads: Adapt to new formal of Image_F.
	* libgnat/s-imgint.ads: Adapt to new formals of Image_I.
	* libgnat/s-imglli.ads: Adapt to new formals of Image_I.
	* libgnat/s-imgllli.ads: Adapt to new formals of Image_I.
	* libgnat/s-valint.ads: Adapt to new formals of Value_I.
	* libgnat/s-vallli.ads: Adapt to new formals of Value_I.
	* libgnat/s-valllli.ads: Adapt to new formals of Value_I.
	* libgnat/s-valuei.adb (Prove_Scan_Only_Decimal_Ghost): New
	ghost lemma.
	* libgnat/s-valuei.ads: New formal parameters to prove the new
	lemma.
	* libgnat/s-valuti.ads (Int_Params): Define a generic package to
	be used as a trait-like formal parameter in Image_I and other
	generics that need to instantiate Image_I.
	* libgnat/s-widthu.ads (Big_10): Qualify the 10 literal.

[-- Attachment #2: patch.diff.gz --]
[-- Type: application/gzip, Size: 7647 bytes --]

                 reply	other threads:[~2022-05-12 12:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220512123956.GA780522@adacore.com \
    --to=derodat@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=moy@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).