Re: Proposal: 6NF

From: Marshall <marshall.spight_at_gmail.com>
Date: 19 Oct 2006 19:14:10 -0700
Message-ID: <1161310450.571687.239740_at_e3g2000cwe.googlegroups.com>


On Oct 19, 4:36 pm, "vc" <boston..._at_hotmail.com> wrote:
> Marshall wrote:
> > On Oct 19, 7:06 am, "vc" <boston..._at_hotmail.com> wrote:
> > > Jan Hidders wrote:
> > > > vc wrote:
> > > > > Jan Hidders wrote:
> > > > > [...]
>
> > > > > A much simpler example. Let {0, 1, 2, 3} be a set of four integers
> > > > > with addition modulo 4. Then, none of its subsets, except {0} and
> > > > > {0, 2}, retains the addition mod 4 operation which makes the idea of
> > > > > 'subtype as subset' utterly silly, [....].
>
> > > > You keep on making the same mistake. The expression a +[mod 4] b has a
> > > > well defined result if a and b are from any subset of {0, 1, 2, 3}.
>
> > > Consider the subset {2, 3}. What is the result of (2+3) mod 4 ? If
> > > you say it's '1', what is '1'? There is no such element in {2, 3}.
>
> > That doesn't matter. The answer is 1. The fact that 1 is not a member
> > of {2,3} is irrelevant. The function +[mod4] still exists, unchanged,
> > even though you took a subset of its domain.
> The original function maps pairs of values from {0,1,2,3} to the values
> in the same set. In particular, (2,3) -> 1. Sunce we do not have '1'
> in the subset {2,3}, the binary operation is not defined any longer.

Not so; the function remains defined. However, it cannot be considered "binary" relative to the subset {2,3}. That doesn't mean that it suddenly
zapped out of existence when you typed in that subset.

> I am not surer how anyone can say, with a straight face too, that
> there is '1' in {2, 3}.

No one said that. {0,1,2,3} is closed over AddModFour(), but {2,3} is not closed over AddModFour().

> > You're conflating math with type issues from OOPLs.
> Are you saying that the OOPL foundation is voodoo rather than logic and
> math ?

Maybe not voodoo, but not strict math, either. Math doesn't have mutator methods that I'm aware of; it does have fuctions defined over values however.

> > > Objects in subclass B = {2, 3} won't understand 'plusMod4' because the
> > > operation does not exist in B, it was lost as soon as you've subsetted
> > > A = {0,1,2,3}. That is of course if you understand 'operation' in the
> > > ordinary mathematical sense such that the set is closed under it. If
> > > you have to go outside the set in question, it ain't no operation no
> > > more in the accepted mathematical sense.
>
> > Certainly they will understand it. Behold:
>
> > class ModFour {
> > private final int val;
> > ModFour(int i) {
> > if (i < 0 || i > 3) throw new RuntimeException();
> > val = i;
> > }
>
> > public ModFour addModFour(ModFour a) {
> > return new ModFour((val+a.val)%4);
> > }
>
> > public String toString() { return "" + val; }
>
> > }
>
> > public class TwoOrThree extends ModFour {
> > TwoOrThree(int i) {
> > super(i);
> > if (i < 2 || i > 3) throw new RuntimeException();
> > }
>
> > public static void main(String[] args) {
> > TwoOrThree v2 = new TwoOrThree(2);
> > TwoOrThree v3 = new TwoOrThree(3);
> > System.out.println(v2.addModFour(v3));
> > }
> > }
>
> > If you run this program it prints "1". Notice that the
> > code doesn't care that addModFour() isn't automatically
> > covariant.
>
> "return new ModFour((val+a.val)%4)" is called a bug or cheating
> because you used a function defined on the entire domain NxN (where N
> is a subset of the natural numbers implemented by the computer) to
> generate a result which is undefined for the (2,3) pair.

It's not a bug, since the program produces the correct result, which is 1. It's not "cheating" because WTF does cheating even mean in this context. What it is, is the absence of closure over the subclass. Which is no big deal.

> At thispoint, it may be useful to recall what a function is and
> apply the memory, if any, to the addMod4 operation.

Indeed. A function is a mapping from one set to another. In this case, the domain is pairs of values from {0,1,2,3} and the range is that same set. This particular function qualifies as a binary function, and also exhibits closure over the set {0,1,2,3}. Since {2,3} is a subset of {0,1,2,3}, the function is fully defined over that subset. However, since that function is not closed over the subset, it does not qualify as a binary function on that subset. It remain a closed binary function over {0,1,2,3} however.

>
> > The *only* trouble anywhere in here is if you want to
> > have methods which are mutator methods; that is,
> > methods which modify the distinguished object in place.
> > And yes, in that case, closure is an issue. I have not
> > seen any math books that give functions the same
> > semantics as inherited OOPL mutator methods however.

I note you did not respond to this important paragraph. Yes, in OOPLs, there is a problem with closure, subtyping, and mutator methods. Outside of OOPLs (in math, that is) this problem does not apply.

> > Furthermore, 2 = 2.0.
> You may want to find out how integers and real numbers are actually
> constructed before stating that.

How they are constructed is not an issue; this is simple arithmetic.

> > Also, I found this equation in a math book on page 3:
>
> > P ⊆ N ⊆ Z ⊆ Q ⊆ R
>
> The equation looks like a random collection of characters. What do
> you suppose it means ?

I suppose your browser doesn't have the necessary font.

In prose, it means:

  The set of positive integers is a subset of the set of nonnegative integers
  which is a subset of the integers which is a subset of the rationals which

  is a subset of the reals.

Marshall Received on Fri Oct 20 2006 - 04:14:10 CEST

Original text of this message