comp.lang.ada
 help / color / mirror / Atom feed
From: FGD <presbeis@look.ca>
Subject: Re: Assertions in the Next Ada Standard
Date: Sat, 12 Jan 2002 14:58:32 -0500
Date: 2002-01-12T14:58:32-05:00	[thread overview]
Message-ID: <3C409568.4000102@look.ca> (raw)
In-Reply-To: 3C3FE630.BDB27416@adaworks.com

Ah! I see now that your proposal is deeper than what I originally 
thought it was. I see also that it does addresses some very real issues 
of Ada.

As you point out yourself, when it comes to incorporating them in the 
current Ada framework, invariants and pre-/post-conditions are quite 
different. Invariants are connected to types whereas conditions pertain 
to subprograms and their parameters. Consider dividing it in two related 
proposals to avoid opposition to one reject the other.

  Invariants constitute a "type improvement" as I would have said in my 
first reply. As such they are desirable, they provide a nice way of 
defining disconnected ranges and imposing constraints on type 
discriminants for example. Safety is an issue, but we know enough to 
work around it. The sublanguage of assertions should be constrained so 
that it cannot describe conditions which are not polytime---we know how 
to do that. More severe restrictions will probably be imposed, and very 
severe restrictions should apply if some kind of non-static assertions 
are to be allowed. Since the sublanguage of assertions should contain 
boolean variables and all propositional connectives, the problem of 
deciding whether or not a particular assertion is ever true is 
NP-complete. Thus one cannot reasonably expect compile time warnings for 
all such conditions. Some may object to that, but I consider this to be 
the programmer's problem.

 From my perspective, invariants have many merits. The most important is 
that it provides a uniform way of implementing all the type improvements 
I ever thought of in a uniform way. I'm still not sure about 
pre-/post-conditions. Right now, it seems to me that the associated 
complexities outnumber the benefits and I'm still curious about 
practical applications...

-- Frank




  reply	other threads:[~2002-01-12 19:58 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
2002-01-12  7:30   ` Richard Riehle
2002-01-12 19:58     ` FGD [this message]
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