Mailing List Archive: 49091 messages

# Rebol values (continuing the discusion)

### [1/11] from: lmecir::mbox::vol::cz at: 18-Apr-2005 6:39

Hi,
>DISCLAIMER: If you do not want to be confused about Rebol language, stop >reading at this point or continue at your own risk. >
The most useful informations (IMO) are the points 1 to 3 below: 1) The confusion already exists, because some statements heavily depend on the chosen terminology and both terminologies are used on this ML. 2) There is one practical difference I want to underline: The "implementation-dependent terminology" tries to describe the properties of "just one implementation". There is at least one implementation, for which almost every property described this way is wrong, while the implementation-independent description remains correct. 3) The article: http://www.fm.vslib.cz/~ladislav/rebol/identity.html uses the implementation independent terminology and contains my answer to: "What are Rebol values?" question as well as the complete proof that The sameness of Rebol values doesn't depend on implementation. 4) now to discuss Romano's points: ....
>So i must conclude that "1 is equal to every other 1" only in an human >head, not in the real world >
.... :-) ...
>My thesis: "Rebol number are not mathematical number" > >The proof: > >x: 1 / 2e305 ;== 5E-306 >x = 0 ;== false >y: x + 1 - 1 ;== 0.0 >y = 0 ;== true >
There are two ways to prove you wrong. The first one is "oversimplified" and uses an implementation dependent (i.e. wrong) type of reasoning: There are at least two implementations of Rebol numbers in computers. The first one is little-endian and the second one is big-endian. Therefore your above statement has got no sense without saying which implementation you have got in mind. This is the reason why I put the smile above. Now a serious (and lengthy) one: Let's define a subset of all real numbers as follows: a real number X is an IEEE754 number if X is either 0 or if there is a real number S called sign, a real number M called significand and a real number E called exponent such that X = S * M * (2 ** E), where E is an integer number such that -1023 <= E <= 1022 , S is either 1 or -1 and M is a real number such that there is 52-element sequence of binary digits (0 or 1, bits for short) b1,b2,..., b52, such that M = 1 + (b1 / (2 ** 1)) + (b2 / (2 ** 2)) + ... + (b52 / (2 ** 52)). Note: all operations in the above definition are "normal" "mathematical" operations as defined for real numbers. Now let's define an IEEE754-round function "working" on a subset of real numbers as follows: - for X >= ((2 ** 1022) * (2 - (2 ** -52) + (2 ** -53))) the IEEE754-round function isn't defined - for 0 <= X < (2 ** -1023) we define that IEEE754-round X will be zero - for (2 ** -1023) <= X < ((2 ** 1022) * (2 - (2 ** -52) + (2 ** -53))) IEEE754-round X will be the maximal of all IEEE754 numbers Z such that abs(X - Z) <= abs (X - U) for every IEEE754 number U. - similarly for negative values X. As the last step let's define IEEE754+, IEEE754-, IEEE754/ as follows: IEEE754+ (X,Y) = IEEE754-round (X + Y), etc. Now we see this: i) IEEE754 numbers *are* real numbers (we defined them that way). ii) the IEEE754+, IEEE754- and IEEE754/ operators "exhibit" the behaviour you described above.
>You could answer that the different behaviour of Rebol number is only an >implementation detail, > >but if this is true, it is also true that >decimal! are the same of integer! (the difference is only an >implementation detail) >
There is exactly the same situation in mathematics too - cf. construction of the natural numbers in the ZF set theory, the construction of integers, the "construction" of rationals and the construction of reals. The "original" integers "created" this way aren't set-theoretically identical with "rational integers" or with real integers .
> and that Java number, Visual Basic number, and C >number are the same (the difference are only implementation details), so >the is no real difference between this languages and Rebol about number. >
Actually, there is a lower difference between a double precision C number and a Rebol decimal! number on a PC than between two Rebol representations of 1.0 on computers with different endianness, but it doesn't matter when we are describing the sameness of Rebol numbers as I dared to point out.
>Well if you think as this, you should also agree on these thesis: >Two strings in Rebol can be the same or cannot be the same.
<<quoted lines omitted: 3>>
>But in my head the word "house" is only one, so this behaviour is >implementation-dependent.
See http://www.fm.vslib.cz/~ladislav/rebol/identity.html for complete (and implementation independent) description of Rebol properties with respect to this subject. One point still remains to be made: There is not a complete counterpart of the above article written in an implementation dependent style and there never will be such a counterpart, because the implementation dependent terminology is intrinsically inconsistent. A notion: "distinct but identical" illustrates well the trouble one gets into when using it. -L

### [2/11] from: gabriele::colellachiara::com at: 18-Apr-2005 12:52

Hi Ladislav, On Monday, April 18, 2005, 6:39:24 AM, you wrote: LM> There are two ways to prove you wrong. The first one is "oversimplified" LM> and uses an implementation dependent (i.e. wrong) type of reasoning: I'd just point out that you are still referring to the numbers, not their representation. So, as long as only one "1" exists, there still can be many representation of that one "1". REBOL integers are not numbers, but representation of numbers. So we can discuss of the numbers themselves, as you do, or we can discuss about their representations, as I did. I don't think one discussion should be considered "more true" ;-) than the other. LM> There is not a complete counterpart of the above article written in an LM> "implementation dependent" style and there never will be such a LM> counterpart, because the implementation dependent terminology is LM> intrinsically inconsistent. A notion: "distinct but identical" LM> illustrates well the trouble one gets into when using it. This problem goes away as soon as you say "two distinct representations of the same value". In the same way as you can consider that two strings can be not the same string even if they are equal, because they are two distinct representations of the same string. I agree that an "abstract", i.e. implementation-independent, description of REBOL is useful; however, only Carl could really provide us with something like that. Our conclusions are only based on the implementation, and other implementations are based on the conclusions we made on RT's implementation. Also, there are a number of issues that are interesting and that an implementation-independent description does not cover, such as how much memory does the block [1 1 1] consume? . Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/

### [3/11] from: lmecir:mbox:vol:cz at: 18-Apr-2005 18:26

Gabriele Santilli napsal(a):
>I'd just point out that you are still referring to the numbers, >not their representation. So, as long as only one "1" exists, >there still can be many representation of that one "1". >
Yes.
> REBOL >integers are not numbers, but representation of numbers. >
The same could have been said in mathematics too as my previous post was pointing out - see e.g. pairs of integers as models of rationals. It is quite hard to "invent" a representation of rational number not having the "ambiguity" property, because e.g. 1 / 3 can be represented as 2 / 6, 3 / 9 etc. IOW, when we have got a representation, it is time to "forget" about it and to try to describe the properties that do *not* depend on the representation. Some properties become "accessible" if we "forget" the details. (It is not obvious why this is true.) One case illustrating failure to do so in Rebol is the sentence: ...Returns TRUE if the values are identical objects, not just in value. For example, a TRUE would be returned if two strings are the same string (occupy the same location in memory)..." This is plain wrong mainly because it didn't "forget" implementation details. "...values are identical objects, not just in value..." shows the confusion.
>I don't think one discussion should be considered "more true" ;-) >than the other. >
Would you consider it right to say that 1 / 3 and 2 / 6 are two distinct but identical rational numbers? (This surely has got some "rational" core, because set-theoretically these *are* two distinct representations of one rational number). BTW, unique (also normalized) representations may be "unsuitable" sometimes - see e.g. the case of BCD numbers, where an "unnormalized" (1.00) representation may carry additional useful information, which isn't "present" in the normalized (1.0) one. Anyway, a question "Which look suits better a particular purpose?" is legitimate. I am not saying there aren't purposes needing "specific details". But even in that case the "normal" look is, that although there are many distinct representations of one rational number, the rational number in question is just one rational number. The translation to Rebol value case is straightforward and is done by you below:
>LM> There is not a complete counterpart of the above article written in an >LM> "implementation dependent" style and there never will be such a
<<quoted lines omitted: 3>>
>This problem goes away as soon as you say "two distinct >representations of the same value".
Yes! That is what I am trying to say all the time! "Two distinct representations of the same value" is it.
>I agree that an "abstract", i.e. implementation-independent, >description of REBOL is useful; however, only Carl could really >provide us with something like that. >
I have shown above, that in a specific case he didn't succeed to do it just because he didn't "forget enough implementation details". Moreover, my article inspired his short Same? function description, see the evolution of the Same? function help. This proves (for me at least) that the last statement needn't always be true. -L

### [4/11] from: gabriele::colellachiara::com at: 19-Apr-2005 17:57

Hi Ladislav, On Monday, April 18, 2005, 6:26:01 PM, you wrote: LM> IOW, when we have got a representation, it is time to "forget" about it LM> and to try to describe the properties that do *not* depend on the LM> representation. Some properties become "accessible" if we "forget" the LM> details. (It is not obvious why this is true.) Sure. And, there's space for discussing the representation too, sometimes. The reason why some of us here tend to spend more time discussing the representation instead of the number is that we're more interested in REBOL than in math. ;-) But, you're right that we shouldn't confuse the two things, and probably I did sometimes. LM> Would you consider it right to say that 1 / 3 and 2 / 6 are two distinct LM> but identical rational numbers? (This surely has got some "rational" LM> core, because set-theoretically these *are* two distinct representations LM> of one rational number). If we refer to the character strings "1 / 3" and "2 / 6" in your email message, they are two distinct representations of the same number. LM> there are many distinct representations of one rational number, the LM> rational number in question is just one rational number. I agree. However, were we discussing rational numbers, or how REBOL represents them? ;-)
>>This problem goes away as soon as you say "two distinct >>representations of the same value".
LM> Yes! That is what I am trying to say all the time! "Two distinct LM> representations of the same value" is it. So we got to an agreement, in the end. :) Took so much time if you think about it... when did we start this discussions? It's interesting anyway how many discussions are actually most of the time terminology discussions. The main reason is that different people don't always share the same definitions for the terms they use. Or, they just don't care and write a message quickly, trying to explain with whatever term seems to work. ;) Maybe I do this more often than I should.
>>I agree that an "abstract", i.e. implementation-independent, >>description of REBOL is useful; however, only Carl could really >>provide us with something like that.
LM> I have shown above, that in a specific case he didn't succeed to do it LM> just because he didn't "forget enough implementation details". Moreover, LM> my article inspired his short Same? function description, see the LM> evolution of the Same? function help. This proves (for me at least) that LM> the last statement needn't always be true. Yes, but what I mean is that we can never say for sure what is an implementation detail and what is not. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/

### [5/11] from: greggirwin:mindspring at: 19-Apr-2005 11:08

GS> It's interesting anyway how many discussions are actually most of GS> the time terminology discussions. The main reason is that GS> different people don't always share the same definitions for the GS> terms they use. Or, they just don't care and write a message GS> quickly, trying to explain with whatever term seems to work. ;) Dialects at work. :) -- Gregg

### [6/11] from: rotenca::telvia::it at: 19-Apr-2005 21:11

Someone could write a Rebol language in which the expression same? 1 1 ;== false If this cannot be considered Rebol language, it is only because the actual implementation of Rebol returns true. It is only the actual implementation which permit to say what is a Rebol value. -- Ciao Romano Paolo Tenca

### [7/11] from: lmecir:mbox:vol:cz at: 20-Apr-2005 0:53

Romano Paolo Tenca napsal(a):
>Someone could write a Rebol language in which the expression > > same? 1 1 ;== false > >If this cannot be considered Rebol language, it is only because the >actual implementation of Rebol returns true. > >It is only the actual implementation which permit to say what is a Rebol >value. >
a nice joke :-) ( but seriously, this is discussed in http://www.fm.vslib.cz/~ladislav/rebol/identity.html , where it is proven, that the identity of Rebol values doesn't depend on the Same? function that much ) -L

### [8/11] from: lmecir::mbox::vol::cz at: 20-Apr-2005 1:01

Ladislav Mecir napsal(a):
>Romano Paolo Tenca napsal(a): >>Someone could write a Rebol language in which the expression
<<quoted lines omitted: 16>>
>function that much ) >-L
one more note: Same? can be defined easily and is not "necessary" in Rebol -L

### [9/11] from: lmecir:mbox:vol:cz at: 20-Apr-2005 19:02

Hi all, I rewrote (partially) the www.fm.vslib.cz/~ladislav/rebol/identity.html article to prove, that Rebol Identity can be defined as a mezzanine without having the Same? function just in case somebody didn't know that. -L

### [10/11] from: mokkel:gmx at: 21-Apr-2005 0:24

Hello Ladislav, even though I haven't read all yet, just a small mistake which should be fixed: In section 18 the f/arg1: "KO" should be replace by h/arg1: "KO" as written also in the text. Michael P.S.: I like the beginning with the 'blocks now more. :-)

### [11/11] from: lmecir:mbox:vol:cz at: 21-Apr-2005 8:00

Hello Michael,
>Hello Ladislav, >even though I haven't read all yet, just a small mistake which should be
<<quoted lines omitted: 6>>
>Michael >P.S.: I like the beginning with the 'blocks now more. :-)
Thanks for your thorough reading. Corrected. When I was at it I actualized %identity.r and corrected a statement about the regularity of series indices too. -L

Notes
• Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted