FAIL - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


The Constant FAIL

 

Description

Truth Table for Logical Operators

Examples

Description

• 

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.

Truth Table for Logical Operators

• 

The evaluation of a logical expression yields true, false, or FAIL according to the following table.

 

 

 

and

 

 

 

or

 

 

not

 

 

true

false

FAIL

 

true

false

FAIL

 

 

true

 

true

false

FAIL

 

true

true

true

 

false

false

 

false

false

false

 

true

false

FAIL

 

true

FAIL

 

FAIL

false

FAIL

 

true

FAIL

FAIL

 

FAIL

 

 

 

xor

 

 

 

implies

 

 

 

true

false

FAIL

 

true

false

FAIL

true

 

false

true

FAIL

 

true

false

FAIL

false

 

true

false

FAIL

 

true

true

true

FAIL

 

FAIL

FAIL

FAIL

 

true

FAIL

FAIL

Examples

true and FAIL, false or FAIL, not FAIL, FAIL or true;

FAIL,FAIL,FAIL,true

(1)

testeqLambertWxx

FAIL

(2)

FAILFAIL

FAIL

(3)

isγ,rational

FAIL

(4)

See Also

boolean

if

`if`

initialconstants