From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: What about a Static_Assertion?
Date: Tue, 23 Jul 2013 22:13:15 +0200
Date: 2013-07-23T22:13:15+02:00 [thread overview]
Message-ID: <1lweclh4w5alc.t5jnwoiohwqw.dlg@40tude.net> (raw)
In-Reply-To: op.w0ouxfh7ule2fv@cardamome
On Tue, 23 Jul 2013 20:57:05 +0200, Yannick Duchêne (Hibou57) wrote:
> Le Tue, 23 Jul 2013 20:43:19 +0200, Dmitry A. Kazakov
> <mailbox@dmitry-kazakov.de> a écrit:
>
>> On Tue, 23 Jul 2013 20:07:54 +0200, Yannick Duchêne (Hibou57) wrote:
>>
>>> Don't you believe it would be great to have static assertion just like
>>> we have static predicates?
>>
>> What is the difference between assertion and precondition or invariant?
>
> An assertion may applies to multiple things at a time. I like to see an
> assertion as hypothesis (and I prefer the hypothesis to be statically
> checkable :-P ), and it is an hypothesis I may refer to from multiple
> place in a package (although I may like to duplicate it in multiple case),
> not from a single sub‑program.
This does not make any sense. Provided we are talking about static things,
they by definition hold to the program as a whole.
> By the way, I don't believe assertions are seen as a deprecated feature,
> and that suggest from many one's eyes, it is indeed different and can't be
> replaced by the actual predicates.
Predicate by definition is a Boolean expression.
http://en.wikipedia.org/wiki/Predicate_%28mathematical_logic%29
Assertion, precondition, postcondition, invariant are all predicates. What
Ada 2012 calls "static predicate" is also a predicate.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2013-07-23 20:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 18:07 What about a Static_Assertion? Yannick Duchêne (Hibou57)
2013-07-23 18:43 ` Dmitry A. Kazakov
2013-07-23 18:57 ` Yannick Duchêne (Hibou57)
2013-07-23 20:13 ` Dmitry A. Kazakov [this message]
2013-07-23 21:46 ` Georg Bauhaus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox