function - Maple Help

type/function

check for a function

 Calling Sequence type(expr, function) type(expr, function(vtype))

Parameters

 expr - any expression vtype - type

Description

 • The call type(expr, function) checks if expr is of the form name(args), where args is an expression sequence of zero or more items.  Expressions of type function represent function calls. For more information, see function.
 • A mathematical "function" in Maple can be defined using a functional operator.  Use these to define a function of a single variable, a multivariate function, or a vector function.
 Note that in Maple it is the procedure type, rather than function type that corresponds to what you think of as a "mathematical function".
 • If the parameter vtype is given, then it also checks that each argument is of type vtype.
 • A "function" can also be something written in infix notation, for example,
 > type(a &q b, function);
 ${\mathrm{true}}$ (1)
 This does not include the infix operators +, -, *, /, ^, ||, =, <, >, <=, >=, <>, .., ::, and, implies, or, and xor, but it does include @, @@, ., \$, mod, union, intersect, minus, subset, &*, and all other operators starting with &.

Examples

 > $\mathrm{type}\left(\mathrm{sin}\left(x\right),\mathrm{function}\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(\mathrm{sin},\mathrm{function}\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{type}\left(f\left(\right),\mathrm{function}\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{type}\left(f\left(x,y,z\right),\mathrm{function}\right)$
 ${\mathrm{true}}$ (5)
 > $\mathrm{type}\left(f\left(x,y,z\right),\mathrm{function}\left(\mathrm{name}\right)\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{type}\left(f\left(1,y,z\right),\mathrm{function}\left(\mathrm{name}\right)\right)$
 ${\mathrm{false}}$ (7)
 > $\mathrm{type}\left(a+b,'\mathrm{function}'\right)$
 ${\mathrm{false}}$ (8)
 > $\mathrm{type}\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{and}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b,'\mathrm{function}'\right)$
 ${\mathrm{false}}$ (9)
 > $\mathrm{type}\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{union}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b,'\mathrm{function}'\right)$
 ${\mathrm{true}}$ (10)