Consistent derivation of the constitutive algorithm for plane stress isotropic plasticity. Part I: Theoretical formulation