From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5c89acd494ea9116 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 05 Sep 2007 12:49:39 +0200 From: Georg Bauhaus Organization: # User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Self pointer in limited record References: <1183577468.034566.57830@n60g2000hse.googlegroups.com> <1188578849.187422.280620@50g2000hsm.googlegroups.com> <9fy1xoukz1e3$.h574sqmiauri$.dlg@40tude.net> <46d968ee$0$30368$9b4e6d93@newsspool4.arcor-online.net> <137iu0lr82dtb$.wqy3zjz2vr9q.dlg@40tude.net> <46d972e8$0$30384$9b4e6d93@newsspool4.arcor-online.net> <1alyfwaig93sk$.99oy269uon$.dlg@40tude.net> <46d9c138$0$4531$9b4e6d93@newsspool3.arcor-online.net> <1rt8kdcrj6tf.1qgvycc6vh357$.dlg@40tude.net> <46db2bf4$0$7699$9b4e6d93@newsspool2.arcor-online.net> <1188816674.2630.25.camel@kartoffel.vocalweb.de> <9cdmw7k85sey.85sb2t1bjefy$.dlg@40tude.net> <1mbajw59c3eir.jyl8bdp6qvj8.dlg@40tude.net> <1188850449.2630.60.camel@kartoffel.vocalweb.de> <1aza6nzawgcnm.sf76q4dvzw4n$.dlg@40tude.net> In-Reply-To: <1aza6nzawgcnm.sf76q4dvzw4n$.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <46de8897$0$16115$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Date: 05 Sep 2007 12:44:39 CEST NNTP-Posting-Host: 6ed99e2f.newsspool1.arcor-online.net X-Trace: DXC=4OjNQ[6U33f<6cDJZfMd_cic==]BZ:afn4Fo<]lROoRa4nDHegD_]ReWholfdh=jncA:ho7QcPOVc=HST=HBK_of0m2PBoP_nXk X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:1750 Date: 2007-09-05T12:44:39+02:00 List-Id: Dmitry A. Kazakov wrote: > On Mon, 03 Sep 2007 22:14:09 +0200, Georg Bauhaus wrote: > What could be an abstraction of Spike, the dog? >> (Hope you don't mind be stepping in here.) >> >> The abstraction could be: Those elements of Spike that are relevant >> for the given point of view on Spike? > > "Elements of Spike" is plural. Do you abstract Spike or its elements? The Abstraction and its (human) process will likely depend on the given point of view. The problem description might suggest a point of view. E.g., I might not care whether there is a knot in Spike's fur down one of its legs. I do care that this is Spike, the dog and not Odie or Lassie, so abstraction cannot just be "dog". Abstraction as a process can be fuzzy, I known you are familiar with that? >> I wonder, though, why then we can still talk about abstract data >> type and abstract state machine. > > Abstract data type is an abstraction of concrete data types. > > Abstract state machine is an abstraction of concrete state machines. OK, another interesting definition that refers us to the definition of a concrete state machine which I am certain is equally interesting, even though it is not given. However, there are other definition of ASM related to Ada. Let me drop some names to show why it might help communication if you find your own words for your own concepts. The following quotes can be merged into a view of packages as abstract state machines that is so common that any other implied meaning might unfortunately receive limited attention. Barnes, SPARK, 1997 describing an "abstract data type package" Stacks and then noting: "An Abstract State Machine (ASM) is a related concept and is implemented in much the same way. The major difference is that whereas an abstract data type package gives the ability to declare objects and then to operate upon them, an abstract state machine package declares just one object for us and the operations upon it. The package is then itself essentially the object and has internal `state' or `memory' containing the current value of the object." (p. 21) => ASM package is an object that has internal state The same author gives more hints in "Ada 2005", 2006: "... we introduce the concept of an Abstract State Machine (ASM) and ... extend this to Abstract Data Types (ADT). The general idea of abstraction is to distinguish the inner details of how something works from an external view of it. We can use a watch to look at the time without needing to know how it works. Indeed the case of the watch hides its inner workings from us. One of the major problems with simple languages, such as C and Pascal, is that they do not offer enough control of visibility." (p. 215) => external [public| view of hidden [body] inner workings, in a case [package] Cohen, in Ada as a Second Language, 1996, gives it the name "abstract data object". It is described as "use of packages ... to enclose a set of variables and a set of subprograms using those variables". (p 417) He describes a package that is declared in another package body and notes "complete control over the ways in which the variables are used" (p.417) => packages control use of the data object; can be declared local to other blocks; control visibility Not surprisingly, Booch in "Software Engineering with Ada", 1994 has written more than one section on Abstract Data Types and on Abstrace-State Machines. Note the hyphen (mentioned by J-P. Rosen I think). They are listed as two applications for Ada packages (p.227): "* Abstract data types Export objects and types Export other program units Do not maintain state information in the body * Abstract-state machines Do not export objects and types Export other program units Maintain state information in the body" He later describes generic units and "classical models for applying generic units". One application is "using generic units as state machine templates". A simple abstract-state machine package has a limitation in that "a program could include at most one .., since packages cannot be replicated like data type values can. By making the package [Furnace] into a generic unit, we can produce multiple furnaces." (pp. 255--256) => abstract-state machine packages can be generic There are other sources, not dealing with Ada specifically, but mentioning the use of Ada packages for this. >>> In my view an abstract state machine has nothing to do with singletons. A >>> state machine might be a singleton, per chance. >> Could you say what you mean by "having nothing to do with"? > > Let A, B be two concepts defined as subsets of some common domain set X. > > _def_ A has nothing to do with B = not (A in B or B in A) > > in = equal or subset of > > if � were a truth-valued set measure chosen on X, then having �A you could > not deduce anything certain about �B and reverse: > > not (�A |= �B or �B |= �A) > > Neither implies another. > > Was that enough pedantic? (:-)) Now tell us what the common domain set X for concept ASM and concept SINGLETON is, and the subsets ASM and SINGLETON. Then please explain why I cannot use packages for both ASM and SINGLETON in Ada, as they have nothing in common (or something per chance, only?). This is, then, what ASM has to do or not with SINGLETON when using Ada, at least if this is about Ada and mapping concepts from some commonly accepted X to Ada concepts. >>> But an *abstract* state >>> machine is definitely a type that generalizes many concrete state machines. >> By what definition of type is an ASM a type that generalizes many >> concrete state machines (=what, in Ada terms?)? > > type State is (...); > type Transition_Relation is array (State, State) of Boolean; > type ASM is private; > function Create (Initial : State; Wiring : Transition_Relation) > return ASM; > procedure Step (Machine : in out ASM; Input : State); > > This machine is abstract because its wiring is a parameter (abstracted). Hm. A singular parameter as a source of abstraction ... not a plural ... > The set of states can also be abstracted, but I wished not to complicate > otherwise obvious, I hope, things. This kind of word play leads nowhere, because it stipulates the one and only true meaning of the words abstract state machine (probably an ADT for abstract state-machine) and the one and only true way to implement it.