I did a simple test like below:
>>> valsH["S0"] = 1
>>> valsH["I1"] = 0
>>> valsH["I2"] = 1
>>> valsH["I0"] = 1
>>> """original position of: not valsH["I1"]"""
>>>
>>> valsH["I0"] and not valsH["I1"] and valsH["I2"] and valsH["S0"]
1
>>> """After moving: not valsH["I1"] to the end of the expression"""
>>>
>>> valsH["I0"] and valsH["I2"] and valsH["S0"] and not valsH["I1"]
True
>>>
So it seems that depending on where
not valsH["I1"]
is, the value of the Boolean equation is printed as '1' or 'True'.
Why is this so?