DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B0501: construct not in Verada

Catalog status: active. Default severity: error. Stable name: excluded-construct. Family: Syntax and source text.

The construct is legal Ada, but Verada leaves it out: Verada compiles only what it proves, and each of these constructs either does something the proof cannot see or has a provable replacement in Verada. Verada still reads them, so that it can say where they are, and each B0501 names the replacement in its help line.

Construct Why it is out What Verada has instead
Rendezvous: accept, task entries, select on entries, terminate alternatives A rendezvous joins two tasks at points the proof of either cannot see A protected object with entries and barriers, served by library-level tasks; a suspension object (Ada.Synchronous_Task_Control) for a simple signal
abort An aborted task can stop halfway through an update, so no invariant survives it A protected flag the task checks, or Verada.Tasking.Stop to end every task
Asynchronous select (select ... then abort) It abandons a computation midway, as abort does A computation that checks a deadline or a protected flag at safe points
requeue A requeued call is passed on to an entry its caller did not name Two entry calls, or one entry with a wider barrier
Dynamic tasks: a task or protected object declared in a subprogram, an access type to a task type, an array of tasks, a task or protected object as a record component Proving the absence of data races needs every task known when the program is built A fixed set of tasks declared in library packages, each serving a queue
Parallel blocks and loops They start tasks the program does not declare Pipelines, and library-level tasks
goto and statement labels Verada's statements are structured, each with one way in exit (with a loop name where needed), return, and named loops and blocks
'Unchecked_Access, 'Unrestricted_Access The access value can outlive the object it designates Owning access types with borrowers and observers, general access types, or Verada.Containers.Arenas
Storage pools: System.Storage_Pools and its subpools, the Storage_Pool aspect and clause, a Storage_Size clause on an access type Memory a program manages itself is outside what ownership proves Ownership, which frees owned objects, and arenas (Verada.Containers.Arenas)
Controlled types (Ada.Finalization) Initialize, Adjust and Finalize are calls the program does not write A reclaimed type, declared with Finalizable
Streams: Ada.Streams, and 'Read, 'Write, 'Input and 'Output as attributes, aspects or clauses A class-wide stream's effects are beyond the proof Encode and decode procedures written for the type
'Access of a subprogram declared in another subprogram It can read the objects of the subprogram around it, which end when that one returns Declare the subprogram in a package, so that it is at library level
Ada.Calendar; Ada.Execution_Time A calendar time depends on the host's zone; processor time is the host's to measure Ada.Real_Time for clocks, delays and intervals
Ada.Tags A tag's name and its lookup reach types by text Dispatching calls and class membership tests (X in T'Class)
Ada.Task_Identification, Ada.Synchronous_Barriers Tasks are fixed when the program is written, and wait only on protected entries and suspension objects The library-level task's own name; a protected entry whose barrier counts arrivals
Ada.Sequential_IO, Ada.Direct_IO Their files hold values in a representation the proof does not model Ada.Text_IO files, each record written and read as a line by encode and decode procedures written for the type
Ada.Text_IO.File_Access (and the file functions that return one) An access to a file is a second name for it, so a change through one is a change the proof of the other cannot see Pass the File_Type as an in out parameter
Ada.Directories.Modification_Time A calendar time depends on the host's zone and its changes Ada.Directories.Modification_Seconds, the time in seconds since the epoch
The unbounded Ada containers (Ada.Containers.Vectors, Doubly_Linked_Lists, Hashed_Maps, Ordered_Maps, Hashed_Sets, Ordered_Sets, their Indefinite_ forms, Multiway_Trees, Indefinite_Holders) They are copied by assignment and reached through cursors whose validity the proof does not follow Verada.Containers.Unbounded.Vectors, Maps, Ordered_Sets and Dictionaries, limited and reclaimed, with contracts over functional models
Ada's bounded multiway trees and indefinite holders (Ada.Containers.Bounded_Multiway_Trees, Bounded_Indefinite_Holders) A tree is reached through cursors whose validity the proof does not follow, and a holder of an indefinite value allocates its storage Verada.Containers.Graphs for a tree; a record holding the value, or Verada.Optionals, for a holder
Ada.Storage_IO It converts values to storage and back Encode and decode procedures written for the type, into a String or an array of System.Storage_Elements.Storage_Element
Ada.Locales A program's meaning does not depend on the host's language settings Values the program is given, through Ada.Command_Line
Interfaces.C.Strings A chars_ptr points at storage that C allocates and frees, which the proof does not follow Interfaces.C.char_array, with To_C and To_Ada
SPARK.Pointers.Pointers_With_Aliasing A change through one of two pointers to an object is one the proof of the other cannot see Owning access types under the ownership rules, or Verada.Containers.Arenas for shared nodes
SPARK.Cut_Operations By and So only guide how GNATprove splits an assertion Successive pragma Asserts: each is proved, then known to those after it
SPARK.Lemmas.Mod32_Arithmetic Verada's lemmas state their facts of Integer arithmetic Verada.Lemmas.Arithmetic, applied to the operands' values as integers
'Has_Same_Storage, 'Overlaps_Storage Whether two names' storage meets depends on addresses the proof does not model Ownership, which keeps an object that is written from being reached through another name; compare access values (X = Y) where two observers may designate one object
GNAT's 'Descriptor_Size and 'Type_Class The first is the size of the bounds GNAT stores beside an unconstrained array; the second classifies a type the program already names 'First, 'Last, 'Length and 'Size; a generic whose formal type states the class it takes (range <>, mod <>, digits <>)
Ada.Exceptions.Reraise_Occurrence of an occurrence other than its handler's own An occurrence kept and reraised elsewhere is an exception the proof cannot know, where a handler's own is one of its choices raise; in the handler that names the occurrence, or raise E with Exception_Message (X)
Ada.Iterator_Interfaces, Default_Iterator, Iterator_Element Generalized iteration calls subprograms the program does not name The Iterable aspect, which names the type's First, Next, Has_Element and Element operations
Constant_Indexing, Variable_Indexing, Implicit_Dereference User-defined indexing and references call subprograms the program does not name The type's own Element function and update procedures, called by name
Predicate_Failure Verada proves every predicate check Nothing: a predicate check is proved, so it never fails
Small Verada chooses a fixed-point type's small from its delta A delta that is a power of two
Unchecked_Union Reading a variant other than the one written is no value the proof can know A discriminated record, or Unchecked_Conversion of scalars
Unchecked_Conversion to or from an access type An access value made from bits designates no object the proof knows, and bits made from one show an address Handles of Verada.Containers.Arenas, which are values
'Image of an access value It would show an address, which is no value the proof knows The image of what it designates (P.all'Image), or of an arena handle
Synchronized, task and protected interfaces Verada's tasks and protected objects are declared, not implemented through interfaces Plain and limited interfaces
Access discriminants Ownership governs access values held in components, not in discriminants Owning access types with borrowers and observers, general access types, or Verada.Containers.Arenas
Exception handlers in an extended return A handler belongs to a block or a body A block around the return statement, with the handler
A real literal as an operand of a fixed-point multiplication or division The literal's type would be ambiguous A literal of the fixed-point type, such as Money'(0.5), or an integer
An Address on an object declared in a subprogram, or on one that is not volatile The prover may assume nothing of memory something else writes A library-level Volatile object, or an imported constant
Class-wide aspects other than Pre'Class and Post'Class; Extensions_Visible => False These would not be checked Pre'Class and Post'Class; the default Extensions_Visible

A Storage_Size clause on a task type is accepted and has no effect: the run-time sizes each task's stack itself, and no proof depends on it.

Handlers for the exceptions that failed checks raise are another matter: Verada proves those checks never fail, and reports such a handler as B1018. The Language Reference's Verada and standard Ada lists the Ada features Verada leaves out, with the same replacements.

Example (Vada)

package body Servers is
   task body Server is
   begin
      accept Ping (X : Integer) do   --  B0501: a rendezvous
         null;
      end Ping;
   end Server;
end Servers;

What to do

Follow the help line. Here the server becomes a protected object with an entry, and the tasks that called the server's entry call the protected object's instead:

package Servers is
   protected Mailbox is
      entry Take (X : out Integer);
      procedure Put (X : Integer);
   private
      Value : Integer := 0;
      Full : Boolean := False;
   end Mailbox;
end Servers;

Regression source and further reading

Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.

See syntax and source text, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.