Nothing prevents you from testing the condition
1 < -3 < 4
in this case there is no performance gain, on the contrary you’ll have performed one extra test.
In addition, the parser should know in advance that the operator <
is transitive, it can’t assume transitivity in all cases such this. Consider the case a < b > c
, the parser should know that <
and >
are opposite, so transitivity can’t be assumed there. It won’t work with arbitrary comparison operators. Is all this worth?