The code is attached in the image.
So the question is whether an object of type OneLeggedRobot is subsitutable for its supertype Robot.
The answer key said the answer was no because the subtype (OneLeggedRobot) has a stronger precondition than Robot.
But my class notes says that the precondition is weakened when the subtype method requires less from its caller than the supertype method.
Going by my class notes I thought the precondition was weakened the subtype needs direction to be 1 or 3 and the supertype needs direction to be 1,2 or 3. In other words if the precondition of the supertype holds, the precondition of the subtype will also hold.
And what about the postcondition? I think the subtype has a weaker post-condition than the supertype because the supertype does more (it includes a specified direction for 2). Is that correct or am I completely backwards?