If the sale contracts forbids A from making any Menu style products for a period then they would have troubles if they did so in any form for that period - a contract that did not put a time limit on such a restriction would be challengable in most jurisdications as being unfair trading practices.
If the sale contract just forbid them from using Menu then they could easily write a Newmenu program using different algorythms - just recompiling in a different compiler would not constitute sufficient change. In software sales it is common to include clauses stopping the seller from using or selling the software that they just sold, except where they have bought a new licence from the new owner - prior clients who have bought a licence usually still have a legal right to use what they have already bought. I know of a case where a company wrote a specialised form of a database and later sold it to another company, the buyer promised to keep it going, but it soon became clear that they only bought it to get it off the market. Two years later the original owners then wrote an improved version using better algorythms (they ahd learned from their earlier efforts) and amrketted that under a different name and advertised that it was totally compatible with the earlier program for those that wished to upgrade. Perfectly legal actions - new algorythms made it a new program.
All the above is to do with ownership rights of a product. Copyright laws and IP laws are more to do with the ownership of the concepts within a restricted process. Often people will own the IP and or the copyright but not the product, as it has been sold. An example of that is the court case, may even be finished by now - I have not heard, between SCO and the people who sold them the Unix product rights. The claim is that the rights to sell Unix and Unix licences was sold but not the copyright of the code - would like to know how this went if anyone knows.
Then again patent laws can come into play and further confuse the issue.
An example of the differences between IP rights, patent rights, and product rights is the Swash Plate (I hope I got the spelling right) fancy gizmo on a helicoptor that keeps the blades at different angles of attack between when they are at the front and the back of their circle. The original inventor of the concept owned the IP rights (think he may even be dead now) and a company owns the patent right for the use of this in aeronautical vehicles, yet in the 1980's a fellow was able to get a new patent the very same device in the very same design as he was applying it for use in ground based vehicles - different intended use that was not covered in the original patent.