anything like C++ references?

Stephen Horne intentionally at blank.co.uk
Mon Jul 14 22:45:05 EDT 2003


On Mon, 14 Jul 2003 18:07:57 -0700, Erik Max Francis <max at alcyone.com>
wrote:

>Stephen Horne wrote:
>
>> 99 out of 100 times, true. But not always - especially in discrete
>> maths.
>> 
>> For example, if I write...
>> 
>>   [forall] x . f(x) = y
>> 
>> It's hard to interpret that '=' as an assertion. Similar applies to a
>> range of maths operators.
>
>How is that not an assertion, anymore than
>
>	[exists] x [~ (x = y)]

The '=' isn't an assertion here. The '[exists]' is an assertion - it
asserts that there exists an value x for which [~ (x = y)] evaluates
to true. Note the use of the boolean 'not' operator (which you
represented using '~'. The boolean 'not' operator returns a value -
either 'true' or 'false'. It doesn't assert anything except in the
context of the whole expression.

If I wrote...

  z = [exists] x [~ (x = y)]

Things become even more clear. The '[exists]' part is no longer an
assertion any more than '1+2' is an assertion. It is an expression
returning a boolean result.

>I don't mean this as an insult, but it seems to me that much of your
>comments on Python in these threads come down to, "The way this works is
>not something I would have given this name to."  While that's completely
>legitimate, it's hard to see it as very compelling, since your
>distinctions seem to me to be fairly arbitrary (x = y is assertion but
>ALL x [f(x) = y] isn't?).

Not at all.

If I write...

  x = 1

...that is an assertion.

If I write...

  ALL x [f(x) = y]

...that is also an assertion - but the role of the '=' operator is
simply to return a boolean result. It can't form an assertion on its
own because it is only a part of the expression. There is no such
thing as a 'subassertion' - an assertion is an indivisible thing. A
subexpression from the overall assertion, out of context, does not
usefully assert anything.

The '=' operator plays the same role as the '+' operator in the
following...

  ALL x [f(x) + g(x) = 0]

The '=' operator contributes to the expression because it returns a
value - exactly the same as the '+' operator.





More information about the Python-list mailing list