 type/truefalseFAIL - Maple Programming Help

Home : Support : Online Help : Programming : Data Types : Type Checking : Types : type/truefalseFAIL

type/truefalseFAIL

test for an expression of type truefalseFAIL

type/boolean_constant

test for an expression of type boolean_constant

 Calling Sequence type(e::anything, 'truefalseFAIL') type(e::anything, 'boolean_constant')

Parameters

 e - Maple expression

Description

 • Maple ordinarily uses a three-valued logic using the Boolean values true, false, and FAIL. The Maple type truefalseFAIL describes this set of values.
 • The expression type(e,'truefalseFAIL') evaluates to true if, and only if, the expression e is of type truefalseFAIL, which is defined as the expressions true, false, and FAIL. No other expression is of type truefalseFAIL.
 • The type boolean_constant is a synonym for truefalseFAIL and behaves identically.
 • Note that every expression that is of type truefalseFAIL is also of type boolean, but that the converse is not true.  Expressions of type relation such as x and y where x and y are symbols, are of type boolean but not of truefalseFAIL.
 • The type truefalse refers to only the two Boolean values true and false and excludes the value FAIL.

Subtypes

 •

Supertypes

 •

Examples

 > $\mathrm{type}\left(\mathrm{true},'\mathrm{truefalseFAIL}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(\mathrm{false},'\mathrm{truefalseFAIL}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(\mathrm{FAIL},'\mathrm{truefalseFAIL}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(x\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{and}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}y,'\mathrm{truefalseFAIL}'\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{type}\left(x\le y,'\mathrm{truefalseFAIL}'\right)$
 ${\mathrm{false}}$ (5)
 > type( proc() true; end proc, 'truefalseFAIL' );
 ${\mathrm{false}}$ (6)
 > $\mathrm{type}\left({x}^{2}-3,'\mathrm{truefalseFAIL}'\right)$
 ${\mathrm{false}}$ (7)

Compatibility

 • The type/truefalseFAIL and type/boolean_constant commands were introduced in Maple 2015.