comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Quantified expressions: no support for restriction predicates
Date: Sun, 29 Apr 2012 10:03:50 -0400
Date: 2012-04-29T10:03:50-04:00	[thread overview]
Message-ID: <wcc62cihby1.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 796413.773.1335612600942.JavaMail.geo-discussion-forums@vbai3

phil.clayton@lineone.net writes:

> Drat.  I knew about the parentheses.  (Personally, I would have liked
> parentheses to be required only when there is a syntactic ambiguity.
> I suppose that is so often, you may as well have them all the time.)

Note that you don't need "extra" parentheses.
You can say "F(for all ...)" instead of "F((for all ...))".

> I think "if P then Q", i.e. implicit "else true", is a really neat way
> to provide implies.

Me, too.  I argued strongly for adding an "implies" operator,
but I discovered that a lot of folks are confused by it,
yet find (if P then Q) crystal clear.  So I changed my mind.

> Honestly, my motivation was to help those who were a little rusty on
> their maths/logic!

Sure.

> My thinking is that having a predicate to restrict the elements that
> one is quantifying over (just like a subtype predicate restricts the
> elements of a subtype) would avoid the need to work out the equivalent
> logical expression, which differs depending on the quantifier - a
> likely source of error.  So, while more syntax would be needed, this
> should actually simplify quantification concepts.

Well, if you are willing to give a name to the subtype, you
can put a Static_Predicate or Dynamic_Predicate aspect on it.
Does that help?

- Bob



  reply	other threads:[~2012-04-29 14:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27  0:29 Quantified expressions: no support for restriction predicates phil.clayton
2012-04-27 23:43 ` Randy Brukardt
2012-04-28 11:30   ` phil.clayton
2012-04-29 14:03     ` Robert A Duff [this message]
2012-04-29 18:37       ` phil.clayton
2012-04-29 19:35         ` Robert A Duff
2012-05-01  2:48           ` Randy Brukardt
2012-05-01 11:35           ` phil.clayton
2012-04-30 15:57     ` Adam Beneschan
2012-05-01 11:14       ` phil.clayton
replies disabled

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