217 Reputation

7 Badges

5 years, 239 days

MaplePrimes Activity

These are replies submitted by MDD

@vv  Thank you so much. Now, it is good.!! How select this as the best answer?

@vv Thanks again. I think my question is obvious and my example is completely appropriate. I need a function which receives two parametric monomials (and also a list of variables) and returns true or false;

its output is true if these monomials have not any common variables and return false if there is at least one common variable. 

@vv Thanks for your answer. But, all of m1, m2, m3 have the variable x and so are not distinct. So, true is not correct in the output of your function.

@Carl Love Thank you very much for your helpful answers. It seems is OK!!

@vv But, now there is another problem in using HasSubexpression. When I use HasSubexpression in my main algorithm it doesn't work correctly. How to apply HasSubexpression in my main procedure? For example, in the middle of computations

`elif ormap`(proc (a) options operator, arrow; HasSubexpression(a, [n*a,n*b]) end proc, [a*n*z^3+t-1, -m*x]) = true then....

It returns false while independently in the out of procedure it returns true which is correct.

@vv Yes, c appears in H. So, I think my example is not appropriate for this case. It seems that HasSubexpression is correct. I will run our example and report the results. 

@Carl Love 

In fact, I am working on Grobner systems, roughly speaking, can be considered as an extension of Grobner bases of polynomials over fields to polynomials with parametric coefficients. Indeed, a Grobner system is a fi nite set of triples (N,W,G) (so-called branches or segments); each branch contains (N,W) a couple of null (N)
and non-null parametric sets (W) (parametric constraint) and also a set of polynomials (G).  

Now, I must consider the element of N as zero in polynomial set G. For this I use NormalForm(g, N, parametric monomial order) command of Maple for any g in G. But, it is possible the elements of N don't appear in any polynomial of G so using NormalForm command is additional work. Therefore I need a function to decide that is there at least one element at G e.g. g s.t. an element of N  appears in g. In this case, the output is true otherwise false. For example, let 

N = [b-1], G = [a*n*z^3-1, -b*x+3]. Since b-1 don't appear in any element of G so it is not needed to use NormalForm command for this branch (but when I use your function HasSubexpression it's output is true and the Normalform command is called automatically). 

@Carl Love  Thanks a lot for your helpful answer. But now, there is a minor error in the following:

HasSubexpression(b-1, [a*n*z^3-1, 3-b]). b-1 do not appear in [a*n*z^3-1, 3-b] but this function returns true. I need a general function to decide appearing one element of a list in the part of a polynomial of the anothr list. 

@Carl Love I applied your function on very pairs of list A, B and in some case, the following error appears:

How can fix this problem to can use this function generally?

@Carl Love Thank you so much again. 

@Carl Love 

Thanks for your answer. Now, How apply your function in my example?  

The input (of any suggestion algorithm or function) is two list A, B and we want to decide that is there at least one element at B e.g. $f\in B$ s.t. an element of A  appears in f. In this case, the output is true otherwise false.


Thanks again for your answer.


Thanks for this comparison. 

@acer a+b also is a parameter for me so the output is true.

Also, I have the list of variables and parameters at the beginning of computations. 



Dear MMcdara and dear Acer,


Thanks for your helpful answer. Which of them is more efficient?


With best regards

1 2 3 4 5 6 7 Last Page 1 of 9