Theory of polar semiconductor surfaces