Re: Proposal: 6NF

From: vc <boston103_at_hotmail.com>
Date: 16 Oct 2006 08:04:03 -0700
Message-ID: <1161011043.196371.120160_at_m73g2000cwd.googlegroups.com>


Jan Hidders wrote:
> vc wrote:
> > Jan Hidders wrote:
> > > vc wrote:
> > [...]
> > > > The most familiar to the OOP person expectation of what the type is is
> > > > based on the LSP where one can substitute objects of type S for objects
> > > > of type T, S being a subtype of T, without change in behavior.
> > > > Clearly, treating Z as subtype of R does not conform the LSP, because
> > > > Z is not a subfield of R.
> > >
> > > Depends on what you think of as the thing that is being defined. Is it
> > > the algebraic structure or is it the set over which the operations are
> > > defined? In the first case you cannot treat the Z algebraic structure
> > > as a subtype of the R algebraic structure, but in the second case you
> > > clearly can.
> >
> > Hold on.
>
> Ok. I'm holding on.
>
> > o The set plus some operations over the the set *is* an algebraic
> > structure so there is no substantial difference between case one and
> > case two. Once again, this is an example of imprecise language which
> > one would want to avoid (saying 'set' and meaning 'structure').
>
> When I say "the set of integers" I mean "the set of integers" and not
> "the set of integers plus some operations" which is a tuple and not a
> set.

When one says "the set of integers", one usually refers to a set of things possessing some properties, addition/multiplication/subtraction operations obeying certain laws. If one says "the set of integers" and excludes one or more operations, then one makes the mistake of misnaming the structure one is talking about. You can call the structure 'my_private_integers', but it's not the same thing we came to love and respect at primary school.

> I get the impression that every time I write "the set of X" you
> actually read "the algebraic structure that descibes X", which might
> explain why you think I'm being imprecise. If I understand you
> correctly you don't accept that "the set of X" is actually a meaningful
> concept? Correct?

It depends on what the set of X is. If it's just a collection of three thing without any known properties, then the most one can say is that "it's a set of three things". Re. integer, see above, you cannot divorce integers from their properties because what you get is no longer integers. By saying "the set of integers, you implicitely accept all the qualities the integers might have, good or bad ;)

 >
> If that is the case then let us concentrate on that question. Agreed?
>

OK.

> > > Note that Liskov and Wong themselves defined the principle
> > > as:
> > >
> > > Let q(x) be a property provable about objects x of type T. Then q(y)
> > > should be true for objects y of type S where S is a subtype of T.
> > >
> > > Clearly this is the case if T is the set of reals and S the set of
> > > integers.
> >
> > Clearly, it is not because objects of the integer type do not have the
> > division 'method' which its parent real type has, as simple as that,
> > unless you deform the type of reals by excising division.
>
> I don't think that is clear, at all, and in fact I think your argument
> is actually circular. If we consider the two algebraic structures
> (R,+,x,/, ..) and (Z,+,x, ..) and if we assume that Z is a subset of R
> then there *is* a division operation for the elements in Z, namely the
> one you find in the algebraic structure of R.

So what is the result of 7/5 in Z remembering that a/b=c implies that a must be equal to b*c ?

> Now your argument seems
> to be based on the assumption that the sets R and Z are distinct,

No, it's not based on that. Although, a typical construction of reals makes 2.0 and 2 quite distinct, we can pretend that they are the same ("up to the isomorphism"). The substantial point is that Z loses some properties after being 'subsetted' from R, e.g the division operation, which means in particular that one cannot substitute an integer(subtype) for a real(type) in any arbitrary expression as the LSP requires. One can derive various conclusions from that: integers are not a subtype of reals, the LSP definition is no good, the subtype as subset notion is no good, the OOP in its entirety is a bunch of baloney because it cannot even handle simple math structures ;), etc.

> in
> which case it is not very surprising that this leads to the conclusion
> that Z cannot be a subset of R.

>
> > > In fact, I would say this is true iff S is a subset of T.
> > >
> > > > Now, one can stipulate that subtype is just a subset (invoking the
> > > > algebraic ghost subsequently in order to amend the R/Z problem would be
> > > > cheating). According to such definition, Z *is* a subtype of R, but
> > > > how useful such observation might be ? Not very much.
> > >
> > > It implies LSP.
> >
> > Well, it does not simply because a naked set has no interesting
> > properties except perhaps its cardinality.
>
> Right, that's were we disagree and probably related to the central
> issue I mentioned earlier. I would say that the elements of these sets
> have lots of interesting properties, such as theire representation as a
> string.

Representation is totally immaterial to what properties an abstract thing might possess.

>Just because this set is left abstract in the algebraic
> structure doesn't mean it cannot have other properties. I could for
> example define the sets of integers and the set of floating point
> numbers as equivalence classes over possible string representations.

You could define anything, but it would be something quite different from the integers as understood and used in math although possibly similar in some respects.

>
> > So we are back to where we started from, how do you substitute objects
> > of the integer type for objects of the real type in an expression like
> > x/y ?
>
> What would be the problem? If the result of 2.0 / 3.0 is well defined,
> then what is problematic about the claim that the result of 2 / 3 is
> well defined and in fact the same?

So what is the result of 2/3 in integers ?

>
> > [...]
> > > At the right abstraction level LSP and the subset definition are in
> > > fact the same. To be more exact, if you're interested in your objects
> > > as things that behave in a certain way, and that is how you define
> > > them, meaning that two objects are defined as the same iff they behave
> > > the same, then the two definitions are equivalent.
> >
> > What about 'integer' division as part of such behavior ?
>
> You mean "idiv"? It would probably only be defined for integers.

It's unclear how you are going to do that since what is understood as integers simply does not have the operation. If you do define 'division', what you'll get won't be integers any more. I am curious to see the definition anyway.

>
> -- Jan Hidders
Received on Mon Oct 16 2006 - 17:04:03 CEST

Original text of this message