comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Meaning of “contractual” according to Ada
Date: Wed, 06 Mar 2013 17:35:54 -0500
Date: 2013-03-06T17:35:54-05:00	[thread overview]
Message-ID: <wcc38w840mt.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: op.wtjenykuule2fv@cardamome

"Yannick DuchÔøΩne (Hibou57)" <yannick_duchene@yahoo.fr> writes:

> Because naming and wording matters, especially with Ada :-P , I have
> this  question.
>
> http://www.ada-auth.org/standards/12rat/html/Rat12-2-5.html
> Says:
>> These are not really contractual in the sense thatpreconditions,
>> postconditions and invariants arecontractual but are more akin to
>> constraints.
>
> What's not contractual with subtype predicates? And so what does
> ÔøΩcontractualÔøΩ means exactly for Ada's definition authors?

There's no Ada-specific meaning for "contractual".  You are quoting
the Rationale, not the RM.  ;-)

If you have a formal parameter of subtype T, then T's predicate
forms part of the contract between the procedure body and its
callers.  So does T's constraint.  So I'd say predicates and
constraints are "contractual" in that sense.

I think what John means is that predicates (like constraints)
can be used in cases like "X := Y + 1;" where there's no
clear boundary between abstractions, with a contract between
those abstractions.  It's just checking that Y+1 obeys the
constraints and predicates of X.

John is right that predicates are like constraints.  In fact,
if I could turn back the clock, I'd get rid of constraints,
and just use predicates.  And I'd call them "invariants".

We've got a bit of a mess:  5 or 6 kinds of constraint, "not null",
predicates, and invariants, all of which are basically the same
thing, with differences in minor details.  I'd prefer a language
design that unified all those things.

- Bob



  reply	other threads:[~2013-03-06 22:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-06 18:22 Meaning of “contractual” according to Ada Yannick Duchêne (Hibou57)
2013-03-06 22:35 ` Robert A Duff [this message]
2013-03-07  1:20   ` Yannick Duchêne (Hibou57)
2013-03-07  2:57     ` Meaning of "contractual" " Randy Brukardt
2013-03-07  9:27     ` Meaning of “contractual” " Dmitry A. Kazakov
replies disabled

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