--  A constant of a general access-to-variable type designates a variable: the program
--  writes through it (RM 4.1(9)), and the prover follows the writes.
with Ada.Text_IO;
procedure Main is
   type Counter is record
      Value : Integer;
   end record;
   type Counter_Ref is access all Counter;
   Shared : aliased Counter := (Value => 0);
   Ref : constant Counter_Ref := Shared'Access;
begin
   Ref.Value := 1;
   Ref.all.Value := Ref.Value + 1;
   pragma Assert (Ref.Value = 2);
   Ada.Text_IO.Put_Line (Integer'Image (Ref.Value));
end Main;
