How would you interpret |a|b|c|? As Abs[aAbs[b]c] or as Abs[a]bAbs[c]?
You're right. It's not clear what's meant here. But It wouldn't be clear to a human reader either.
If you type this exact phrase into Wolfram Alpha, it's interpreted as |a|*b*|c|
and that seems reasonable to me.
What surprises me is that |(a|b|c)|
isn't interpreted correctly by Wolfram Alpha.
Have you considered using [LeftBracketingBar] and [RightBracketingBar]?
Since \[VerticalBar]
is used for Alternatives already this could be the way to go.
But for a human reader those Symbols look exactly the same. And it would not be clear if it's used for the mathematical purpose or the pattern purpose.
One more complication is that we have to deal with Abs[x] and RealAbs[x]. TraditionalForm does not make any visual distinction between the two, except in the Tooltip.
Maybe I'm missing something but isn't Abs[...]
the general function? With a real input it would just work like RealAbs[...]
.
After reading the Documentation of Abs
, Norm
and Det
I also realized that the behavior regarding Lists (Vectors and Matrices) aren't clear either.
Abs[x]
would return the list of absolute values
Norm[x]
would return the Norm (obviously)
Det[x]
would return the Determinant of a matrix
All these meanings could be represented by |x|
.
I'd say the intuitive meaning would be to use
Abs[x]
if x is a single value. (Real or Complex)
Norm[x]
if x is a one dimensional list or a N x M matrix with N=/=M
- 'Det[x]' if x is a N x N matrix
But this would mean |x|
couldn't be replaced with a definite function. But rather had to be evaluated in respect to the datatype of x.
This just wouldn't be coherent enough to be placed inside Wolfram Language.