# Computer platforms for combinatorial search problems/mathematical music theory?

I'm finding programming various combinatorial searches (connected to mathematical music theory) in a general purpose computer language tedious, so I'd like pointers to computer platforms/environment purpose-built to enable such searches. If the answer has the form "Maple can do that" or "Mathematica can do that," then I'd appreciate pointers specific enough to get me started.

Within reason I would trade ease of specification against any optimization of the search algorithm, but I'd feel grateful for speed if I could have that too.

Here's an example of a typical question; I'm really hoping for an environment where I can specify such a search almost as succinctly as I now explain it (I use terminology from mathematical music theory but define everything in purely mathematical terms):

Write $T$ for the set of complex $12$th roots of unity.

Tetrachord means a subset of $T$ of cardinality $4$. Row means a permutation of T.

Fix two distinct rotation classes of tetrachords, $a$ and $b$. By definition row $R\in G_{a,b}$ if applying $R$ to the 24 tetrachords in $a \cup b$ yields 24 tetrachords pairwise distinct up to isometry.
Find $\bigcup_{a,b} G_{a,b}$.

Thanks in advance for any help!!

-
Not sure if this can help or not, but my friends who like to compose music via mathematical pattern and computer algorithm are crazy for the programming language Supercollider. I guess it has a lot of features which both programmers and composers can get behind. Maybe it can also do something that would help you –  David White Sep 13 '11 at 3:45
I think I understand what you are trying to do; the tricky part seems to be checking whether the 24 permuted tetrachords are distinct from the originals. I recall I once had a similar problem that involved checking that two sets had empty intersection; although it turned out to be possible, it was extremely difficult to program this constraint in Maple. So although Maple should be able to handle this particular problem, I would not recommend using it (unless someone else knows a easy way of doing it). –  ARupinski Sep 13 '11 at 3:59
@ARupinski I don't need distinct from a and b, just isometrically distinct from one another. –  David Feldman Sep 13 '11 at 4:09
@David: Either way, programming checks for distinctness ends up very roundabout in Maple (as I recall solving my problem involved finding a way to convert the sets to some other data structure such as strings and then using some weird functions on strings to compare them. At any rate, it was a very difficult workaround that probably could have been avoided with a language better suited to comparing sets). –  ARupinski Sep 13 '11 at 4:59
I don't know what you mean, since Maple can test for equality and disjointedness of sets easily, just use "set1 = set2" for equality and "set1 intersect set2={}" for disjointedness. –  Brendan McKay Sep 13 '11 at 7:00