ExpressionSpace¶
fspace.spad line 1 [edit on github]
An expression space is a set which is closed under certain operators.
- belong?: BasicOperator -> Boolean
belong?(op)tests if % acceptsopas applicable to its elements.
- box: % -> %
box(f)returnsfwith a ‘box’ around it that preventsffrom being evaluated when operators are applied to it. For example,log(1)returns 0, butlog(box 1)returns the formal kernel log(1).
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- coerce: Kernel % -> %
from CoercibleFrom Kernel %
- definingPolynomial: % -> % if % has Ring
definingPolynomial(x)returns an expressionpsuch thatp(x) = 0.
- distribute: % -> %
distribute(f)expands all the kernels infthat are formally enclosed by a box or paren expression.
- distribute: (%, %) -> %
distribute(f, g)expands all the kernels infthat containgin their arguments and that are formally enclosed by a box or a paren expression.
- elt: (BasicOperator, %) -> %
elt(op, x)orop(x) applies the unary operatoroptox.
- elt: (BasicOperator, %, %) -> %
elt(op, x, y)orop(x,y) applies the binary operatoroptoxandy.
- elt: (BasicOperator, %, %, %) -> %
elt(op, x, y, z)orop(x,y,z) applies the ternary operatoroptox,yandz.
- elt: (BasicOperator, %, %, %, %) -> %
elt(op, x, y, z, t)orop(x,y,z,t) applies the 4-ary operatoroptox,y,zandt.
- elt: (BasicOperator, %, %, %, %, %) -> %
elt(op, x, y, z, t, s)applies the 5-ary operatoroptox,y,z,tands
- elt: (BasicOperator, %, %, %, %, %, %) -> %
elt(op, x, y, z, t, s, r)applies the 6-ary operatoroptox,y,z,t,sandr
- elt: (BasicOperator, %, %, %, %, %, %, %) -> %
elt(op, x, y, z, t, s, r, q)applies the 7-ary operatoroptox,y,z,t,s,randq
- elt: (BasicOperator, %, %, %, %, %, %, %, %) -> %
elt(op, x, y, z, t, s, r, q, p)applies the 8-ary operatoroptox,y,z,t,s,r,qandp
- elt: (BasicOperator, %, %, %, %, %, %, %, %, %) -> %
elt(op, x, y, z, t, s, r, q, p, o)applies the 9-ary operatoroptox,y,z,t,s,r,q,pando
- elt: (BasicOperator, List %) -> %
elt(op, [x1, ..., xn])orop([x1, …,xn]) applies then-ary operatoroptox1, …,xn.
- eval: (%, %, %) -> %
from InnerEvalable(%, %)
- eval: (%, BasicOperator, % -> %) -> %
eval(x, s, f)replaces everys(a)inxbyf(a)for anya.
- eval: (%, BasicOperator, List % -> %) -> %
eval(x, s, f)replaces everys(a1, .., am)inxbyf(a1, .., am)for anya1, …,am.- eval: (%, Equation %) -> %
from Evalable %
- eval: (%, Kernel %, %) -> %
from InnerEvalable(Kernel %, %)
- eval: (%, List %, List %) -> %
from InnerEvalable(%, %)
- eval: (%, List BasicOperator, List(% -> %)) -> %
eval(x, [s1, ..., sm], [f1, ..., fm])replaces everysi(a)inxbyfi(a)for anya.
- eval: (%, List BasicOperator, List(List % -> %)) -> %
eval(x, [s1, ..., sm], [f1, ..., fm])replaces everysi(a1, ..., an)inxbyfi(a1, ..., an)for anya1, …,an.- eval: (%, List Equation %) -> %
from Evalable %
- eval: (%, List Kernel %, List %) -> %
from InnerEvalable(Kernel %, %)
- eval: (%, List Symbol, List(% -> %)) -> %
eval(x, [s1, ..., sm], [f1, ..., fm])replaces everysi(a)inxbyfi(a)for anya.
- eval: (%, List Symbol, List(List % -> %)) -> %
eval(x, [s1, ..., sm], [f1, ..., fm])replaces everysi(a1, ..., an)inxbyfi(a1, ..., an)for anya1, …,an.
- eval: (%, Symbol, % -> %) -> %
eval(x, s, f)replaces everys(a)inxbyf(a)for anya.
- eval: (%, Symbol, List % -> %) -> %
eval(x, s, f)replaces everys(a1, .., am)inxbyf(a1, .., am)for anya1, …,am.
- even?: % -> Boolean if % has RetractableTo Integer
even? xistrueifxis an even integer.
- freeOf?: (%, %) -> Boolean
freeOf?(x, y)tests ifxdoes not contain any occurrence ofy, whereyis a single kernel.
- freeOf?: (%, Symbol) -> Boolean
freeOf?(x, s)tests ifxdoes not contain any operator whose name iss.
- height: % -> NonNegativeInteger
height(f)returns the highest nesting level appearing inf. Constants have height 0. Symbols have height 1. For any operator op and expressionsf1, …,fn,op(f1, ..., fn)has height equal to1 + max(height(f1), ..., height(fn)).
- is?: (%, BasicOperator) -> Boolean
is?(x, op)tests ifxis a kernel and if its operator is op.
- kernel: (BasicOperator, %) -> %
kernel(op, x)constructsop(x) without evaluating it.
- kernel: (BasicOperator, List %) -> %
kernel(op, [f1, ..., fn])constructsop(f1, ..., fn)without evaluating it.
- kernels: % -> List Kernel %
kernels(f)returns the list of all the top-level kernels appearing inf, but not the ones appearing in the arguments of the top-level kernels.
- kernels: List % -> List Kernel %
kernels([f1,...,fn])returns the list of all the top-level kernels appearing inf1, …,fnbut not the ones appearing in the arguments of the top-level kernels.
- latex: % -> String
from SetCategory
- mainKernel: % -> Union(Kernel %, failed)
mainKernel(f)returns a kernel offwith maximum nesting level, or “failed” iffhas no kernels (i.e.fis a constant).
- map: (% -> %, Kernel %) -> %
map(f, k)returnsop(f(x1), ..., f(xn))wherek = op(x1, ..., xn).
- minPoly: Kernel % -> SparseUnivariatePolynomial % if % has Ring
minPoly(k)returnspsuch thatp(k) = 0.
- odd?: % -> Boolean if % has RetractableTo Integer
odd? xistrueifxis an odd integer.
- operator: BasicOperator -> BasicOperator
operator(op)returns a copy ofopwith the domain-dependent properties appropriate for %.
- operators: % -> List BasicOperator
operators(f)returns all the basic operators appearing inf, no matter what their levels are.
- paren: % -> %
paren(f)returns (f). This preventsffrom being evaluated when operators are applied to it. For example,log(1)returns 0, butlog(paren 1)returns the formal kernel log((1)).
- retract: % -> Kernel %
from RetractableTo Kernel %
- retractIfCan: % -> Union(Kernel %, failed)
from RetractableTo Kernel %
- smaller?: (%, %) -> Boolean
from Comparable
- subst: (%, Equation %) -> %
subst(f, k = g)replaces the kernelkbygformally inf.
- subst: (%, List Equation %) -> %
subst(f, [k1 = g1, ..., kn = gn])replaces the kernelsk1, …,knbyg1, …,gnformally inf.
- subst: (%, List Kernel %, List %) -> %
subst(f, [k1..., kn], [g1, ..., gn])replaces the kernelsk1, …,knbyg1, …,gnformally inf.
- tower: % -> List Kernel %
tower(f)returns all the kernels appearing inf, no matter what their levels are.
- tower: List % -> List Kernel %
tower([f1,...,fn])returns all the kernels appearing inf1, …,fnno matter what their levels are.
Evalable %
InnerEvalable(%, %)
InnerEvalable(Kernel %, %)