ExpressionSpace

fspace.spad line 1 [edit on github]

An expression space is a set which is closed under certain operators.

=: (%, %) -> Boolean

from BasicType

~=: (%, %) -> Boolean

from BasicType

belong?: BasicOperator -> Boolean

belong?(op) tests if % accepts op as applicable to its elements.

box: % -> %

box(f) returns f with a ‘box’ around it that prevents f from being evaluated when operators are applied to it. For example, log(1) returns 0, but log(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 expression p such that p(x) = 0.

distribute: % -> %

distribute(f) expands all the kernels in f that are formally enclosed by a box or paren expression.

distribute: (%, %) -> %

distribute(f, g) expands all the kernels in f that contain g in their arguments and that are formally enclosed by a box or a paren expression.

elt: (BasicOperator, %) -> %

elt(op, x) or op(x) applies the unary operator op to x.

elt: (BasicOperator, %, %) -> %

elt(op, x, y) or op(x, y) applies the binary operator op to x and y.

elt: (BasicOperator, %, %, %) -> %

elt(op, x, y, z) or op(x, y, z) applies the ternary operator op to x, y and z.

elt: (BasicOperator, %, %, %, %) -> %

elt(op, x, y, z, t) or op(x, y, z, t) applies the 4-ary operator op to x, y, z and t.

elt: (BasicOperator, %, %, %, %, %) -> %

elt(op, x, y, z, t, s) applies the 5-ary operator op to x, y, z, t and s

elt: (BasicOperator, %, %, %, %, %, %) -> %

elt(op, x, y, z, t, s, r) applies the 6-ary operator op to x, y, z, t, s and r

elt: (BasicOperator, %, %, %, %, %, %, %) -> %

elt(op, x, y, z, t, s, r, q) applies the 7-ary operator op to x, y, z, t, s, r and q

elt: (BasicOperator, %, %, %, %, %, %, %, %) -> %

elt(op, x, y, z, t, s, r, q, p) applies the 8-ary operator op to x, y, z, t, s, r, q and p

elt: (BasicOperator, %, %, %, %, %, %, %, %, %) -> %

elt(op, x, y, z, t, s, r, q, p, o) applies the 9-ary operator op to x, y, z, t, s, r, q, p and o

elt: (BasicOperator, List %) -> %

elt(op, [x1, ..., xn]) or op([x1, …, xn]) applies the n-ary operator op to x1, …, xn.

eval: (%, %, %) -> %

from InnerEvalable(%, %)

eval: (%, BasicOperator, % -> %) -> %

eval(x, s, f) replaces every s(a) in x by f(a) for any a.

eval: (%, BasicOperator, List % -> %) -> %

eval(x, s, f) replaces every s(a1, .., am) in x by f(a1, .., am) for any a1, …, 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 every si(a) in x by fi(a) for any a.

eval: (%, List BasicOperator, List(List % -> %)) -> %

eval(x, [s1, ..., sm], [f1, ..., fm]) replaces every si(a1, ..., an) in x by fi(a1, ..., an) for any a1, …, an.

eval: (%, List Equation %) -> %

from Evalable %

eval: (%, List Kernel %, List %) -> %

from InnerEvalable(Kernel %, %)

eval: (%, List Symbol, List(% -> %)) -> %

eval(x, [s1, ..., sm], [f1, ..., fm]) replaces every si(a) in x by fi(a) for any a.

eval: (%, List Symbol, List(List % -> %)) -> %

eval(x, [s1, ..., sm], [f1, ..., fm]) replaces every si(a1, ..., an) in x by fi(a1, ..., an) for any a1, …, an.

eval: (%, Symbol, % -> %) -> %

eval(x, s, f) replaces every s(a) in x by f(a) for any a.

eval: (%, Symbol, List % -> %) -> %

eval(x, s, f) replaces every s(a1, .., am) in x by f(a1, .., am) for any a1, …, am.

even?: % -> Boolean if % has RetractableTo Integer

even? x is true if x is an even integer.

freeOf?: (%, %) -> Boolean

freeOf?(x, y) tests if x does not contain any occurrence of y, where y is a single kernel.

freeOf?: (%, Symbol) -> Boolean

freeOf?(x, s) tests if x does not contain any operator whose name is s.

hash: % -> SingleInteger

from SetCategory

hashUpdate!: (HashState, %) -> HashState

from SetCategory

height: % -> NonNegativeInteger

height(f) returns the highest nesting level appearing in f. Constants have height 0. Symbols have height 1. For any operator op and expressions f1, …, fn, op(f1, ..., fn) has height equal to 1 + max(height(f1), ..., height(fn)).

is?: (%, BasicOperator) -> Boolean

is?(x, op) tests if x is a kernel and if its operator is op.

is?: (%, Symbol) -> Boolean

is?(x, s) tests if x is a kernel and if the name of its operator is s.

kernel: (BasicOperator, %) -> %

kernel(op, x) constructs op(x) without evaluating it.

kernel: (BasicOperator, List %) -> %

kernel(op, [f1, ..., fn]) constructs op(f1, ..., fn) without evaluating it.

kernels: % -> List Kernel %

kernels(f) returns the list of all the top-level kernels appearing in f, 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 in f1, …, fn but 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 of f with maximum nesting level, or “failed” if f has no kernels (i.e. f is a constant).

map: (% -> %, Kernel %) -> %

map(f, k) returns op(f(x1), ..., f(xn)) where k = op(x1, ..., xn).

minPoly: Kernel % -> SparseUnivariatePolynomial % if % has Ring

minPoly(k) returns p such that p(k) = 0.

odd?: % -> Boolean if % has RetractableTo Integer

odd? x is true if x is an odd integer.

operator: BasicOperator -> BasicOperator

operator(op) returns a copy of op with the domain-dependent properties appropriate for %.

operators: % -> List BasicOperator

operators(f) returns all the basic operators appearing in f, no matter what their levels are.

paren: % -> %

paren(f) returns (f). This prevents f from being evaluated when operators are applied to it. For example, log(1) returns 0, but log(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 kernel k by g formally in f.

subst: (%, List Equation %) -> %

subst(f, [k1 = g1, ..., kn = gn]) replaces the kernels k1, …, kn by g1, …, gn formally in f.

subst: (%, List Kernel %, List %) -> %

subst(f, [k1..., kn], [g1, ..., gn]) replaces the kernels k1, …, kn by g1, …, gn formally in f.

tower: % -> List Kernel %

tower(f) returns all the kernels appearing in f, no matter what their levels are.

tower: List % -> List Kernel %

tower([f1,...,fn]) returns all the kernels appearing in f1, …, fn no matter what their levels are.

BasicType

CoercibleFrom Kernel %

CoercibleTo OutputForm

Comparable

Evalable %

InnerEvalable(%, %)

InnerEvalable(Kernel %, %)

RetractableTo Kernel %

SetCategory