ListMonoidOps(S, E, un)

free.spad line 1 [edit on github]

This internal package represents monoid (abelian or not, with or without inverses) as lists and provides some common operations to the various flavors of monoids.

= : (%, %) -> Boolean
from BasicType
coerce : S -> %
from CoercibleFrom(S)
coerce : % -> OutputForm
from CoercibleTo(OutputForm)
latex : % -> String
from SetCategory
leftMult : (S, %) -> %

leftMult(s, a) returns s * a where * is the monoid operation, which is assumed non-commutative.

listOfMonoms : % -> List(Record(gen : S, exp : E))

listOfMonoms(l) returns the list of the monomials forming l.

makeMulti : List(Record(gen : S, exp : E)) -> %

makeMulti(l) returns the element whose list of monomials is l.

makeTerm : (S, E) -> %

makeTerm(s, e) returns the monomial s exponentiated by e (e.g. s^e or e * s).

makeUnit : () -> %

makeUnit() returns the unit element of the monomial.

mapExpon : (Mapping(E, E), %) -> %

mapExpon(f, a1^e1 ... an^en) returns a1^f(e1) ... an^f(en).

mapGen : (Mapping(S, S), %) -> %

mapGen(f, a1^e1 ... an^en) returns f(a1)^e1 ... f(an)^en.

nthExpon : (%, Integer) -> E

nthExpon(l, n) returns the exponent of the n^th monomial of l.

nthFactor : (%, Integer) -> S

nthFactor(l, n) returns the factor of the n^th monomial of l.

outputForm : (%, Mapping(OutputForm, OutputForm, OutputForm), Mapping(OutputForm, OutputForm, OutputForm), Integer) -> OutputForm

outputForm(l, fop, fexp, unit) converts the monoid element represented by l to an OutputForm. Argument unit is the output form for the unit of the monoid (e.g. 0 or 1), fop(a, b) is the output form for the monoid operation applied to a and b (e.g. a + b, a * b, ab), and fexp(a, n) is the output form for the exponentiation operation applied to a and n (e.g. n a, n * a, a ^ n, a^n).

retract : % -> S
from RetractableTo(S)
retractIfCan : % -> Union(S, "failed")
from RetractableTo(S)
reverse : % -> %

reverse(l) reverses the list of monomials forming l. This has some effect if the monoid is non-abelian, i.e. reverse(a1^e1 ... an^en) = an^en ... a1^e1 which is different.

reverse! : % -> %

reverse!(l) reverses the list of monomials forming l, destroying the element l.

rightMult : (%, S) -> %

rightMult(a, s) returns a * s where * is the monoid operation, which is assumed non-commutative.

size : % -> NonNegativeInteger

size(l) returns the number of monomials forming l.

~= : (%, %) -> Boolean
from BasicType

RetractableTo(S)

CoercibleTo(OutputForm)

CoercibleFrom(S)

SetCategory

BasicType