2758 Commits

Author SHA1 Message Date
Claire Dross
1018c9fd77 Document functional trees in the UG 2025-12-04 14:24:05 +00:00
Piotr Trojanek
01c95a1abb Objects with Async_Writers must be explicitly initialized
We agreed that it is safer for volatile variables (or state abstractions) with
Async_Writers to be explicitly initialized (or imported), despite SPARK RM
7.1.2(14) didn't require them to be initialized.

[changelog]
* docs/lrm/source/packages.rst
(External State): Remove rule 7.1.2(14); renumber subsequent rules.
* src/flow/flow-control_flow_graph-utility.adb
(Make_Variable_Attribute): Remove implementation of the mentioned rule.
* testsuite/gnatprove/tests/932__flow_async_import/test.out
New check on a volatile variable with no explicit initialization.
2025-12-02 12:54:14 +01:00
Johannes Kanig
8212f1a8bb Fix documentation for pragma Compile_Time_Error 2025-11-28 00:04:00 +00:00
Johannes Kanig
f72794657d Remove mention of body mode from UG 2025-11-10 00:46:59 +00:00
Andres Toom
03cadbda63 Minor whitespace fix 2025-10-28 15:14:44 +02:00
Claire Dross
0786727123 Apply 12 suggestion(s) to 1 file(s)
Co-authored-by: Tony Aiello <aiello@adacore.com>
2025-10-28 08:30:28 +00:00
Claire Dross
5f062c9510 Document restriction on predefined equality on accesses in the UG 2025-10-28 08:30:28 +00:00
Johannes Kanig
da4d09c3db Remove sources for Japanese UG 2025-10-24 10:33:45 +09:00
Martin Clochard
9e0ec1bf8c Reject ghost subprograms with Exit_Cases mentioning Program_Exit 2025-10-22 09:52:00 +00:00
Johannes Kanig
eed66e3ca6 Cleanup after removing SPARK discovery 2025-10-21 07:30:09 +00:00
Claire Dross
993050f6ec Adapt the documentation on precisely supported address clauses
To take into account the case of slices which need aliased components
to be precisely supported.
2025-10-21 07:26:49 +00:00
Johannes Kanig
1466b5d504 Document that we depend on compiler assumptions 2025-10-20 08:57:18 +00:00
Anthony Leonardo Gracio
22d6ed84e9 Remove mention of Project Properties in SPARK UG
Mention the editing capabilities (completion, tooltips etc) provided
by GNAT Studio on project files instead.

For eng/ide/gnatstudio#569
2025-10-20 07:56:36 +00:00
Johannes Kanig
e1edf75df9 Bump black to 25.1.0 2025-10-14 00:29:06 +00:00
Claire Dross
4f00a290a7 Improve RM wording for assertion levels
Make it clear that objects declared in an Ignored context are always
ignored.
2025-10-13 15:19:53 +00:00
Claire Dross
f843206b2f Add a warning in the UG about ghost code removal
To make it clear that the verification is only sound when the same
options are passed to GNATprove and to compilation regarding ghost
code removal.
2025-10-03 09:12:10 +00:00
Claire Dross
cda85d86d4 Check compatibility rules for exception propagation in ghost code 2025-10-01 13:38:55 +00:00
Piotr Trojanek
2469257c82 Replace --no-generated-global with a warning
Switch --no-generated-global was bypassing global generation by forcing
generated globals to be null where no explicit contract was present. However,
this behavior was impossible to implement precisely and now this switch causes
a warning where an explicit non-null Global or Refined_Global could be written.

[changelog]
* docs/ug/en/source/how_to_write_subprogram_contracts.rst
(Generation of Dependency Contracts): Adjust switch description.
* src/flow/flow-analysis-sanity.adb
(Check_Illegal_Writes_And_All_Variables_Known): Deconstruct GG bypass.
* src/flow/flow-analysis.adb
(Check_Required_Contracts): New check that emit warnings; body.
* src/flow/flow-analysis.ads
(Check_Required_Contracts): Likewise; spec.
* src/flow/flow.adb
(Check_Contracts): Plug new check into analysis.
* src/flow/flow_error_messages.adb
Adapt WITH clauses.
* src/flow/flow_error_messages.ads
(Error_Msg_Flow): Add precondition that was useful when special-casing missing
Refined_Global on imported subprograms.
* src/flow/flow_generated_globals-partial.adb
(Generate_Contracts): Deconstruct GG bypass in phase 1.
* src/flow/flow_generated_globals-phase_2.adb
(Resolve_Globals): Deconstruct GG bypass in phase 2.
* src/flow/flow_utility.adb
(Get_Globals): Deconstruct GG bypass in Get_Globals.
* src/flow/flow_utility.ads
(Get_Globals): Remove comment about GG bypass.
* src/spark/gnat2why_opts-reading.ads
(Flow_Generate_Contracts): Update flag description.

* testsuite/gnatprove/tests/346__flow_no_generated_global/
Add dedicated tests: units P and Q are based on the original reproducer and the
issue discussion; unit R shows different warnings for states with null and
non-null refinements; unit T is for an imported subprogram (this was found when
enabling switch on the entire testsuite).
* testsuite/gnatprove/tests/QB22-037__flow_no_gg/test.out
* testsuite/gnatprove/tests/R524-009__flow_no_global_generation_switch/test.out
* testsuite/gnatprove/tests/R717-025__flow_container/test.out
Update outputs.
2025-09-18 11:08:52 +02:00
Claire Dross
6b02580722 Fix rule about global outputs of ghost subprograms in the RM 2025-09-16 18:30:42 +00:00
Claire Dross
6e6d124e3f Explain how to enable/disable the SPARKlib levels in the UG 2025-09-16 08:04:58 +00:00
Claire Dross
cdc058af27 Add warning in the UG about static computations with No_Wrap_Around 2025-09-16 08:04:07 +00:00
Claire Dross
e364bade8f Update documentation of non-executable ghost code in the SPARKlib 2025-09-10 19:15:25 +00:00
Claire Dross
43ec56c4ea Change rules about duplicated assertion levels
Allow duplicated assertion levels if they have the same dependencies to
match the implementation.
2025-09-09 16:04:44 +02:00
Claire Dross
b6dc93ef19 Add a note about for .. of loops in the UG section about invariants 2025-09-08 13:26:41 +00:00
Claire Dross
bbf083bdcf Update rule about assignments into ghost variables 2025-09-02 09:31:26 +00:00