## 10 Reputation

2 years, 250 days

## What I'm actually trying to accomplish...

I don’t know what impression I created, but in fact I don’t mind at all telling you what I want to do.  Being a mathematician, I’m always afraid of boring people with technical details, but if you ask for it then I can talk for as long as you’re willing to listen!  I work with combinatorial objects that I call “branches” and “trees”.

Definition of "branch":  A branch is anything that can be built by iterating the following construction rules:

• If a,b,c,d are integers with c,d>0 then the ordered 4-tuple [a,b,c,d] is a branch.
• If a,b,c are integers with c>0, and if M is a (nonempty and finite) multiset of branches, then the ordered 4-tuple [a,b,c,M] is a branch.

Definition of “tree”:  A tree is a nonempty finite multiset all of whose elements are branches.

I’m trying to solve problems about trees, where each problem has the form "find all trees satisfying certain (very complicated) conditions.”  The details of these conditions are not important for this discussion.  The only thing that matters is that the solution-set of each such problem is a finite set of trees.  So I have to manipulate finite sets of trees, and I don’t want a given tree to appear several times in the set.  At the moment, Maple gives me sets in which trees are repeated.  So I need to find how to avoid those repetitions.

Thanks.

## .m...

@acer   Thanks for your answer.  Ok, I understand now that the two things I was complaining about (equality and .m) were not bugs.  Being a mathematician, and not knowing much about programming, I was particularly surprised to learn that (as you wrote) two MultiSets constructed with the same elements are still two MultiSets!  Maybe I'm missing something, and my opinion may be due to my lack of knowledge, but it seems to me that this makes MultiSets almost completely useless, except for the most basic applications.  This is useful to know, I'll stay away from them.  Thanks again.

## Deconstructor for MultiSet...

@Carl Love   Very generous of you to offer to work on something that would deconstruct MultiSets even when they are embedded in other structures.  However, I would be afraid to waste your time because (1) I might not be knowledgeable enough to correctly use your solution, and (2) although I don’t mind telling you exactly what I need and what structures I use, I feel bad asking you to solve my specific problem (as opposed to something that would be useful for everyone).  So I hope it’s ok if I respectfully turn down your offer!  I think I can rewrite my procedures so as to avoid MultiSets, and use sets of 2-elements lists instead (I'm assuming that sets of 2-elements lists are equal for Maple whenever they are mathematically equal).  Many thanks.

@Carl Love    Thank you for your answer, Carl.  Now that I understand the cause of my problem, I would like to ask something more specific.  Suppose I have a set S whose elements are lists [a,b,U] where a,b are integers and U is a MultiSet (the elements of U are lists [a',b',U'] of the same type, and so on recursively).  Because of the phenomenon that you explained, my set S will contain many repetitions.  Is there a way to remove repetitions (understandable by someone who is not very knowledgeable in Maple)?

Regarding the issue with the file saving, I tested your theory with your mini-example and it worked fine (no error message).  I tried again with my original example and got an error message different from the one I mentioned in my question.  More precisely, at the end of the file displayed in my question, I did this:

save X, Y, "saveXY.m";
restart;
X; Y;

and Maple replied this:
[2, 7, Object<<MultiSet,4487021344>>]
Error, (in MultiSet:-ModuleCopy) too many levels of recursion

Any thoughts?  Thanks again.

Daniel

## @vv   Thanks!  This solve...

@vv   Thanks!  This solved my problem.

 Page 1 of 1
﻿