A General Theory of Optimal Plastic Design