The inner product for slices containing Boolean elements.
Uses add or checked_add to sum the elements of the RHS that
correspond to true elements of the boolean slice.
An implementation of inner product that piggies back
on the MulByScalar and CheckedAdd traits.
It does mul_by_scalar for products of terms
and then combines the results using either add or checked_add.