Inner product grammar is neater than sum(index) in JuMP modeling, But triggers Warning?

I reviewed some math books and concluded that ip (inner product) is a false name which conveyed a misconception. A correction could be

function sm(p, x) return sum(p .* x) end

where s stands for vector sum and m stands for scalar multiplication.

The sm should be a more fundamental operation, which makes sense in, e.g.,
integration theory (p represents a probability measure while x represents a measurable function).

And some related useful formulas are:

  1. @assert sm(A, B) == tr(transpose(A) * B)
  2. @assert transpose(z) * A * w == tr(A * w * transpose(z))
  3. @assert tr(A * B) == tr(B * A) as long as size(A) == size(transpose(B))