Mailing List Archive: 49091 messages

# new puzzle on sameness 1

### [1/11] from: rotenca:telvia:it at: 13-Feb-2003 21:07

Some scalar are more same? than others. To make things more easy (at least for Ladislav), i'll use the identical? function of Ladislav. This is the puzzle (real trascription of a console session):
>> a1: 0
== 0
>> a2: a1
== 0
>> a3: a1
== 0
>> identical? a1 a2
== true
>> identical? a1 a3
== true
>> identical? a2 a3
== true
>> a1: 1
== 1
>> identical? a1 a2
== true
>> identical? a1 a3
== false
>> identical? a2 a3
== false
>> a1
== 1
>> a2
== 1
>> a3
== 0 --- Ciao Romano

## Re: new puzzle on sameness 2

This puzzle is a little more hard. It uses identical? of Ladislav, but same? should works. This puzzle demonstrate that i can use the native Change to change an integer value without changing all the identical integer, only another one. Two quotes to start: Two Rebol values are identical, if they are equivalent for every purpose. (L) Two mutable values are identical if they have equal state and every mutation affects them simultaneously. (L) The puzzle (console trascription)
>> x/a: 1
== 1
>> integer? x/a
== true
>> x/copy-of-a: x/a
== 1
>> x/same-as-a: x/a
== 1
>> identical? x/a x/copy-of-a
== true
>> identical? x/a x/same-as-a
== true
>> identical? x/copy-of-a x/same-as-a
== true
>> ; Change is the true change action! >> action? :change
== true
>> change magic zero
== ;RESULT DELETED --- else too easy :-)
>> x/a
== 0
>> x/copy-of-a
== 1
>> x/same-as-a
== 0
>> identical? x/a x/copy-of-a
== false
>> identical? x/a x/same-as-a
== true
>> identical? x/copy-of-a x/same-as-a
== false --- Ciao Romano

## Re: new puzzle on sameness 1

Hi, the solution of the puzzle is below, although I am not sure, that it shows any properties of sameness:
> This is the puzzle (real trascription of a console session): > >> a1: 0
<<quoted lines omitted: 26>>
> Ciao > Romano
Spoiler warning line ----------------------- alias 'a1 "a2" etc.

### [4/11] from: rotenca:telvia:it at: 14-Feb-2003 16:00

> Hi, the solution of the puzzle is below, although I am not sure, that it > shows any properties of sameness:
I disagree. a2 is a reference to the same data referenced by a1 a3 is a reference to data which has the same abstract value of the data referenced by a1 When i change the data referenced by a1, a2 remain identical to a1, while a3 retain its old value, no more equal to a1. And given taht "two values are identical if they have equal state and every mutation affects them simultaneously", I conclude that both same? and identical? fail to distingue all identical values. Given http://www.rebolforces.com/~ladislav/evaluation.html#section-9 and http://www.rebolforces.com/~ladislav/evaluation.html#section-10 and http://www.rebolforces.com/~ladislav/evaluation.html#section-11 I must add that the classification of changes in the previous text are incomplete: 1) some affect only one values (replacements) 2) some affect all occurrences (mutations) 3) some affect only some word occurrences (word-mutations) I must also add that there are diffentent kindes of occurrences definited with 2 and 3 I must also add that all rebol value of any datatype! referenced by words are word-mutable . I conclude that a function like identical? is undefined for some rebol values, because it receives its arguments as "abstraction" which do not include all the information needed to decide the identity ("two Rebol values are identical, if they are equivalent for every purpose"). I should do others checkes, but now i think that a function like identical? is only able to detect if two Rebol scalar value are strict-equal? or if two abstractions of Rebol scalar value are the same. This only works if abstractions are considered immutable by definition. --- Ciao Romano

## Re: new puzzle on sameness 2

>> change magic zero
== ;RESULT DELETED --- else too easy :-) 'magis is not a function call, it is a true series and 'zero is not a function call, it is a true series
>> series? :magic
== true
>> series? :zero
== true --- Ciao Romano

## Re: new puzzle on sameness 1

Hi Romano, fine, it looks, that you decided to proofread my text one more time. ...
> I conclude that both same? and identical? fail to distingue all identical > values.
I do not understand.
<<quoted lines omitted: 4>>
> 2) some affect all occurrences (mutations) > 3) some affect only some word occurrences (word-mutations)
I just wanted to discuss and classify two basic kinds of changes. Do you find the wording unclear in that respect?
> I must also add that all rebol value of any datatype! referenced by words
are
> "word-mutable".
That is a notion I didn't need.
> I conclude that a function like identical? is undefined for some rebol
values,
> because it receives its arguments as "abstraction" which do not include
all
> the information needed to decide the identity ("two Rebol values are > identical, if they are equivalent for every purpose").
That is a principial difference in out POV's. The IDENTICAL? function *always* returns a result, i.e. it is defined for any Rebol values. In the above sense my terminology is much less confusing, than the terminology you are using.
> I should do others checkes, but now i think that a function like
identical? is
> only able to detect if two Rebol scalar value are strict-equal? or if two > "abstractions" of Rebol scalar value are the same. This only works if > "abstractions" are considered immutable by definition.
Again, a principial difference. My definition of the IDENTICAL? function didn't use the notion of mutability at all. Actually, the opposite is true. I used my definition of identity to define the meaning of mutability/immutability. Regards -L

### [7/11] from: rotenca:telvia:it at: 15-Feb-2003 17:54

Hi Ladislav, I hope to not be boring (but i know to be boring)
> > I conclude that both same? and identical? fail to distingue all identical > > values. > > I do not understand.
I want to say that identical? can only test get/any 'a get/any 'b and when you get Rebol values in this way, some informations about the Rebol value are lost.
> I just wanted to discuss and classify two basic kinds of changes. Do you > find the wording unclear in that respect?
I only say that there are three basic types of changes in Rebol.
> I used my definition of identity to define the meaning of > mutability/immutability.
You say: two Rebol values are identical, if they aren't discernible. Two Rebol values A and B are identical, if for every equivalence EQ the expression (eq get/any 'a get/any 'b) yields TRUE. In different words: two Rebol values are identical, if they are equivalent for every purpose. I think that the evaluation of the expressions get/any 'a get/any 'b transform the Rebol value A and B in two abstractions of A and B. (eq get/any 'a get/any 'b) yields TRUE is necessary but not sufficient to decide the identity of two rebol values, can be sufficient to decide the identity only of two abstractions (of the type get/any 'a) of two Rebol value. I can discen two Rebol value that an equivalence can't discern. For example this function (written very fast) can check if two integer rebol values expressed by two words are discernable by word-mutation: x: func ['a 'b][if same? get a get b [set a (get a) + 1 if equal? get a get b [return true]] false] but it is not an equivalence, as you defined it. At least you should add this definition in the front of your text (and it is the only definition which you did not put in it): Ladislav Value: the result of the function call get/any 'word In this text i call "Rebol values" the "Ladislav values" You are free to make all the definition you like, i am free to find your definition too limitate to be useful for discern Rebol values.
> Again, a principial difference. My definition of the IDENTICAL? function > didn't use the notion of mutability at all. Actually, the opposite is true.
This could be true, but i should like to know: 1) why you speak of changes and mutability before defining identical? ? 2) the mindex? function used in identical? does not use the notion of mutability? 3) why you say in your text that identical? can be defined after mutability? PS No answer at all for puzzle 2. Must i post the solution? --- Ciao Romano

### [8/11] from: lmecir:mbox:vol:cz at: 15-Feb-2003 21:37

Hi Romano,
> I want to say that identical? can only test > > get/any 'a get/any 'b > > and when you get Rebol values in this way, some informations about the
Rebol
> value are lost.
None at all IMO. I am considering a possibility to change the wording of the article to make this clearer and to use less ambiguous terminology.
> > I used my definition of identity to define the meaning of > > mutability/immutability.
<<quoted lines omitted: 4>>
> Rebol values are identical, if they are equivalent for every purpose." > I think that the evaluation of the expressions get/any 'a get/any 'b
transform
> the Rebol value A and B in two abstractions of A and B. > > (eq get/any 'a get/any 'b) yields TRUE > > is necessary but not sufficient to decide the identity of two rebol
values,
> can be sufficient to decide the identity only of two abstractions (of the
type
> get/any 'a) of two Rebol value.
An interesting concept, but different than mine.
> I can discern two Rebol value that an equivalence can't discern. For
example
> this function (written very fast) can check if two integer rebol values > expressed by two words are discernable by word-mutation: > > x: func ['a 'b][if same? get a get b [set a (get a) + 1 if equal? get a
get b
> [return true]] false]
Your function discerns something else IMO. It is (roughly) equivalent to my SAME-REFERENCES? function from http://www.rebolforces.com/~ladislav/contexts.html , that tries to discern Rebol words.
> 1) why you speak of changes and mutability before defining identical? ?
The order isn't ideal. I am considering a change.
> 2) the mindex? function used in identical? does not use the notion of > mutability?
The MINDEX? function is a function, that has to find some information about its argument. It is like the CHANGE function. You do not have to have a definition of mutation before you use it. Quite the opposite is true. If you use it and then define what a mutation is, you can check, whether it mutates its argument or not.
> PS No answer at all for puzzle 2. Must i post the solution?
It looks, that you will have to, because I do not know, how to do this:
>> series? :magic
== true
>> series? :zero
== true
>> x/a: 1
== 1
>> ; Change is the true change action! >> action? :change
== true
>> change magic zero
== ;RESULT DELETED --- else too easy :-)
>> x/a
== 0 Regards -L

## new puzzle on sameness 2: the solution

The solution is down . . . . . . . . . . . . . . . . . . . . . . . . add at the beginning: magic: third x: make struct! [a [integer!] copy-of-a [integer!]] none alias 'a "same-as-a" zero: #{0000} --- Ciao Romano

### [10/11] from: patrick::philipot::laposte::net at: 16-Feb-2003 10:43

Sameness Hi List, Sameness, what a long thread! When it started with Joel puzzle, it was fun. I must confess that I have not read carefully most of the following posts. Have you guis found some practical implication, or is it just pure "theory"? It would be good then to sum up what was found (Zine, Ladislav or Joel paper), wouldn't it? Regards Patrick

### [11/11] from: lmecir:mbox:vol:cz at: 16-Feb-2003 20:28

Thanks, I didn't use structs until now. They surely deserve some attention. Ciao -L

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