%mathpiper,def="HasExprArith"

/// Analyse arithmetic expressions

HasExprArith(expr, atom) := HasExprSome(expr, atom, {ToAtom("+"), ToAtom("-"), *, /});


%/mathpiper



%mathpiper_docs,name="HasExprArith",categories="User Functions;Predicates"
*CMD HasExprArith --- check for expression containing a subexpression
*STD
*CALL
	HasExprArith(expr, x)

*PARMS

{expr} -- an expression

{x} -- a subexpression to be found

*DESC

{HasExprArith} is defined through {HasExprSome} to look only at arithmetic operations {+}, {-}, {*}, {/}.

Note that since the operators "{+}" and "{-}" are prefix as well as infix operators, it is currently required to use {ToAtom("+")} to obtain the unevaluated atom "{+}".

*E.G.

In> HasExprArith(x+y*Cos(Ln(x)/x), z)
Result: False;

*SEE HasExpr, HasExprSome, FuncList, VarList, HasFunc
%/mathpiper_docs