up previous next
NCo.MRSubtract

Subtraction of two polynomials in a finitely presented monoid ring.
Syntax
          
NCo.MRSubtract(X:STRING, Ordering:STRING, Relations:LIST, F1:LIST, F2:LIST):LIST

          

Description
Please note: The function(s) explained on this page is/are using the ApCoCoAServer. You will have to start the ApCoCoAServer in order to use it/them.

Please set coefficient field via the function NCo.SetFp (or NCo.UnsetFp) before calling this function. The default coefficient field is the field of rational numbers, i.e. RAT in CoCoAL. For more information, please check the relevant functions.

Example
X := "abc";  
Ordering := "LLEX";  
Relations := [["aa",""], ["bb",""], ["ab","c"], ["ac", "b"], ["cb", "a"]];  
F1 := [[1,"a"],[1,"ac"]]; -- F1=a+ac=a+b
F2 := [[1,"b"],[1,"ba"]]; -- F2=b+ba
NCo.MRSubtract(X, Ordering, Relations, F1, F2);
[[-1, "ba"], [1, "a"]]
-------------------------------
X := "abc";  
Ordering := "LLEX";  
Relations := [["aa",""], ["bb",""], ["ab","c"], ["ac", "b"], ["cb", "a"]];  
F1 := [[1,"a"],[1,""]]; -- F1=a+1
NCo.MRSubtract(X, Ordering, Relations, F1, F1); -- F1-F1
[ ]
-------------------------------
X := "abc";  
Ordering := "LLEX";  
Relations := [["aa",""], ["bb",""], ["ab","c"], ["ac", "b"], ["cb", "a"]];  
F1 := [[1,"a"],[1,""]]; -- F1=a+1
NCo.MRSubtract(X, Ordering, Relations, [], F1); -- 0-F1
[[-1, "a"], [-1, ""]]
-------------------------------


See Also