--  --advisory compiles ghost code, a contract's reductions among it: the postcondition below
--  is false, and the run reports it.
pragma Extensions_Allowed (On);
with Ada.Text_IO;
procedure Main is
   type V is array (Positive range <>) of Integer;
   function Lead (B : V) return Integer is ([for X of B while X /= 0 => X]'Reduce ("+", 0))
     with Pre => B'Length < 10 and (for all X of B => X in 0 .. 9);
   function Lead2 (B : V) return Integer is (Lead (B) + 1)
     with Pre => B'Length < 10 and (for all X of B => X in 0 .. 9),
          Post => Lead2'Result = [for X of B while X /= 0 => X]'Reduce ("+", 0);
   A : constant V := [3, 5, 0, 9];
begin
   Ada.Text_IO.Put_Line (Lead2 (A)'Image);
end Main;
