Re: Proposal: 6NF
Date: 16 Oct 2006 20:03:58 -0700
Message-ID: <1161054238.502177.178170_at_m7g2000cwm.googlegroups.com>
Jan Hidders wrote:
> vc wrote:
> > Jan Hidders wrote:
> > >
> > > 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'm not excluding the operations, I'm just making a distinction between
> the set itself and the tuple that defines the algebraic structure.
The integers happen to satisfy the commutative ring axioms, but there are other commutative rings that are not isomorphic to the integers so if you make such distinction and talk explicitely about rings of integers you emphasize the properties that are common for all the commutative rings, in particular addtion/multiplication operations.
On the other hand, if you talk about the set of integers, or just integer numbers, you do not emphasize the fact that the integers satisfy c.r. axioms, but such talk does not imply that the integers somehow lost their properties such as addition/multiplication, on the contrary you may (or may not) want to stress the fact that the integers have some other properties that the c.r. axioms do not require.
In other words, there is no escaping the simple fact that integers however they are formalized have addition/multiplication/subtraction and real numbers have those two plus the division operation (among other properties). This simple fact makes the idea of R to Z subtyping rather odd (as well as that of subtyping Z to N).
>I know that this set and the tuple are often identified in common
> terminology, but this is in some sense sloppy and it is this sloppyness
It's not sloppy but is a common way of talking about this sort of things depending of course on what exactly you want to say.
> that makes it in this case harder to see what the relationship is
> between the subtype=subset interpretation and inheritance between
> abstract data types.
Not harder, just impossible ;) regardles of whether you talk about c.r's and fileld or just integers. and real numbers.
>
> Allow my to explain my position a bit more to avoid quibbles over
> misunderstandings. I would argue that it is sloppy to say that the
> algebraic definition for Q defines *the* set of rationals. The abstract
> algebraic definition allows us to construct several sets and operations
> that satisfy the axioms, and not one of these constructions can claim
> to be *the* set of rationals.
Sorry, I have missed that. Otherwise, I'd have not written the first two paragraphs.
>This, however, allows us to construct Z
> and Q such that Z is a subset of Q while still respecting the axioms of
> both algebraic structures. I'm arguing that this gives us an intuitive
> and consistent interpretation of what these sets mean along with an
> easy to understand semantics of subtyping that ensures LSP.
Alas, as long as Z satisfies the commutative ring axioms without the multiplicative inverses ( such inverses if available would immediatey make it a field) and Q the field axioms, there is little hope that the LSP would also be satisfied -- of course you can construct 'my_Q' without the division operation but that would be cheating.
It might also be interesting to note that paying so much attention to the carrier set is contrary to the algebraic data type spirit -- ADTs emphasize structural properties or in simple words operations rather than what the underlying set might be. That is another argument against the 'subtype as subset' school of thought.
>So, just to
> be clear on this, what I'm *not* saying is that this is necessarily so,
> i.e., we can just as well define constructions for Z and Q such that
> they are disjoint.
As I said before, we may define anything we like, but we can hardly claim that what we define is Q and Z if they do not possess the expected properties.
>
> > > 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".
>
> Indeed, but you can construct the set of reals like for example happens
> with the surreal numbers, of which they are, dare I say it, a subset.
> :-) Along with the construction the operations are defined, and the
> construction is not based on these operations.
>
> > 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").
>
> So where is that distinction in the definition of the surreal numbers?
>
I'd rather not talk about the Conway construction in order to avoid unnecessarily complicating the R/Q/Z simple stuff even more.
> > 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.
>
> I assume you think that an example of a problematic expression would be
> (2.0 / 3.0) where I could subtitute the 2.0 and 3.0 with their integer
> counterparts 2 and 3 and obtain (2 / 3) which would not have a defined
> result, right?
>
> Well, no. Since it is assumed that the integers are a subset of the
> reals the result of / is defined also for all the integers.
So what is the result of 2/3 ?
>So LSP
> holds.
>
> Since I think we touched the main issues above, I will resist the urge
> to give knee-jerk responses to all you other comments. :-)
>
> -- Jan Hidders
Received on Tue Oct 17 2006 - 05:03:58 CEST