type/boolean - Maple Programming Help

Home : Support : Online Help : Programming : Logic : Relations : type checking : type/boolean

type/boolean

check for type Boolean

type/relation

check for type relation

type/logical

check for type logical

 Calling Sequence type(expr, boolean) type(expr, relation) type(expr, logical)

Parameters

 expr - any expression

Description

 • These functions return true if expr is of the specified type, and false otherwise.
 • An expression is of type boolean if it is of type relation, type logical or one of the Boolean constants true, false, or FAIL.
 • An expression is of type relation if it is of type $\mathrm{=}$, $\mathrm{<>}$, $\mathrm{<}$, or $\mathrm{<=}$.
 • An expression is of type logical if it is of type and, or, xor, implies, or not.
 • Note: Expressions formed using the operators > and >= are automatically converted to expressions of type < and <=, respectively.

Examples

 > $\mathrm{type}\left(x<5,\mathrm{relation}\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(a\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{or}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{not}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}b,\mathrm{logical}\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(1<2\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{and}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}5
 ${\mathrm{true}}$ (3)