ListMonoidOps(S, E, un)ΒΆ

free.spad line 1

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
~=: (%, %) -> Boolean
from BasicType
coerce: % -> OutputForm
from CoercibleTo OutputForm
coerce: S -> %
from RetractableTo S
commutativeEquality: (%, %) -> Boolean
commutativeEquality(x, y) returns true if x and y are equal assuming commutativity
hash: % -> SingleInteger
from SetCategory
hashUpdate!: (HashState, %) -> HashState
from SetCategory
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: (E -> E, %) -> %
mapExpon(f, a1\^e1 ... an\^en) returns a1\^f(e1) ... an\^f(en).
mapGen: (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: (%, (OutputForm, OutputForm) -> OutputForm, (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).
plus: (%, %) -> %
plus(x, y) returns x + y where + is the monoid operation, which is assumed commutative.
plus: (S, E, %) -> %
plus(s, e, x) returns e * s + x where + is the monoid operation, which is assumed commutative.
retract: % -> S
from RetractableTo S
retractIfCan: % -> Union(S, failed)
from RetractableTo S
reverse!: % -> %
reverse!(l) reverses the list of monomials forming l, destroying the element l.
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.
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.

BasicType

CoercibleTo OutputForm

RetractableTo S

SetCategory