[Aldor-l] LabelSpecies for L: LabelType -> CombinatorialSpecies L

Martin Rubey martin.rubey at univie.ac.at
Sun Oct 22 13:54:00 EDT 2006


Dear all,

is there a way to check whether two constants are identical. I.e., I'd like to
have

foo(A: SomeCat, B: SomeCat): Boolean

return true, if A and B are identical, false otherwise. In Axiom, we have "is"
for that purpose, but it seems that "is" does not work in Aldor.

Dear Ralf,

Ralf Hemmecke <ralf at hemmecke.de> writes:

> Hello,
> 
> On 10/22/2006 03:06 PM, Martin Rubey wrote:
> > I think I got something nice. Since we only need the LabelType Parameter for
> > the structures, it really should be a parameter of that function.
> 
> I've thought about that, too, but I actually decided for
> 
> (L: LabelType) -> CombinatorialSpecies L
> 
> since that is in perfect analogy with the definition of List and Set.

Yes, but the other definition is in perfect ananlogy with Species as defined in
Bergeron Labelle Leroux.

> Look at your definition of '=' in CharacteristicSpecies. You use 'pretend'. Do
> you believe me that I can construct something that says that two structures are
> equal although they are not? That makes your code not doing what it should.

I guess that refers to my question above?

> There is another reason why I decided against it. It puts the type of the
> second argument into the Rep record. That is nothing else than Object as
> defined in section 21.10 of the AUG. I did not want to bundle type and value
> explicitly as data.

Why?

> In fact,
> 
> Rep == Record(L: LabelType, l: List L);
> 
> is nearly the same as
> 
> Rep == (L: LabelType) -> CombinatorialSpecies L
> 
> well, you had that in 'LabelSpecies'.

I don't think so. There are some differences:

* the former seems to work. 

* If I use the second approach, species suddenly become top-level objects. It
  seems that it easier to work with domains, though.

* If I just want to have the generatingSeries, why should I bother passing a
  LabelType? This is not very natural.

* the latter Rep requires another layer, namely LabelSpecies. Already the
  difficulty of coming up with a good name suggests that this is not a good
  idea.


I'll make a branch and see how far I get.


Martin





More information about the Aldor-l mailing list