[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Curiosities with Axiom mathematical structures

From: Ralf Hemmecke
Subject: Re: [Axiom-developer] Curiosities with Axiom mathematical structures
Date: Wed, 08 Mar 2006 23:24:42 +0100
User-agent: Thunderbird 1.5 (X11/20051201)

Do you mean that passing operations to the categories would be a feasible
approach? I.e., being allowed to say something like

Monoid(m:(%,%)->%): Category == with
       square: % -> %

       square a == m(a,a)

Martin, stop writing in SPAD. I thought you also agreed that new things have to be written in Aldor. And there you would to write the default implementation with "default" and not with "add". Otherwise there would be an anonymous domain "add {square ...}" inside a with clause.

Of course, one would have to rethink this several times, the suggested notation
here is clearly not yet perfect. One might object that this notation violates
the possibility of creating anonymous categories, but I suspect that this
wouldn't make sense anyway.

Yes, one has to rethink that quite a lot. The problem with your suggestion is the following

1) You cannot simply ask

  Integer has Monoid

because you have to give a parameter.

2) If you say something like

MyMonoid(T: Type, m: (T, T) -> T): Category == with {
  square: T-> T;
  default {square(t: T): T == m(t, t)}

then it is perfect Aldor.
Then, however, you ask

  Integer has MyMonoid(Integer, *)

and it will return true only if you have said

extend Integer: MyMonoid(Integer, *) == add;

(But probably you had something else in mind.)

Although I don't really like that an AbelianMonoid is not a Monoid, and although I think that renaming during inheritance would be nearer to mathematics... after all the discussion here, I somehow think that the design in Axiom is not really bad. The reason is that I have not seen a clear case where renaming would be over-advantageous.

I'd like to say

  Integer has Monoid

instead of

  Integer has Monoid(*, 1);
  Integer has Monoid(+, 0);

Simply think of a category Foo with hundreds of exported function, would you like to write

  Dom has Foo(f1, f2, ..., f100)

??? That is not really handy.

Maybe we should open up a page on AxiomWiki and list some cases where one could really benefit from renaming. I guess the list would be quite short and not comparable with the effort such an Aldor extension would cost.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]