verify/boolean - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Programming : Logic : Boolean : verify : verify/boolean

verify/boolean

return a Boolean comparison or result

verify/truefalse

return a truefalse comparison or result

 Calling Sequence verify(expr1, expr2, boolean) verify(expr1, expr2, boolean(ver)) verify(expr1, expr2, truefalse) verify(expr1, expr2, truefalse(ver))

Parameters

 expr1, expr2 - anything ver - verification

Description

 • The verify(expr1, expr2, boolean) and verify(expr1, expr2, truefalse) calling sequences perform an evalb comparison. That is, verify(a, b, boolean) = evalb(a = b) and verify(a, b, truefalse) = evalb(a = b).
 • If a verification ver is given, then boolean acts as a filter, converting anything returned by verify into either true, false, or FAIL.
 • The verification truefalse makes one further change, converting any FAIL results into false.
 • These are useful in case the result from verify is to be used as input to another procedure such as sort or select.
 • The verifications boolean and truefalse are symmetric and a verification boolean(ver) is symmetric if and only if the verification ver is symmetric. If a verification ver is symmetric, then this implies that the verification truefalse(ver) is symmetric.

Examples

 > $\mathrm{evalb}\left(\left[\mathrm{undefined}\right]=\left[\mathrm{undefined}\right]\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{verify}\left(\left[\mathrm{undefined}\right],\left[\mathrm{undefined}\right],'\mathrm{boolean}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{verify}\left(\left[\mathrm{undefined}\right],\left[\mathrm{undefined}\right],'\mathrm{list}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{verify}\left({\left(x-1\right)}^{2},{x}^{2}-2x+1,'\mathrm{boolean}'\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{verify}\left(\left[3\right],3,'\mathrm{list}'\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{verify}\left(\left[3\right],3,'\mathrm{boolean}\left(\mathrm{list}\right)'\right)$
 ${\mathrm{false}}$ (6)
 > $\mathrm{verify}\left(0.3232,0.3233,'\mathrm{float}\left(1\right)'\right)$
 $\left[{\mathrm{false}}{,}{1.}{}{{10}}^{{6}}{,}{\mathrm{ulps}}\right]$ (7)
 > $\mathrm{verify}\left(0.3232,0.3233,'\mathrm{boolean}\left(\mathrm{float}\left(1\right)\right)'\right)$
 ${\mathrm{false}}$ (8)
 > $\mathrm{verify}\left(\mathrm{sin}\left(x\right),0,\mathrm{greater_than}\right)$
 ${\mathrm{FAIL}}$ (9)
 > $\mathrm{verify}\left(\mathrm{sin}\left(x\right),0,\mathrm{boolean}\left(\mathrm{greater_than}\right)\right)$
 ${\mathrm{FAIL}}$ (10)
 > $\mathrm{verify}\left(\mathrm{sin}\left(x\right),0,\mathrm{truefalse}\left(\mathrm{greater_than}\right)\right)$
 ${\mathrm{false}}$ (11)
 > $\mathrm{map}\left(\mathrm{verify},\left[3,5,a,b,ⅇ,{ⅇ}^{2}\right],\mathrm{π},\mathrm{less_than}\right)$
 $\left[{\mathrm{true}}{,}{\mathrm{false}}{,}{\mathrm{FAIL}}{,}{\mathrm{FAIL}}{,}{\mathrm{true}}{,}{\mathrm{false}}\right]$ (12)
 > $\mathrm{map}\left(\mathrm{verify},\left[3,5,a,b,ⅇ,{ⅇ}^{2}\right],\mathrm{π},\mathrm{truefalse}\left(\mathrm{less_than}\right)\right)$
 $\left[{\mathrm{true}}{,}{\mathrm{false}}{,}{\mathrm{false}}{,}{\mathrm{false}}{,}{\mathrm{true}}{,}{\mathrm{false}}\right]$ (13)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam