has - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


has

test for a specified subexpression

 

Calling Sequence

Parameters

Description

Thread Safety

Examples

Calling Sequence

has(f, x)

Parameters

f

-

expression

x

-

expression, list or set of expressions

Description

• 

The has(f, x) function returns true if f contains the expression x;  otherwise false is returned.

  

The expression f contains x if and only if a subexpression of f (as defined by Maple's op function) is equal to x.

  

Note:  If f contains x, it does not necessarily mean that f functionally depends on x.

• 

If x is a list or set, then f contains x if and only if f contains at least one item in x.  That is, has(f,{x,y}) is equivalent to has(f,x) or has(f,y).

• 

If the item that you want has to search for is itself a list or set, you must enclose it in a list or set. Otherwise, has will search for items in the list or set as described above.

• 

Since has must traverse the entire expression tree for f, it can be an expensive operation. Do not use has, when member will serve just as well.

Thread Safety

• 

The has command is thread-safe as of Maple 15.

• 

For more information on thread safety, see index/threadsafe.

Examples

(1)

(2)

(3)

(4)

(5)

(6)

(7)

(8)

(9)

(10)

(11)

(12)

(13)

(14)

(15)

(16)

(17)

(18)

See Also

depends

hasfun

hastype

member

numboccur

op

 


Download Help Document