BUILT-IN MATHEMATICA SYMBOL

FreeQ

FreeQ[expr, form]
yields True if no subexpression in expr matches form, and yields False otherwise.

FreeQ[expr, form, levelspec]
tests only those parts of expr on levels specified by levelspec.

Details and OptionsDetails and Options

• form can be a pattern.
• FreeQ uses standard level specifications:
•  n levels through n Infinity levels through Infinity {n} level n only {n1,n2} levels through
• The default value for levelspec in FreeQ is {0, Infinity}.
• A positive level n consists of all parts of expr specified by n indices.
• A negative level -n consists of all parts of expr with depth n.
• Level consists of numbers, symbols and other objects that do not have subparts.
• Level corresponds to the whole expression.
• With the default option setting , FreeQ looks at heads of expressions, and their parts.

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Test whether a list is free of :

 Out[1]=

FreeQ normally tests all levels in an expression:

 Out[1]=