type/verify - Maple Programming Help

Online Help

All Products    Maple    MapleSim

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

type/verify

check for the Boolean of verification results

 Calling Sequence type(a, verify(bool))

Parameters

 a - any expression bool - either 'true', 'false', or 'FAIL'

Description

 • Forcing a result from verify to return a Boolean value is too restrictive, so a more general class of objects may be returned, with the Boolean value of these being checked by the above types.
 • A result from a call to verify is considered to be true if the result is true.  A result from a call to verify is considered to be either false or FAIL if either of those values is returned, or if a list containing either false or FAIL as a first operand is returned, respectively.
 • The special verification boolean will convert all return values which are lists to return the first operand of the list.  This can be used if a boolean value is expected by some procedure.
 • The special verification truefalse will convert all return values which are lists to return the false.  This can be used if a truefalse value is expected by some procedure.

Examples

 > $\mathrm{type}\left(\mathrm{true},'\mathrm{verify}'\left('\mathrm{true}'\right)\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(\mathrm{false},'\mathrm{verify}'\left('\mathrm{false}'\right)\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(\left[\mathrm{false},0.100{10}^{8},'\mathrm{ulps}'\right],'\mathrm{verify}'\left('\mathrm{false}'\right)\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{verify}\left(10,10.000001,\mathrm{float}\left(2\right)\right)$
 $\left[{\mathrm{false}}{,}{100.}{,}{\mathrm{ulps}}\right]$ (4)
 > $\mathrm{verify}\left(10,10.000001,\mathrm{boolean}\left(\mathrm{float}\left(2\right)\right)\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{verify}\left(x,\mathrm{\pi },\mathrm{greater_than}\right)$
 ${\mathrm{FAIL}}$ (6)
 > $\mathrm{verify}\left(x,\mathrm{\pi },\mathrm{truefalse}\left(\mathrm{greater_than}\right)\right)$
 ${\mathrm{false}}$ (7)
 > $\mathrm{select}\left(\mathrm{verify},\left[1,2,3,x\right],\mathrm{\pi },\mathrm{less_than}\right)$
 $\left[{1}{,}{2}{,}{3}\right]$ (8)
 > $\mathrm{select}\left(\mathrm{verify},\left[1,2,3,x\right],\mathrm{\pi },\mathrm{truefalse}\left(\mathrm{less_than}\right)\right)$
 $\left[{1}{,}{2}{,}{3}\right]$ (9)

 See Also