Sometimes I run into conditions like the one below:
if([A]=[B],true(),false())
Apparently, the expression returns either true or false.
But the condition [A]=[B]
can already be only true or false! Basically, it’s a tautology: IF true THEN true, IF false THEN false. Therefore the expression can be simplified and reduced to
[A]=[B]
The example can be generalized. Any expression that have the following pattern:
if(condition, true(), false())
Can be reduced to
condition
And its result will be either true or false.
OK, but how about this? (notice true()
and false()
swapped)
if([A]=[B],false(),true())
Well, it’s effectively
if(not [A]=[B],true(), false())
Therefore it can be replaced with
not [A]=[B]
Or, if you wish, with
[A]!=[B]