[Aldor-l] exporting a domain in aldor - update
Martin Rubey
martin.rubey at univie.ac.at
Mon Jan 1 16:57:17 EST 2007
Dear Aldor experts,
Ralf Hemmecke <ralf at hemmecke.de> writes:
> On 01/01/2007 08:21 PM, Martin Rubey wrote:
> > #include "aldor"
> > define Cat: Category == with {
> > Dom: OutputType;
> > f: () -> Dom;
> > }
> > DomA: Cat == add {
> > Dom: OutputType == Integer;
> > f(): Dom == 1783; }
> > DomB: Cat == add {
> > Dom: OutputType == String;
> > f(): Dom == "abcd"; }
I just checked: replacing the definitition of f() with
f(): Dom == 1783 pretend Dom;
does work in compiled code. I wonder why it segfaults in the
interpreter. Furthermore, I really need another solution, to make the code
available in axiom - as you might know, in axiom types are not first class
objects...
> Of course, the above code does not represent what you have in mind.
Why not?
> What about explaining your actual problem instead of translating your problem
> (wrongly) into Aldor and claiming it were the problem? What do you want to
> achieve?
The full problem is difficult to explain without going into the details of
aldor-combinat. I'll try -- simplifying some things:
We have a category
define CombinatorialSpecies(L: LabelType): Category == with {
...
}
that exports an operation (simplifying here a little)
structures: Set L -> Generator %;
One example would be the domain SetPartition, for which structures produces all
set partitions of the given list.
Now I want to provide a second operation
isomorphismTypes: MultiSet L -> Generator ???;
that produces all multipartitions, i.e., multiset partitions of the given
multiset. For example, for m = [1,1,2] the multipartitions are
[[1,1,2]],[[1,1],[2]],[[1,2],[1]],[[1],[1],[2]].
Of course, these are not of type SetPartition. They are, in a certain sense,
isomorphismtypes of the setpartitions of [0,1,2], where 0 and 1 are
identified.
For a reason I cannot explain here, I would like to have the operation
isomorphismTypes provided by the same domain, i.e., isomorphismTypes should be
exported by CombinatorialSpecies.
Does this explain things better?
Martin
More information about the Aldor-l
mailing list