comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Surprise in array concatenation
Date: Sun, 4 Sep 2005 12:13:27 +0200
Date: 2005-09-04T12:12:53+02:00	[thread overview]
Message-ID: <9s72daxfzb4f.1k7noh1qr5qpg.dlg@40tude.net> (raw)
In-Reply-To: 431a00cb$0$2113$9b4e6d93@newsread2.arcor-online.net

On Sat, 03 Sep 2005 22:01:03 +0200, Georg Bauhaus wrote:

> Dmitry A. Kazakov wrote:
> 
>> C++. But *programming* in C++ is an immense problem. See any parallel?
> 
> Are you saying that C++ is less mathematical than Ada?

I'm saying that the source of C++'s problems is a less consistent,
careless, sometimes mindless design than Ada has.

>> What about zero radius? If you want to play a Luddite, then start with
>> prohibiting empty strings. Do a writer need empty texts?
> 
> Writers have used empty texts.

Does Amazon sell any empty books?

> Programmers frequently use empty strings, for I/O.

Then show me the "first character" printed! (:-))

>> Do computers something which cannot be described using
>> mathematics?
> 
> Yes, most real computers, if not all of them, cannot at all be shown to
> be a Turing machine equivalent.

Firstly, they can. You probably meant computer systems as whole
(+inputs/outputs.) It is not what usually called "computer".) Secondly,
mathematics does not end in Turing machines.

> We do not even know whether or not the
> world's most often sold CPU works properly, at least not in a
> mathematically satisfying sense ("yes" or "no").

It is a silly argument. Next time paying a fine, tell the officer that
because you cannot tell if traffic lights work properly, you can ignore
traffic regulations.

> Now think of the peripherals, etc.

See above.

> A real computer is a statistically
> reliable device, but you cannot mathematically show that your desktop
> computer does what we believe it does.

The probability theory is at your service.

But wait, should I understand the above as: Empty'First..Empty'First-1 is
correct, because Empty might be random? Come on! (:-))
 
>> That is not what you are saying. Then what?
> 
> Another problem with computer mathematics is that it largely neglects
> continuous time, and bare I/O operations.

You should address that to CS which is only a stepdaughter of mathematics.
Then the problem is not in which part of mathematics one would apply. The
problem is that you seem to reject mathematics (and logic) as a tool,
proposing nothing instead. The language should be consistent, there is no
doubt about it.

> Time is transformed into
> ticks, I/O is reduced to 'Valid plus compiler magic built on top of
> OS routines which mostly work - for whatever reason.
> Who can show, in mathematically sufficient detail, the way of
> some bits generated by a partition running on computer A sent
> to a partition running on computer B? (Who *wants* to do this? :)

Huh, who can solve Maxwell's equations for a TV set? Does it mean that you
can create one ignoring laws of physics?

> This requires statistics, rules of thumb, and experiments.

I.e. random empty strings...

>> A trivial analysis shows inconsistency of A'First..A'First-1.
> 
> The inconsistency of A'First..A'First - 1, if any, is relative
> to a set of definitions.

Yep, like:

1. "any unconstrained array type shall have empty instances"
2. "any array instance contain its lower and upper bound"

> It seem that off-bounds indices are a ubiquituous feature, found in
> several programming languages' algorithms and data structures.

Re-read what you wrote: an off-bound [array] index is an array bound! Is it
"off" or not? (:-))

> The indices avoid, for one thing, a proliferation of conditionals like
>   if x'length = 0 then ... else perform(...) end if;
> Without the special test, you can unconditionally say
> 
>   forall things in x | P ...

Absolutely! And Ada has this construct:

   for I in P'Range loop
      x := P (I);
      ... -- do something with x

It would be nice if Ada would support abstract iterations like:

   for x in P loop
      ... -- do something with x

Better ADT is what Ada needs.

> or
> 
>   as-soon-as cursor is off things in x | P ...

No! This is an extremely bad idea borrowed for C pointer arithmetic. It
presumes that cursor might be off. It is a very strong assumption, which
may have a great impact on the algorithm:

1. The cursor have to have "off" values. Consider the type Character,
you'll need to extend it with two values, left and right. Presently Ada
does not support this. And if it did, then it would require another
representation for extended Character with conversions forth and back all
the way. An alternative? Well, remember C's nul-terminated strings? Do you
enjoy them?

2. There should be a way to construct off-values. That might be very
non-trivial. Example: pointers. Try to find a pointer that does not point
to some object. You have to undertake some actions to ease it. For example
to reserve null with the *distributed* overhead of testing for "null"
throughout the program.

3. As I said before, you have a distributed overhead of distinguishing two
sorts of cursors. That would make optimization difficult. It is a halting
problem to determine if a cursor is off.

> Something that I think is frequently found in math literature ;-)

I'm not a mathematician, so I cannot tell. But I think that the set theory
explicitly forbids unbound quantifiers, which would otherwise refer to the
set of "all things" (an equivalent of "off-set" thing.) It is no-no.

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



  reply	other threads:[~2005-09-04 10:13 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-01  3:16 Surprise in array concatenation Gene
2005-09-01  7:55 ` Dmitry A. Kazakov
2005-09-01  8:02   ` Florian Weimer
2005-09-01 11:48     ` Georg Bauhaus
2005-09-01 12:02       ` Lutz Donnerhacke
2005-09-01 13:01         ` Georg Bauhaus
2005-09-01 15:54       ` Florian Weimer
2005-09-01 16:09     ` Robert A Duff
2005-09-05  8:38       ` Jean-Pierre Rosen
2005-09-05 23:52         ` Robert A Duff
2005-09-06  9:03           ` Jean-Pierre Rosen
2005-09-07 17:57         ` adaworks
2005-09-07 20:01           ` Robert A Duff
2005-09-08  8:08             ` Jacob Sparre Andersen
2005-09-07 22:46           ` Jeffrey Carter
2005-09-08  4:43             ` Simon Wright
2005-09-08 10:36               ` Georg Bauhaus
2005-09-08 13:47                 ` Ed Falis
2005-09-08 17:03                   ` Pascal Obry
2005-09-08 16:45               ` Jeffrey Carter
2005-09-08 19:37                 ` Simon Wright
2005-09-08  6:32             ` adaworks
2005-09-08  9:09               ` Jean-Pierre Rosen
2005-09-08 16:56               ` Jeffrey Carter
2005-09-09 14:04                 ` Bob Spooner
2005-09-09 16:17                 ` adaworks
2005-09-23 23:04               ` Randy Brukardt
2005-09-14  8:57           ` Ole-Hjalmar Kristensen
2005-09-23 23:09           ` Randy Brukardt
2005-09-24 10:49             ` Larry Kilgallen
2005-09-24 20:27             ` Lurker
2005-09-25  0:20             ` Robert A Duff
2005-09-25 17:05             ` adaworks
2005-09-01 11:42   ` Georg Bauhaus
2005-09-01 13:59     ` Dmitry A. Kazakov
2005-09-01 15:36       ` Georg Bauhaus
2005-09-01 18:34         ` Dmitry A. Kazakov
2005-09-02 10:43           ` Georg Bauhaus
2005-09-02 13:11             ` Dmitry A. Kazakov
2005-09-02 14:23               ` Georg Bauhaus
2005-09-02 19:48                 ` Dmitry A. Kazakov
2005-09-02 17:21           ` Björn Persson
2005-09-01 16:04   ` Robert A Duff
2005-09-01 18:06     ` Dmitry A. Kazakov
2005-09-02 10:42       ` Georg Bauhaus
2005-09-02 13:20         ` Dmitry A. Kazakov
2005-09-02 14:14           ` Georg Bauhaus
2005-09-02 19:48             ` Dmitry A. Kazakov
2005-09-03 20:01               ` Georg Bauhaus
2005-09-04 10:13                 ` Dmitry A. Kazakov [this message]
2005-09-05 13:22                   ` Georg Bauhaus
2005-09-05 15:50                     ` Dmitry A. Kazakov
2005-09-05 18:20                       ` Georg Bauhaus
2005-09-05 18:31                         ` Georg Bauhaus
2005-09-06  8:20                         ` Dmitry A. Kazakov
2005-09-06 11:52                           ` Georg Bauhaus
2005-09-06 13:46                             ` Dmitry A. Kazakov
2005-09-06 15:51                               ` Georg Bauhaus
2005-09-06 21:32                                 ` Robert A Duff
2005-09-07  9:08                                 ` Dmitry A. Kazakov
2005-09-07 18:20                                   ` Georg Bauhaus
2005-09-07 19:07                                     ` Georg Bauhaus
2005-09-07 21:23                                     ` Dmitry A. Kazakov
2005-09-08 10:27                                       ` Georg Bauhaus
2005-09-08 11:39                                         ` Georg Bauhaus
2005-09-08 13:44                                         ` Dmitry A. Kazakov
2005-09-08 18:18                                           ` Georg Bauhaus
2005-09-09 10:06                                             ` Dmitry A. Kazakov
2005-09-09 12:26                                               ` Georg Bauhaus
2005-09-09 12:29                                               ` Georg Bauhaus
2005-09-01  8:48 ` Jean-Pierre Rosen
2005-09-01 15:57 ` Robert A Duff
2005-09-01 21:42   ` Gene
2005-09-01 22:56     ` tmoran
2005-09-05 15:53       ` Gene
2005-09-05 17:47         ` jimmaureenrogers
2005-09-05 22:13           ` Robert A Duff
2005-09-06  8:24             ` Dmitry A. Kazakov
2005-09-05 19:22         ` Jeffrey R. Carter
2005-09-05 21:54           ` Robert A Duff
2005-09-05 22:50             ` Larry Kilgallen
2005-09-05 23:46               ` Robert A Duff
2005-09-12  3:59                 ` Dave Thompson
2005-09-06 16:02             ` Jeffrey Carter
2005-09-06 21:00               ` Robert A Duff
2005-09-06  5:38         ` Pascal Obry
2005-09-05 21:48       ` Robert A Duff
2005-09-06  5:25         ` tmoran
2005-09-06 14:58           ` Robert A Duff
2005-09-06  9:26         ` Georg Bauhaus
2005-09-06 15:00           ` Robert A Duff
2005-09-07 11:02             ` Thierry Pirot
2005-09-07 20:09               ` Robert A Duff
2005-09-06 13:22         ` Bob Spooner
2005-09-06 15:30           ` Robert A Duff
2005-09-06 16:12             ` Jeffrey Carter
2005-09-06 21:21               ` Robert A Duff
2005-09-02 20:19     ` Jeffrey R. Carter
2005-09-03 12:51     ` Dr. Adrian Wrigley
2005-09-03 14:08       ` Jacob Sparre Andersen
2005-09-05  8:34         ` Jean-Pierre Rosen
2005-09-05  9:32           ` Arrays indexed by fixed point types (Was: Surprise in array concatenation) Jacob Sparre Andersen
2005-09-05 11:07             ` Jean-Pierre Rosen
2005-09-05 15:12               ` Dr. Adrian Wrigley
2005-09-05 12:14             ` Dmitry A. Kazakov
2005-09-05 13:07               ` Jacob Sparre Andersen
2005-09-05 15:10                 ` Dmitry A. Kazakov
2005-09-05 11:29           ` Surprise in array concatenation Dr. Adrian Wrigley
replies disabled

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