File: preds.chapt.txt

package info (click to toggle)
yacas 1.3.3-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 6,940 kB
  • ctags: 5,971
  • sloc: cpp: 16,934; java: 12,472; ansic: 11,041; sh: 4,053; makefile: 564; perl: 517
file content (953 lines) | stat: -rw-r--r-- 18,862 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953

			Predicates

*INTRO
A predicate is a function that returns a boolean value, i.e. {True} or {False}. Predicates are
often used in patterns, For instance, a rule that only holds for a
positive integer would use a pattern such as {n_IsPositiveInteger}.


*CMD != --- test for "not equal"
*STD
*CALL
	e1 != e2
Precedence:
*EVAL OpPrecedence("!=")


*PARMS

{e1}, {e2} -- expressions to be compared

*DESC

Both expressions are evaluated and compared. If they turn out to be
equal, the result is {False}. Otherwise, the result
is {True}.

The expression {e1 != e2} is equivalent to {Not(e1 = e2)}.

*E.G.

	In> 1 != 2;
	Out> True;
	In> 1 != 1;
	Out> False;

*SEE =

*CMD = --- test for equality of expressions
*STD
*CALL
	e1 = e2
Precedence:
*EVAL OpPrecedence("=")


*PARMS

{e1}, {e2} -- expressions to be compared

*DESC

Both expressions are evaluated and compared. If they turn out to be equal, the
result is {True}. Otherwise, the result is {False}. The function {Equals} does
the same.

Note that the test is on syntactic equality, not mathematical equality. Hence
even if the result is {False}, the expressions can still be
<i>mathematically</i> equal; see the examples below. Put otherwise, this
function tests whether the two expressions would be displayed in the same way
if they were printed.

*E.G.

	In> e1 := (x+1) * (x-1);
	Out> (x+1)*(x-1);
	In> e2 := x^2 - 1;
	Out> x^2-1;
	
	In> e1 = e2;
	Out> False;
	In> Expand(e1) = e2;
	Out> True;

*SEE !=, Equals

*CMD Not --- logical negation
*CORE
*CALL
	Not expr

*PARMS

{expr} -- a boolean expression

*DESC

Not returns the logical negation of the argument expr. If {expr} is
{False} it returns {True}, and if {expr} is {True}, {Not expr} returns {False}.
If the argument is neither {True} nor {False}, it returns the entire
expression with evaluated arguments.

*E.G.

	In> Not True
	Out> False;
	In> Not False
	Out> True;
	In> Not(a)
	Out> Not a;

*SEE And, Or

*CMD And --- logical conjunction
*CORE
*CALL
	a1 And a2
Precedence:
*EVAL OpPrecedence("And")

	And(a1, a2, a3, ..., aN)

*PARMS

{a}1, ..., {a}N -- boolean values (may evaluate to {True} or {False})

*DESC

This function returns {True} if all arguments are true. The
{And} operation is "lazy", i.e. it returns {False} as soon as a {False} argument
is found (from left to right). If an argument other than {True} or
{False} is encountered a new {And} expression is returned with all
arguments that didn't evaluate to {True} or {False} yet.

*E.G.

	In> True And False
	Out> False;
	In> And(True,True)
	Out> True;
	In> False And a
	Out> False;
	In> True And a
	Out> And(a);
	In> And(True,a,True,b)
	Out> b And a;

*SEE Or, Not

*CMD Or --- logical disjunction
*CORE
*CALL
	a1 Or a2
Precedence:
*EVAL OpPrecedence("Or")
	Or(a1, a2, a3, ..., aN)

*PARMS

{a}1, ..., {a}N -- boolean expressions (may evaluate to {True} or {False})

*DESC

This function returns {True} if an argument is encountered
that is true (scanning from left to right). The
{Or} operation is "lazy", i.e. it returns {True} as soon as a {True} argument
is found (from left to right). If an argument other than {True} or
{False} is encountered, an unevaluated {Or} expression is returned with all
arguments that didn't evaluate to {True} or {False} yet.

*E.G.

	In> True Or False
	Out> True;
	In> False Or a
	Out> Or(a);
	In> Or(False,a,b,True)
	Out> True;

*SEE And, Not

*CMD IsFreeOf --- test whether expression depends on variable
*STD
*CALL
	IsFreeOf(var, expr)
	IsFreeOf({var, ...}, expr)

*PARMS

{expr} -- expression to test

{var} -- variable to look for in "expr"

*DESC

This function checks whether the expression "expr" (after being
evaluated) depends on the variable "var". It returns {False} if this is the case and {True}
otherwise.

The second form test whether the expression depends on <i>any</i> of
the variables named in the list. The result is {True} if none of the variables appear in the expression and {False} otherwise.

*E.G.

	In> IsFreeOf(x, Sin(x));
	Out> False;
	In> IsFreeOf(y, Sin(x));
	Out> True;
	In> IsFreeOf(x, D(x) a*x+b);
	Out> True;
	In> IsFreeOf({x,y}, Sin(x));
	Out> False;

The third command returns {True} because the
expression {D(x) a*x+b} evaluates to {a}, which does not depend on {x}.

*SEE Contains

*CMD IsZeroVector --- test whether list contains only zeroes
*STD
*CALL
	IsZeroVector(list)

*PARMS

{list} -- list to compare against the zero vector

*DESC

The only argument given to {IsZeroVector} should be
a list. The result is {True} if the list contains
only zeroes and {False} otherwise.

*E.G.

	In> IsZeroVector({0, x, 0});
	Out> False;
	In> IsZeroVector({x-x, 1 - D(x) x});
	Out> True;

*SEE IsList, ZeroVector

*CMD IsNonObject --- test whether argument is not an {Object()}
*STD
*CALL
	IsNonObject(expr)

*PARMS

{expr} -- the expression to examine

*DESC

This function returns {True} if "expr" is not of
the form {Object(...)} and {False}
otherwise.

*HEAD Bugs

In fact, the result is always {True}.

*SEE Object

*CMD IsEven --- test for an even integer
*STD
*CALL
	IsEven(n)

*PARMS

{n} -- integer to test

*DESC

This function tests whether the integer "n" is even. An integer is
even if it is divisible by two. Hence the even numbers are 0, 2, 4, 6,
8, 10, etc., and -2, -4, -6, -8, -10, etc.

*E.G.

	In> IsEven(4);
	Out> True;
	In> IsEven(-1);
	Out> False;

*SEE IsOdd, IsInteger

*CMD IsOdd --- test for an odd integer
*STD
*CALL
	IsOdd(n)

*PARMS

{n} -- integer to test

*DESC

This function tests whether the integer "n" is odd. An integer is
odd if it is not divisible by two. Hence the odd numbers are 1, 3, 5,
7, 9, etc., and -1, -3, -5, -7, -9, etc.

*E.G.

	In> IsOdd(4);
	Out> False;
	In> IsOdd(-1);
	Out> True;

*SEE IsEven, IsInteger




*CMD IsEvenFunction --- Return true if function is an even function, False otherwise
*CMD IsOddFunction --- Return true if function is an odd function, False otherwise

*STD
*CALL
	IsEvenFunction(expression,variable)
	IsOddFunction(expression,variable)

*PARMS

{expression} -- mathematical expression
{variable} -- variable

*DESC

These functions return True if Yacas can determine that the
function is even or odd respectively. Even functions are
defined to be functions that have the property:

$$ f(x) = f(-x) $$

And odd functions have the property:

$$ f(x) = -f(-x) $$

{Sin(x)} is an example of an odd function, and {Cos(x)}
is an example of an even function.

As a side note, one can decompose a function into an
even and an odd part:

$$ f(x) = f_even(x) + f_odd(x) $$

Where 

$$ f_even(x) = (f(x)+f(-x))/2 $$

and

$$ f_odd(x) = (f(x)-f(-x))/2 $$

*EG

	In> IsEvenFunction(Cos(b*x),x)
	Out> True
	In> IsOddFunction(Cos(b*x),x)
	Out> False
	In> IsOddFunction(Sin(b*x),x)
	Out> True
	In> IsEvenFunction(Sin(b*x),x)
	Out> False
	In> IsEvenFunction(1/x^2,x)
	Out> True
	In> IsEvenFunction(1/x,x)
	Out> False
	In> IsOddFunction(1/x,x)
	Out> True
	In> IsOddFunction(1/x^2,x)
	Out> False

*SEE Sin, Cos



*CMD IsFunction --- test for a composite object
*CORE
*CALL
	IsFunction(expr)

*PARMS

{expr} -- expression to test

*DESC

This function tests whether "expr" is a composite object, i.e. not an
atom. This includes not only obvious functions such as {f(x)}, but also expressions such as {x+5} and lists.

*E.G.

	In> IsFunction(x+5);
	Out> True;
	In> IsFunction(x);
	Out> False;

*SEE IsAtom, IsList, Type

*CMD IsAtom --- test for an atom
*CORE
*CALL
	IsAtom(expr)

*PARMS

{expr} -- expression to test

*DESC

This function tests whether "expr" is an atom. Numbers, strings, and
variables are all atoms.

*E.G.

	In> IsAtom(x+5);
	Out> False;
	In> IsAtom(5);
	Out> True;

*SEE IsFunction, IsNumber, IsString

*CMD IsString --- test for an string
*CORE
*CALL
	IsString(expr)

*PARMS

{expr} -- expression to test

*DESC

This function tests whether "expr" is a string. A string is a text
within quotes, e.g. {"duh"}.

*E.G.

	In> IsString("duh");
	Out> True;
	In> IsString(duh);
	Out> False;

*SEE IsAtom, IsNumber

*CMD IsNumber --- test for a number
*CORE
*CALL
	IsNumber(expr)

*PARMS

{expr} -- expression to test

*DESC

This function tests whether "expr" is a number. There are two kinds
of numbers, integers (e.g. 6) and reals (e.g. -2.75 or 6.0). Note that a
complex number is represented by the {Complex}
function, so {IsNumber} will return {False}.

*E.G.

	In> IsNumber(6);
	Out> True;
	In> IsNumber(3.25);
	Out> True;
	In> IsNumber(I);
	Out> False;
	In> IsNumber("duh");
	Out> False;

*SEE IsAtom, IsString, IsInteger, IsPositiveNumber, IsNegativeNumber, Complex

*CMD IsList --- test for a list
*CORE
*CALL
	IsList(expr)

*PARMS

{expr} -- expression to test

*DESC

This function tests whether "expr" is a list. A list is a sequence
between curly braces, e.g. {{2, 3, 5}}.

*E.G.

	In> IsList({2,3,5});
	Out> True;
	In> IsList(2+3+5);
	Out> False;

*SEE IsFunction

*CMD IsNumericList --- test for a list of numbers
*STD
*CALL
	IsNumericList({list})

*PARMS

{{list}} -- a list

*DESC
Returns {True} when called on a list of numbers or expressions that evaluate to numbers using {N()}. Returns {False} otherwise.

*SEE N, IsNumber

*CMD IsBound --- test for a bound variable
*CORE
*CALL
	IsBound(var)

*PARMS

{var} -- variable to test

*DESC

This function tests whether the variable "var" is bound, i.e. whether
it has been assigned a value. The argument "var" is not evaluated.

*E.G.

	In> IsBound(x);
	Out> False;
	In> x := 5;
	Out> 5;
	In> IsBound(x);
	Out> True;

*SEE IsAtom

*CMD IsBoolean --- test for a Boolean value
*STD
*CALL
	IsBoolean(expression)

*PARMS

{expression} -- an expression

*DESC

IsBoolean returns True if the argument is of a boolean type.
This means it has to be either True, False, or an expression involving
functions that return a boolean result, e.g.
{=}, {>}, {<}, {>=}, {<=}, {!=}, {And}, {Not}, {Or}.

*E.G.

	In> IsBoolean(a)
	Out> False;
	In> IsBoolean(True)
	Out> True;
	In> IsBoolean(a And b)
	Out> True;

*SEE True, False

*CMD IsNegativeNumber --- test for a negative number
*STD
*CALL
	IsNegativeNumber(n)

*PARMS

{n} -- number to test

*DESC

{IsNegativeNumber(n)} evaluates to {True} if $n$ is (strictly) negative, i.e.
if $n<0$. If {n} is not a number, the functions return {False}. 

*E.G.

	In> IsNegativeNumber(6);
	Out> False;
	In> IsNegativeNumber(-2.5);
	Out> True;

*SEE IsNumber, IsPositiveNumber, IsNotZero, IsNegativeInteger, IsNegativeReal

*CMD IsNegativeInteger --- test for a negative integer
*STD
*CALL
	IsNegativeInteger(n)

*PARMS

{n} -- integer to test

*DESC

This function tests whether the integer {n} is (strictly)
negative. The negative integers are -1, -2, -3, -4, -5, etc. If
{n} is not a integer, the function returns {False}.

*E.G.

	In> IsNegativeInteger(31);
	Out> False;
	In> IsNegativeInteger(-2);
	Out> True;

*SEE IsPositiveInteger, IsNonZeroInteger, IsNegativeNumber

*CMD IsPositiveNumber --- test for a positive number
*STD
*CALL
	IsPositiveNumber(n)

*PARMS

{n} -- number to test

*DESC

{IsPositiveNumber(n)} evaluates to {True} if $n$ is (strictly) positive, i.e.
if $n>0$. If {n} is not a number the function returns {False}.

*E.G.

	In> IsPositiveNumber(6);
	Out> True;
	In> IsPositiveNumber(-2.5);
	Out> False;

*SEE IsNumber, IsNegativeNumber, IsNotZero, IsPositiveInteger, IsPositiveReal

*CMD IsPositiveInteger --- test for a positive integer
*STD
*CALL
	IsPositiveInteger(n)

*PARMS

{n} -- integer to test

*DESC

This function tests whether the integer {n} is (strictly) positive. The
positive integers are 1, 2, 3, 4, 5, etc. If {n} is not a integer, the
function returns {False}.

*E.G.

	In> IsPositiveInteger(31);
	Out> True;
	In> IsPositiveInteger(-2);
	Out> False;

*SEE IsNegativeInteger, IsNonZeroInteger, IsPositiveNumber

*CMD IsNotZero --- test for a nonzero number
*STD
*CALL
	IsNotZero(n)

*PARMS

{n} -- number to test

*DESC

{IsNotZero(n)} evaluates to {True} if {n} is not zero. In case {n} is not a
number, the function returns {False}.

*E.G.

	In> IsNotZero(3.25);
	Out> True;
	In> IsNotZero(0);
	Out> False;

*SEE IsNumber, IsPositiveNumber, IsNegativeNumber, IsNonZeroInteger

*CMD IsNonZeroInteger --- test for a nonzero integer
*STD
*CALL
	IsNonZeroInteger(n)

*PARMS

{n} -- integer to test

*DESC

This function tests whether the integer {n} is not zero. If {n} is
not an integer, the result is {False}.

*E.G.

	In> IsNonZeroInteger(0)
	Out> False;
	In> IsNonZeroInteger(-2)
	Out> True;

*SEE IsPositiveInteger, IsNegativeInteger, IsNotZero

*CMD IsInfinity --- test for an infinity
*STD
*CALL
	IsInfinity(expr)

*PARMS

{expr} -- expression to test

*DESC

This function tests whether {expr} is an infinity. This is only the
case if {expr} is either {Infinity} or {-Infinity}.

*E.G.

	In> IsInfinity(10^1000);
	Out> False;
	In> IsInfinity(-Infinity);
	Out> True;

*SEE Integer

*CMD IsPositiveReal --- test for a numerically positive value
*STD
*CALL
	IsPositiveReal(expr)

*PARMS

{expr} -- expression to test

*DESC

This function tries to approximate "expr" numerically. It returns {True} if this approximation is positive. In case no
approximation can be found, the function returns {False}. Note that round-off errors may cause incorrect
results.

*E.G.

	In> IsPositiveReal(Sin(1)-3/4);
	Out> True;
	In> IsPositiveReal(Sin(1)-6/7);
	Out> False;
	In> IsPositiveReal(Exp(x));
	Out> False;

The last result is because {Exp(x)} cannot be
numerically approximated if {x} is not known. Hence
Yacas can not determine the sign of this expression.

*SEE IsNegativeReal, IsPositiveNumber, N

*CMD IsNegativeReal --- test for a numerically negative value
*STD
*CALL
	IsNegativeReal(expr)

*PARMS

{expr} -- expression to test

*DESC

This function tries to approximate {expr} numerically. It returns {True} if this approximation is negative. In case no
approximation can be found, the function returns {False}. Note that round-off errors may cause incorrect
results.

*E.G.

	In> IsNegativeReal(Sin(1)-3/4);
	Out> False;
	In> IsNegativeReal(Sin(1)-6/7);
	Out> True;
	In> IsNegativeReal(Exp(x));
	Out> False;

The last result is because {Exp(x)} cannot be
numerically approximated if {x} is not known. Hence
Yacas can not determine the sign of this expression.

*SEE IsPositiveReal, IsNegativeNumber, N

*CMD IsConstant --- test for a constant
*STD
*CALL
	IsConstant(expr)

*PARMS

{expr} -- some expression

*DESC

{IsConstant} returns {True} if the
expression is some constant or a function with constant arguments. It
does this by checking that no variables are referenced in the
expression. {Pi} is considered a constant.

*E.G.

	In> IsConstant(Cos(x))
	Out> False;
	In> IsConstant(Cos(2))
	Out> True;
	In> IsConstant(Cos(2+x))
	Out> False;

*SEE IsNumber, IsInteger, VarList


*CMD IsGaussianInteger ---  test for a Gaussian integer
*STD
*CALL
	IsGaussianInteger(z)
*PARMS

{z} -- a complex or real number	

*DESC

This function returns {True} if the argument is a Gaussian integer and {False} otherwise.
A Gaussian integer is a generalization
of integers into the complex plane. A complex number $a+b*I$ is a Gaussian
integer if and only if $a$ and $b$ are integers.

*E.G.
	In> IsGaussianInteger(5)
	Out> True;
	In> IsGaussianInteger(5+6*I)
	Out> True;
	In> IsGaussianInteger(1+2.5*I)
	Out> False;

*SEE  IsGaussianUnit, IsGaussianPrime


*CMD MatchLinear --- match an expression to a polynomial of degree one in a variable
*STD
*CALL
	MatchLinear(x,expr)

*PARMS

{x} -- variable to express the univariate polynomial in

{expr} -- expression to match

*DESC

{MatchLinear} tries to match an expression to a linear (degree less than
two) polynomial. The function returns {True} if it could match, and
it stores the resulting coefficients in the variables "{a}" and "{b}"
as a side effect. The function calling this predicate should declare
local variables "{a}" and "{b}" for this purpose.
{MatchLinear} tries to match to constant coefficients which don't
depend on the variable passed in, trying to find a form "{a*x+b}"
with "{a}" and "{b}" not depending on {x} if {x} is given as the variable.

*E.G.

	In> MatchLinear(x,(R+1)*x+(T-1))
	Out> True;
	In> {a,b};
	Out> {R+1,T-1};
	In> MatchLinear(x,Sin(x)*x+(T-1))
	Out> False;

*SEE Integrate


*CMD HasExpr --- check for expression containing a subexpression
*CMD HasExprArith --- check for expression containing a subexpression
*CMD HasExprSome --- check for expression containing a subexpression
*STD
*CALL
	HasExpr(expr, x)
	HasExprArith(expr, x)
	HasExprSome(expr, x, list)

*PARMS

{expr} -- an expression

{x} -- a subexpression to be found

{list} -- list of function atoms to be considered "transparent"

*DESC

The command {HasExpr} returns {True} if the expression {expr} contains a literal subexpression {x}. The expression is recursively traversed.

The command {HasExprSome} does the same, except it only looks at arguments of a given {list} of functions. All other functions become "opaque" (as if they do not contain anything).

{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 {Atom("+")} to obtain the unevaluated atom "{+}".

*E.G.

	In> HasExpr(x+y*Cos(Ln(z)/z), z)
	Out> True;
	In> HasExpr(x+y*Cos(Ln(z)/z), Ln(z))
	Out> True;
	In> HasExpr(x+y*Cos(Ln(z)/z), z/Ln(z))
	Out> False;
	In> HasExprArith(x+y*Cos(Ln(x)/x), z)
	Out> False;
	In> HasExprSome({a+b*2,c/d},c/d,{List})
	Out> True;
	In> HasExprSome({a+b*2,c/d},c,{List})
	Out> False;

*SEE FuncList, VarList, HasFunc

*CMD HasFunc --- check for expression containing a function
*CMD HasFuncArith --- check for expression containing a function
*CMD HasFuncSome --- check for expression containing a function
*STD
*CALL
	HasFunc(expr, func)
	HasFuncArith(expr, func)
	HasFuncSome(expr, func, list)

*PARMS

{expr} -- an expression

{func} -- a function atom to be found

{list} -- list of function atoms to be considered "transparent"

*DESC

The command {HasFunc} returns {True} if the expression {expr} contains a function {func}. The expression is recursively traversed.

The command {HasFuncSome} does the same, except it only looks at arguments of a given {list} of functions. Arguments of all other functions become "opaque" (as if they do not contain anything).

{HasFuncArith} is defined through {HasFuncSome} 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 {Atom("+")} to obtain the unevaluated atom "{+}".

*E.G.

	In> HasFunc(x+y*Cos(Ln(z)/z), Ln)
	Out> True;
	In> HasFunc(x+y*Cos(Ln(z)/z), Sin)
	Out> False;
	In> HasFuncArith(x+y*Cos(Ln(x)/x), Cos)
	Out> True;
	In> HasFuncArith(x+y*Cos(Ln(x)/x), Ln)
	Out> False;
	In> HasFuncSome({a+b*2,c/d},/,{List})
	Out> True;
	In> HasFuncSome({a+b*2,c/d},*,{List})
	Out> False;

*SEE FuncList, VarList, HasExpr