4
votes
1answer
131 views

Selecting expressions from a sequence that are not subexpressions of earlier elements

I have a While loop that generates and prints an expression on each iteration (there can be thousands of iterations). UPDATE: Some expressions are generated in ...
1
vote
0answers
33 views

Matching Root[…] objects with patterns, unexpected hidden argument

I needed to write patterns that could distinguish between arbitrary-function and polynomial forms of Root objects, for example, ...
2
votes
0answers
30 views

Detecting a more general pattern [duplicate]

I need a function that, given 2 patterns, determines if the first pattern is more general than the second (i.e. that any expression successfully matched by the second, will be successfully matched by ...
9
votes
1answer
207 views

Why is ReplaceAll behaving like this?

I'm learning to use the ReplaceAll function and I found the behavior of which is quite confusing. For Sqrt[f[x, y]] /. f[___] -> u Mathematica returns ...
8
votes
3answers
527 views

Pattern matching a pattern with patterns

Confusing title, I know. But the question is, if we have two patterns which have the same general structure but different names used in the patterns and different names: ...