From CoCoAWiki
Jump to: navigation, search


 <short_description>Computes a representation of a term in other terms if it exists.</short_description>

<syntax> SB.TermRepr(Term:POLY,TermList:LIST of POLY):LIST of INT SB.TermRepr(Term:POLY,TermList:LIST of POLY,ReprType:INT):LIST of INT </syntax>


This functions tries to compute a term representation of the given term Term in terms of the list TermList. If it is not possible to get such a representation NULL will be returned. If a representation exists a list of integers will be returned which gives the exponents of the power product of the term in the other terms, e.g. for the term Term=x^2y and the list of terms TermList=[x,y] the function will return [2,1] as the representation. <par/> With the optional parameter ReprType it is possible to choose between different ways of getting a possible representation.


 <item>@param Term A term in the current ring.</item>
 <item>@param TermList A list of terms in the current ring.</item>
 <item>@return A list of integers, which gives the representation, or NULL.</item>

</itemize> The following parameter is optional: <itemize>

 <item>@param ReprType Either 0,1 or 2. With this parameter it is possible to choose between different ways of getting the representation: By ReprType=0 a toric ideal is used to compute the representation. This is also the default value. By ReprType=1 algebra homomorphisms are used, by ReprType=2 a system of diophantine equations is used to compute the representation.</item>

</itemize> <example> Use R::=QQ[x,y];

SB.TermRepr(x^2y^2,[x,y]); SB.TermRepr(x^2y^2,[xy^2,x,y]);

-- output:

[2, 2]

[1, 1, 0]

-- Done.

</example> <example> Use R::=QQ[x,y,z];

L:=[x^2y^4z^8,xy^3,z^5]; SB.TermRepr(xy^4z,L); -- for xy^4z no representation is existing T:=L[1]^3L[3]^2; -- T = (x^2y^4z^8)^3 * (xy^3)^0 * (z^5)^2 T; SB.TermRepr(T,L);

-- output:



[3, 0, 2]

-- Done.