Types, equations, dimensions and the Pi theorem