The Constant FAIL
Description
Truth Table for Logical Operators
Examples
FAIL is a Maple symbol which has several special properties.
FAIL is used by Boolean logic to mean an unknown or undetermined value. When used inside Boolean expressions with and, or, and not, it behaves like standard three-valued logic.
Many functions return FAIL when they are unable to produce a definitive result. For example, is and testeq will return FAIL when it cannot be determined with certainty whether the value is true or false.
As a Boolean condition in an if or while statement or `if` expression, a FAIL has the same effect as a false. That is, the if will take the else branch and the while will stop the iteration. Notice that when a FAIL value is possible,
if expr then a else b end if;
is not equivalent to
if not expr then b else a end if;
Arithmetic with FAIL is valid but limited, and the value of FAIL is contagious over the basic arithmetic operations. In other words, expressions such as 2 + FAIL, FAIL - FAIL, and FAIL/FAIL will all return FAIL.
The evaluation of a logical expression yields true, false, or FAIL according to the following table.
and
or
not
true
false
FAIL
xor
implies
true and FAIL, false or FAIL, not FAIL, FAIL or true;
FAIL,FAIL,FAIL,true
testeq⁡LambertW⁡x−x
FAIL−FAIL
is⁡γ,rational
See Also
boolean
if
`if`
initialconstants
Download Help Document