[Ada] Proof of Ada.Strings.Maps
authorYannick Moy <moy@adacore.com>
Thu, 2 Sep 2021 21:29:38 +0000 (23:29 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 5 Oct 2021 08:20:00 +0000 (08:20 +0000)
commitf46939f9d4091e78e60d8d4d78d023a48a1608aa
tree4ab552062771cc195fa37fd26bddb90b9f1cf18d
parentec8ccc712cc15124090dab1ae44dccee280ce4ad
[Ada] Proof of Ada.Strings.Maps

gcc/ada/

* libgnat/a-strmap.adb: Add ghost code for proof.
(To_Range): This is the most involved proof, as it requires
creating the result of the call to To_Domain as a ghost
variable, and show the unicity of this result in order to prove
the postcondition.
* libgnat/a-strmap.ads: (SPARK_Proof_Sorted_Character_Sequence):
New ghost function.
(To_Domain): Add postcondition regarding sorting of result.
(To_Range): Fix postcondition that should compare Length instead
of Last for the results of To_Domain and To_Range, as the value
of Last for an empty result is not specified in the Ada RM.
gcc/ada/libgnat/a-strmap.adb
gcc/ada/libgnat/a-strmap.ads