07-28-2022, 04:34 PM
I think the biggest problem with IMP is that folks think of it logically, and not programmatically.
In logic, we can say something such as NOT TRUE = FALSE. When coding, however, that statement doesn't hold true, *except in very limited situations*.
NOT -1 = 0. In this case, -1 is TRUE and 0 is FALSE, so the statement NOT TRUE = FALSE is correct.
But what if we NOT a different value?
NOT -2 = 1. In this case -2 is TRUE, and 1 *is also* TRUE.
NOT (a true condition) is *ONLY* a FALSE condition, when that condition is -1. In all other cases, it's still TRUE.
Logically, we think that NOT TRUE is FALSE, but when coding, that's only accurate in the limited condition that our truth value is -1. One could break the logic down just as simple to:
IF A = -1 THEN
'NOT A is FALSE
ELSE
'NOT A is TRUE
END IF
----------------------------
IMP breaks down to the same type of simplified logic. When dealing with A IMP B, it's:
IF A =-1 AND B = 0 THEN
'A IMP B is FALSE
ELSE
'A IMP B is TRUE
END IF
In logic, we can say something such as NOT TRUE = FALSE. When coding, however, that statement doesn't hold true, *except in very limited situations*.
NOT -1 = 0. In this case, -1 is TRUE and 0 is FALSE, so the statement NOT TRUE = FALSE is correct.
But what if we NOT a different value?
NOT -2 = 1. In this case -2 is TRUE, and 1 *is also* TRUE.
NOT (a true condition) is *ONLY* a FALSE condition, when that condition is -1. In all other cases, it's still TRUE.
Logically, we think that NOT TRUE is FALSE, but when coding, that's only accurate in the limited condition that our truth value is -1. One could break the logic down just as simple to:
IF A = -1 THEN
'NOT A is FALSE
ELSE
'NOT A is TRUE
END IF
----------------------------
IMP breaks down to the same type of simplified logic. When dealing with A IMP B, it's:
IF A =-1 AND B = 0 THEN
'A IMP B is FALSE
ELSE
'A IMP B is TRUE
END IF