Dear Ralf, Peter, Peter: still no way to get aldor "extend" working for axiom, I guess?
last week I tried, for the first time, to use aldor-combinat to generate some objects, namely partitions of type B and D. Partitions of type A are the usual set partitions you know. A partition of type B is a set partition of {+1,-1,+2, -2,...,+n, -n} such that 1) for every block, the negation of the block is also a block. I.e., if {1,2,-3} is a block, then {-1,-2,3} must also be a block 2) there is at most one block, called the zero block, which contains both i and -i for some i. It then follows from (1) that it is a set of the form {+a, -a, +b, -b,...} Below is naive code to generate this objects using axiom and aldor-combinat. The reason I send you this, is to give you a feeling how I might want to use our code, and that it is not quite optimal yet, due to the incredible number of coercions necessary. To make things easier, I added a coercion from SetSpecies to Set, lest I go crazy. It also proves that you are right in saying that coerce: % -> Record(subset: SetSpecies L ,rest: SetSpecies L) in Subset is not optimal. Of course, most of the awkwardness would go away if we had "extend" usable for Axiom, but that seems still out of reach. I do not want to say that what we have is no good. Only, to make it productive, there is some (probably boring) work to do. One thing is that since so much is based on SetSpecies, we should really make it work well. I'm looking forward to see you and Christian next Monday, Martin --)cd ~/combinat/branches/iso-experiment/combinat/src --)re ../lib/combinat.input --)cd ~/martin/TeXSource/Mathematik/jakob -- produce all type B partitions REC ==> Record(part: Partition ACINT, zero: SetSpecies ACINT, negs: SetSpecies ACINT) partitionsB n == lab: SetSpecies ACINT := set [i::ACINT for i in 1..n] all := [structures(lab)$Partition ACINT]$ACList Partition ACINT::List Partition ACINT res: List REC := [] for p in all repeat llp := p::SetSpecies SetSpecies ACINT::ACList SetSpecies ACINT::List SetSpecies ACINT -- add an empty block, for the case where there is no zero block llp := cons(set([]::List ACINT)$SetSpecies ACINT, llp) -- select a zero block for z in llp repeat -- all numbers but the very first in each block may be barred pos := z for b in rest llp repeat pos := cons(first b, pos) r: SetSpecies ACINT := set (parts difference(lab::Set ACINT, pos::Set ACINT)) subs := [structures(r)$Subset ACINT]$ACList Subset ACINT::List Subset ACINT for s in subs repeat t := s::Record(subset: SetSpecies ACINT ,rest: SetSpecies ACINT) res := cons([p, z, t.subset]::REC, res) res -- [# partitionsB n for n in 0..7] produces Dowling numbers -- http://www.research.att.com/~njas/sequences/A007405 ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Aldor-combinat-devel mailing list Aldor-combinat-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/aldor-combinat-devel