FreeMonoid S¶
free.spad line 110 [edit on github]
S: SetCategory
The free monoid on a set S is the monoid of finite products of the form reduce(*, [si ^ ni]) where the si's are in S, and the ni's are nonnegative integers. The multiplication is not commutative. When S is an OrderedSet, then FreeMonoid(S) has order: for two elements x and y the relation x < y holds if either length(x) < length(y) holds or if these lengths are equal and if x is smaller than y w.r.t. the lexicographical ordering induced by S.
- 1: %
from MagmaWithUnit
- *: (%, S) -> %
x * sreturns the product ofxbyson the right.
- *: (S, %) -> %
s * xreturns the product ofxbyson the left.
- <=: (%, %) -> Boolean if S has OrderedSet
from PartialOrder
- <: (%, %) -> Boolean if S has OrderedSet
from PartialOrder
- >=: (%, %) -> Boolean if S has OrderedSet
from PartialOrder
- >: (%, %) -> Boolean if S has OrderedSet
from PartialOrder
- ^: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- ^: (%, PositiveInteger) -> %
from Magma
- ^: (S, NonNegativeInteger) -> %
s ^ nreturns the product ofsby itselfntimes.
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- coerce: S -> %
from CoercibleFrom S
- divide: (%, %) -> Union(Record(lm: %, rm: %), failed)
divide(x, y)returns the left and right exact quotients ofxbyy, i.e.[l, r]such thatx = l * y * r, “failed” ifxis not of the forml * y * r.
- factors: % -> List Record(gen: S, exp: NonNegativeInteger)
factors(a1\^e1, ..., an\^en)returns[[a1, e1], ..., [an, en]].
- first: % -> S
first(x)returns the first letter ofx.
- hclf: (%, %) -> %
hclf(x, y)returns the highest common left factor ofxandy, i.e. the largestdsuch thatx = d aandy = d b.
- hcrf: (%, %) -> %
hcrf(x, y)returns the highest common right factor ofxandy, i.e. the largestdsuch thatx = a dandy = b d.
- latex: % -> String
from SetCategory
- leftPower: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- leftPower: (%, PositiveInteger) -> %
from Magma
- leftRecip: % -> Union(%, failed)
from MagmaWithUnit
- length: % -> NonNegativeInteger
length(x)returns the length ofx.
- lexico: (%, %) -> Boolean if S has OrderedSet
lexico(x, y)returnstrueiffxis smaller thanyw.r.t. the pure lexicographical ordering induced byS.
- lquo: (%, %) -> Union(%, failed)
lquo(x, y)returns the exact left quotient ofxbyyi.e.qsuch thatx = y * q, “failed” ifxis not of the formy * q.
- lquo: (%, S) -> Union(%, failed)
lquo(x, s)returns the exact left quotient ofxbys.
- mapExpon: (NonNegativeInteger -> NonNegativeInteger, %) -> %
mapExpon(f, a1\^e1 ... an\^en)returnsa1\^f(e1) ... an\^f(en).
- mapGen: (S -> S, %) -> %
mapGen(f, a1\^e1 ... an\^en)returnsf(a1)\^e1 ... f(an)\^en.
- max: (%, %) -> % if S has OrderedSet
from OrderedSet
- min: (%, %) -> % if S has OrderedSet
from OrderedSet
- mirror: % -> %
mirror(x)returns the reversed word ofx.
- nthExpon: (%, Integer) -> NonNegativeInteger
nthExpon(x, n)returns the exponent of the n^th monomial ofx.
- nthFactor: (%, Integer) -> S
nthFactor(x, n)returns the factor of the n^th monomial ofx.
- one?: % -> Boolean
from MagmaWithUnit
- overlap: (%, %) -> Record(lm: %, mm: %, rm: %)
overlap(x, y)returns[l, m, r]such thatx = l * m,y = m * randlandrhave no overlap, i.e.overlap(l, r) = [l, 1, r].
- recip: % -> Union(%, failed)
from MagmaWithUnit
- rest: % -> %
rest(x)returnsxexcept the first letter.
- retract: % -> S
from RetractableTo S
- retractIfCan: % -> Union(S, failed)
from RetractableTo S
- rightPower: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- rightPower: (%, PositiveInteger) -> %
from Magma
- rightRecip: % -> Union(%, failed)
from MagmaWithUnit
- rquo: (%, %) -> Union(%, failed)
rquo(x, y)returns the exact right quotient ofxbyyi.e.qsuch thatx = q * y, “failed” ifxis not of the formq * y.
- rquo: (%, S) -> Union(%, failed)
rquo(x, s)returns the exact right quotient ofxbys.
- sample: %
from MagmaWithUnit
- size: % -> NonNegativeInteger
size(x)returns the number of monomials inx.
- smaller?: (%, %) -> Boolean if S has Comparable
from Comparable
- varList: % -> List S
varList(x)returns the list of variables ofx.
Comparable if S has Comparable
OrderedMonoid if S has OrderedSet
OrderedSemiGroup if S has OrderedSet
OrderedSet if S has OrderedSet
PartialOrder if S has OrderedSet