comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Little people supporting Ada, possibly through AdaCore?
Date: Thu, 19 Jul 2012 16:05:21 +0200
Date: 2012-07-19T16:05:21+02:00	[thread overview]
Message-ID: <ryh5qlgsbyhm.hnpekwa4gkxx.dlg@40tude.net> (raw)
In-Reply-To: 5a2aec17-208f-4a9c-9894-79808a52938c@googlegroups.com

On Thu, 19 Jul 2012 05:42:19 -0700 (PDT), Maciej Sobczak wrote:

> W dniu czwartek, 19 lipca 2012 10:23:41 UTC+2 u�ytkownik Dmitry A. Kazakov napisa�:
> 
>> &gt;&gt; True. However a set of truly unordered elements cannot be implemented
>> &gt;&gt; otherwise than on top of an ordered set.
>> &gt; 
>> &gt; Why?
>> 
>> I guess it is related to computability.
> 
> Why? I see no relation. Or, to put it in more concrete terms - I don't
> care about implementation details; the purpose of abstraction is to be
> independent from them.

Yes, but that was not the point, which was that the underlying
implementation would need some ordered set and thus an ad-hoc order induced
by that.

The actual question was how to shape the interface of an unordered set so
that the clients could not exploit hidden order(s). As an example, maybe
not very good one, but anyway, consider sets of characters from ASCII,
EBCDIC. Let we wanted to prevent users to rely on ASCII'Succ ('I') = 'J',
because that might be untrue for EBCDIC. For example, should it be possible
to iterate elements in the set:

   for I in S'Range loop
       E := S (I);
   end loop;

or only this way:

   for E in S loop
       ... -- Unspecified order
   end loop;

or maybe there should be operations creating ordered snapshots of the
unordered original?

I think that unordered interfaces could be potentially useful for parallel
computing and very large [mutable/remote] sets, which could not be
iterated.

>> &gt; Membership test does not require any order.
>> 
>> You need to enumerate elements to be able to compute it.
> 
> No, you don't need to enumerate. If I remember correctly, the Pascal
> language provides sets as a language-level entity and membership test is
> commonly implemented as logical, bitwise operation. Now, you can argue
> that bitsets rely on some assumed ordering of implicitly assigned position
> numbers or whatever, but wait until I finish my hardware-based
> implementation of logical operations on bit-cubes. No ordering is
> required, it is just an artifact of our current, very limited hardware.

As I said, it is related to computability. You could have an "oracle"
telling if X is in S. "oracle" = incomputable by other means (i.e. by FSA).
But when computable, then ordered.

>> In that case you would need to
>> identify elements in the set in order to compare them with the testee. That
>> again would require some order.
> 
> No. Just wait until I finish my organic neural network, where sets are
> just implemented as multiple neurons connected to the owner, all triggered
> with the same signal. The membership test is O(1) and has nothing to do
> with enumeration (and therefore nothing to do with ordering).

You could simply say that the membership relation is implemented by an
incidence matrix, which is an equivalent to neurons wiring. But rows and
columns of the matrix are enumerated, that gives you an order.

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



  reply	other threads:[~2012-07-26 14:27 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04 13:26 Little people supporting Ada, possibly through AdaCore? Patrick
2012-05-04 14:36 ` Marc C
2012-07-16 15:47   ` Adrian Hoe
2012-07-16 18:13     ` Marc C
2012-07-17  1:58       ` Adrian Hoe
2012-07-17  6:00         ` Thomas Løcke
2012-07-17 13:47           ` Adrian Hoe
2012-07-17 15:06             ` Thomas Løcke
2012-07-18 13:33             ` Marc C
2012-07-18 17:14               ` Dmitry A. Kazakov
2012-07-18 17:49                 ` Simon Wright
2012-07-18 20:57                 ` Vasiliy Molostov
2012-07-19  8:08                   ` Dmitry A. Kazakov
2012-07-19 12:12                     ` Vasiliy Molostov
2012-07-19 13:22                       ` Georg Bauhaus
2012-07-21 17:01                         ` Vasiliy Molostov
2012-07-20  2:51                       ` Randy Brukardt
2012-07-21 17:04                         ` Vasiliy Molostov
2012-07-19  7:45                 ` Maciej Sobczak
2012-07-19  8:23                   ` Dmitry A. Kazakov
2012-07-19 12:42                     ` Maciej Sobczak
2012-07-19 14:05                       ` Dmitry A. Kazakov [this message]
2012-07-19  1:01             ` gautier_niouzes
2012-05-04 17:55 ` Manuel Gomez
2012-05-04 19:59   ` okellogg
2012-05-05 17:13     ` Simon Wright
2012-05-06 16:26       ` okellogg
2012-05-06 16:42         ` Yannick Duchêne (Hibou57)
2012-05-06 16:55           ` Simon Wright
2012-05-06 17:21             ` Yannick Duchêne (Hibou57)
2012-05-06 19:33               ` Simon Wright
2012-05-20 13:38         ` okellogg
2012-05-05 14:17   ` Marco
2012-05-06 13:01     ` Lucretia
2012-05-04 19:28 ` gautier_niouzes
2012-05-05 13:28   ` Pascal Obry
replies disabled

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