comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
Subject: Re: Assertions in the Next Ada Standard
Date: 11 Jan 2002 20:56:26 -0800
Date: 2002-01-12T04:56:26+00:00	[thread overview]
Message-ID: <5ee5b646.0201112056.2a9a2786@posting.google.com> (raw)
In-Reply-To: 3C3F4D9B.79019B90@spamcop.net

Wes Groleau <wesgroleau@spamcop.net> wrote in message news:<3C3F4D9B.79019B90@spamcop.net>...
> >      declare
> >          Const_X : constant Integer := X;
> >          -- invariant X
> >          Pos_Y : Positive := Y;
> >          -- ensure Y > 0
> >          -- invariant (Y > 0)
> >      begin
> >          loop
> >              ...
> >          end loop;
> >      end;
> 
> The "ensure" works, but not the "invariants."  Neither of those
> declarations prevents an assignment to X or Y.
> 
> I never saw the official proposal (if there was one) but
> I'd think it should be inside a subprogram:
> 
> pragma Require   ( condition );
> pragma Invariant ( condition );
> pragma Ensure    ( condition );
> 
> or after a subprogram declaration:
> 
> pragma Require   ( subprogram, condition );
> pragma Invariant ( subprogram, condition );
> pragma Ensure    ( subprogram, condition );
> 
> Rules of scope could be based on those of Eiffel, unless Eiffel
> experience has shown a need for modification.
> 
> Since they're pragmas, any vendor could try them out without
> affecting validation.


Probably more realistically, someone could implement these
in the FSF version of GNAT perhaps. I doubt any vendor is
likely to do work in this area, I certainly have not seen
any significant interest from any of our supported users
in such a feature.

Robert Dewar
Ada Core Technologies



  reply	other threads:[~2002-01-12  4:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-11  6:20 Assertions in the Next Ada Standard Richard Riehle
2002-01-11  9:23 ` Dale Stanbrough
2002-01-11 13:47   ` Robert A Duff
2002-01-11 23:28   ` Nick Roberts
2002-01-12  1:30     ` Darren New
2002-01-11 20:07 ` FGD
2002-01-11 20:39   ` Wes Groleau
2002-01-12  4:56     ` Robert Dewar [this message]
2002-01-12  7:30   ` Richard Riehle
2002-01-12 19:58     ` FGD
2002-01-12 21:27       ` Ed Falis
2002-01-12 22:45     ` Darren New
2002-01-14 17:20       ` Robert A Duff
2002-01-14 17:42         ` Darren New
2002-01-14 23:16     ` Mark Lundquist
2002-01-17  6:23     ` Richard Riehle
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox