comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada2012 Invariants and obaque types
Date: Tue, 21 Jun 2011 16:42:05 +0200
Date: 2011-06-21T16:42:05+02:00	[thread overview]
Message-ID: <eei5xbzqtzsb$.stapkog8qsg0.dlg@40tude.net> (raw)
In-Reply-To: 4e009cb2$0$6582$9b4e6d93@newsspool3.arcor-online.net

On Tue, 21 Jun 2011 15:29:22 +0200, Georg Bauhaus wrote:

> On 21.06.11 14:31, Dmitry A. Kazakov wrote:
> 
>>> In another theory, the invariant may express things
>>> such as
>>>  Num_Green_Lights (T1) >= 3;
>>> or
>>> 'Length < State_of_Things (T1) * 2;
>>> where Num_Green_Lights is a publicly visible function whose
>>> result is somehow computed.  These predicates would be informative,
>>> and formal.
>> 
>> That is not an invariant, but a constraint.
> 
> I don't see bounds in the above.

Constraint could be any, not only bounds. It is not the formula, but the
meaning of:

   S = { x | x in T and P (x) }

here P is a constraint, which produces S.

   x in S => Q (x)

here Q is an invariant of S. It might happen that Q (x) <=> P (x). Then you
could define S using Q, that would make Q constraint and P invariant.

> That is, if the (theoretical) assertion is "at least,
> no matter what, under all circumstances, in each implementation",
> isn't this an invariant?

1. Different implementations of the same specification may have different
invariants. That are the predicates which cannot be derived from the
specification.

2. When a predicate can be derived from the specification that does not yet
imply its equivalence to the specification. Invariant does not necessarily
defines the type.

3. The difference is the intent. The specification defines the [sub]type.
Invariant merely is a predicate provable true for the given implementation
of the specification. (Properly constructed invariants can be used in
construction of implementations, e.g. Dijkstra's approach to programming,
loop invariants etc)

4. You cannot distinguish predicates used in definitions from ones used in
proofs by just looking at them. It is the language's task to do this by
syntax means.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2011-06-21 14:42 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-21  8:53 Ada2012 Invariants and obaque types Martin
2011-06-21 10:27 ` Yannick Duchêne (Hibou57)
2011-06-21 10:36   ` Martin
2011-06-21 10:46   ` Martin
2011-06-21 18:42     ` Yannick Duchêne (Hibou57)
2011-06-21 10:43 ` Ludovic Brenta
2011-06-21 10:53   ` Martin
2011-06-21 11:14 ` Martin
2011-06-21 11:31 ` Robert A Duff
2011-06-21 11:48   ` Martin
2011-06-21 12:01   ` Martin
2011-06-21 12:13     ` Robert A Duff
2011-06-21 12:22       ` Martin
2011-06-21 12:54         ` Robert A Duff
2011-06-21 13:00           ` Martin
2011-06-21 12:08 ` Dmitry A. Kazakov
2011-06-21 12:17   ` Georg Bauhaus
2011-06-21 12:31     ` Dmitry A. Kazakov
2011-06-21 13:29       ` Georg Bauhaus
2011-06-21 14:42         ` Dmitry A. Kazakov [this message]
2011-06-21 18:37   ` Yannick Duchêne (Hibou57)
2011-06-21 18:53     ` Dmitry A. Kazakov
2011-06-21 19:34       ` Vinzent Hoefler
2011-06-21 20:52         ` Dmitry A. Kazakov
2011-06-21 21:50           ` Vinzent Hoefler
2011-06-22  7:55             ` Dmitry A. Kazakov
2011-06-21 21:18       ` Manuel Collado
2011-06-22  8:00         ` Dmitry A. Kazakov
2011-06-22 10:39 ` Egil Høvik
2011-06-22 13:57   ` Martin
2011-06-23 16:21 ` anon
replies disabled

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