Complete detection of expressions

Detected expression types: affine, sum of squares, sum of norms.