Questions on expression testing and manipulation through pattern matching and constructing efficient patterns.
21
votes
0answers
300 views
How is pattern specificity decided?
Mathematica has a notion of pattern specificity, which is a partial ordering on patterns.
The rules (e.g. DownValues, ...
18
votes
0answers
121 views
Why is StringExpression faster than RegularExpression?
Edit: as noted by Albert Retey the performance difference is only seen when sub expression extraction is performed. If this test is used below the timings are similar:
...
5
votes
0answers
70 views
Convert logical relational expression to / from disjunctive and conjunctive forms?
I would like to convert logical relational expressions in disjunctive form, e.g.,
$$(x \lt -1) \lor (-1 \lt x \lt +1) \lor (x \gt +1)$$
into conjunctive form, e.g.,
$$(x \ne -1) \land (x \ne +1)$$
...
2
votes
0answers
99 views
I am missing a function like HoldPattern
Temporary message: I am planning to edit this question, making the examples less confusing and by moving the things that are confusing to a separate question
For any confusion about expressions that ...
0
votes
0answers
94 views
How to collect terms of a given type (with subscript and power) in an expression?
Suppose that I have an expression:
...
