Discussion:
[Axiom-developer] kTuple wish
Martin Rubey
2007-03-29 20:05:02 UTC
Permalink
Dear Ralf,

I cannot find the mail anymore in which you explained why you want to have
several labeltypes for multisort species. I think the argument was because of
functorial composition, but I cannot remember well...

Maybe you could repeat.

Thanks,

Martin
Ralf Hemmecke
2007-03-29 21:35:12 UTC
Permalink
Have you ever tried to use the search facility on sourceforge or gmane.org?

http://article.gmane.org/gmane.comp.mathematics.aldor-combinat.devel/705

Look at

macro MSPECIES==(L: Tuple LabelType)->MultisortSpeciesCategory L;
FunctorialCompose(
F: MSPECIES,
G: Tuple MSPECIES
)(L: Tuple LabelType): MultisortSpeciesCategory L == add {
Rep == F(G1(L), G2(L), ..., Gn(L));
...
}

and you will realise that even if you start with just one LabelType,
after Functorial composition with different Gi, you arrive at different
things.

Ralf
Post by Martin Rubey
Dear Ralf,
I cannot find the mail anymore in which you explained why you want to have
several labeltypes for multisort species. I think the argument was because of
functorial composition, but I cannot remember well...
Maybe you could repeat.
Thanks,
Martin
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-30 07:14:04 UTC
Permalink
Post by Ralf Hemmecke
Have you ever tried to use the search facility on sourceforge or gmane.org?
Yes, but I couldn't find it still
Post by Ralf Hemmecke
Look at
macro MSPECIES==(L: Tuple LabelType)->MultisortSpeciesCategory L;
FunctorialCompose(
F: MSPECIES,
G: Tuple MSPECIES
)(L: Tuple LabelType): MultisortSpeciesCategory L == add {
Rep == F(G1(L), G2(L), ..., Gn(L));
...
}
and you will realise that even if you start with just one LabelType, after
Functorial composition with different Gi, you arrive at different things.
Yes, thanks. So here is what I did yesterday night:

I played around with things like Tuple Cross(T: PrimitiveType, List T) and
couldn't get it to work. I believe that is due to the fact that Tuples are not
updateable, as the AUG says, and that makes sense, too.

So, today morning I thought:

We really want to be able to "see" the "arity" (is this the right term?) of our
multisort species, since, for Plus, Times, Composition and Functorial
Composition and in fact all transformations there are compatibility
restrictions on the arity.

So, maybe we want something like

MSPECIES(k: PositiveInteger) ==
(L: DirectProduct(k, LabelType)) -> MultiSortSpeciesCategory(L, ???)

and then, for example,

FunctorialCompose(m: PositiveInteger, F: MSPECIES m,
k: PositiveInteger, G: DirectProduct(m, MSPECIES k))

(L: DirectProduct(k, LabelType)): MultiSortSpeciesCategory(L, ???) == add {

Rep == F G

...

}


Of course, I don't know yet whether this would work...

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-30 08:01:32 UTC
Permalink
Post by Martin Rubey
I played around with things like Tuple Cross(T: PrimitiveType, List T) and
couldn't get it to work.
Oh, what did you want to put into the List T thing? I have already tried
something with

Object LabelType (see AUG)

instead of

Cross(T: PrimitiveType, List T)

But the *big* problem with Object is that one immediately loses type safety.

One would have a tuple of objects. And one is free to put an object in
the tuple that would not fit.

Remember that I would like to have something like

multiset(sm1: S M.1, ..., smk: S M.k): % == per (sm1, ..., smk);

with the Object approach all sm_i's are objects so one cannot ensure
that there is an S(M.i). I would like to move as much burden as possible
to the compiler. I don't like runtime-checking.
Post by Martin Rubey
I believe that is due to the fact that Tuples are not
updateable, as the AUG says, and that makes sense, too.
That is certainly a problem. But also Array instead of Tuple would
probably not help. And with Array one loses a nice (and natural) syntax.
Post by Martin Rubey
We really want to be able to "see" the "arity" (is this the right term?) of our
multisort species, since, for Plus, Times, Composition and Functorial
Composition and in fact all transformations there are compatibility
restrictions on the arity.
But that is not a problem. Have you seen

#: I

in the mspecies code? It is exactly for that purpose.
Post by Martin Rubey
So, maybe we want something like
MSPECIES(k: PositiveInteger) ==
(L: DirectProduct(k, LabelType)) -> MultiSortSpeciesCategory(L, ???)
and then, for example,
FunctorialCompose(m: PositiveInteger, F: MSPECIES m,
k: PositiveInteger, G: DirectProduct(m, MSPECIES k))
(L: DirectProduct(k, LabelType)): MultiSortSpeciesCategory(L, ???) == add {
Rep == F G
...
}
Looks like a good idea to include the arity in FunctorialCompose. It's a
bit like matrix multiplication. But on the other hand, I don't like it.
BLL also writes F(G1,...,Gm) and the arities are implicit. I am not yet
sure whether to include the arity in the signature. I tend not to have
it, but then, of course, the compiler has no chance to check that the
arities are OK. That would become a run-time check. However, given the
fact, that we probably cannot achieve compile-time type-safety with
either construction, I'd rather life with better syntax than this small
integer comparison overhead that will not happen too often anyway.
Post by Martin Rubey
Of course, I don't know yet whether this would work...
What will probably not work is

Rep == F G.

The arities are then missing and things get a bit more complicated.

Ralf

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-30 08:36:05 UTC
Permalink
Post by Ralf Hemmecke
Post by Martin Rubey
I played around with things like Tuple Cross(T: PrimitiveType, List T) and
couldn't get it to work.
Oh, what did you want to put into the List T thing?
Tuple Cross(T: PrimitiveType, List T)

would have been the representation of a BLL-multiset.
Post by Ralf Hemmecke
Post by Martin Rubey
I believe that is due to the fact that Tuples are not
updateable, as the AUG says, and that makes sense, too.
That is certainly a problem. But also Array instead of Tuple would probably not
help. And with Array one loses a nice (and natural) syntax.
Why? the problem is only with the internal representation, I believe.
Post by Ralf Hemmecke
What will probably not work is
Rep == F G.
The arities are then missing and things get a bit more complicated.
Maybe I'll try.

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-30 09:01:59 UTC
Permalink
Post by Martin Rubey
Post by Ralf Hemmecke
Post by Martin Rubey
I played around with things like Tuple Cross(T: PrimitiveType, List T) and
couldn't get it to work.
Oh, what did you want to put into the List T thing?
Tuple Cross(T: PrimitiveType, List T)
would have been the representation of a BLL-multiset.
Cool. :-) If you check, your Cross(T: PrimitiveType, List T) is
basically nothing else than Object(PrimitiveType).

Now what is the input type for Multiset?

Multiset(M: ???): with {..} == add {
Rep == Tuple Cross(T: PrimitiveType, List T);
...
}

How does the Rep correspond to the M?
How can you make that in a typesafe manner?

Have fun.

Ralf

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Loading...