ApCoCoA-1:NCo.BAdd

From ApCoCoAWiki
Revision as of 16:42, 30 April 2013 by Xiu (talk | contribs) (New page: <command> <title>NCo.BAdd</title> <short_description> Addition of two polynomials in a free monoid ring over the binary field F_{2}={0,1}. </short_description> <syntax> NCo.BAdd(F1:LIST, F...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

NCo.BAdd

Addition of two polynomials in a free monoid ring over the binary field F_{2}={0,1}.

Syntax

NCo.BAdd(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 ring environment alphabet (or set of indeterminates) X and word ordering via the functions NCo.SetX and NCo.SetOrdering, respectively, before calling this function. The default ordering is the length-lexicographic ordering ("LLEX"). For more information, please check the relevant functions.

  • @param F1,F2: two polynomials in the free monoid ring F_{2}<X>, which are left and right operands of addition respectively. Each polynomial is represented as a LIST of words (or terms) in <X>. Each word is represented as a STRING. For example, xy^2x is represented as "xyyx", and the identity is represented as the empty string "". Thus, the polynomial f=xy-y+1 in F2<x,y> is represented as F:=["xy", "y", ""]. The zero polynomial 0 is represented as the empty LIST [].

  • @return: a LIST which represents the polynomial equal to F1+F2.

Example

NCo.SetX(<quotes>xX</quotes>);
NCo.SetOrdering(<quotes>LLEX</quotes>);
F1:=[<quotes>xX</quotes>,<quotes></quotes>];
F2:=[<quotes>Xx</quotes>,<quotes></quotes>];
NCo.BAdd(F1,F2);
[<quotes>xX</quotes>, <quotes>Xx</quotes>]
-------------------------------
NCo.BAdd(F1,F1);
[ ]
-------------------------------
NCo.BAdd([],F1);
[<quotes>xX</quotes>, <quotes></quotes>]
-------------------------------

See also

NCo.SetOrdering

NCo.SetX

Introduction to CoCoAServer