Question: 2 basic questions on patmatch

First, is patmatch command is the main Maple command for doing pattern matching on expressions?  

I trying to understand how it works, but failing on the most basic expressions. 2 basic questions

1)patmatch( x^n/y^n,  x∷symbol^n::symbol /  y::symbol^n::symbol);
                               false

It did not like that I told it x::symbol in the above. Why? But when I remove ::symbol it works

patmatch(x^n/y^n,x^n::symbol/y^n::symbol);
                   true

But when I do "whattype(x);" Maple replies saying it is "symbol"

2)Trying to match x^2/y^2, not having any luck
patmatch(x^2/y^2,x^n::nonunit(integer)/y^n::nonunit(integer));
                        false

patmatch(x^2/y^2,x^n::integer/y^n::integer);
                         false

How to match x^2/y^2? Why the above fail? 

I learn better by examples. Is there a place where one can look at many examples using patmatch? 

The help page have only few examples, and the link to the page called "examples,patmatch" does not help either with few examples and many are the same as the other page.  I tried to run it using 

infolevel[all]:=5:
printlevel:=10:

To see if I can figure what is wrong, but did not understand any of the code printed.

Compare this to Mathematica, where pattern matching there has hundreds of examples and detailed tutorials just on this one subject.

 



   


 

Please Wait...