RewriteRule(Base, R, F)

rule.spad line 1 [edit on github]

Rules for the pattern matcher.

= : (%, %) -> Boolean
from BasicType
coerce : Equation(F) -> %
from CoercibleFrom(Equation(F))
coerce : % -> OutputForm
from CoercibleTo(OutputForm)
elt : (%, F) -> F
from Eltable(F, F)
elt : (%, F, PositiveInteger) -> F

elt(r, f, n) or r(f, n) applies the rule r to f at most n times.

latex : % -> String
from SetCategory
lhs : % -> F

lhs(r) returns the left hand side of the rule r.

pattern : % -> Pattern(Base)

pattern(r) returns the pattern corresponding to the left hand side of the rule r.

quotedOperators : % -> List(Symbol)

quotedOperators(r) returns the list of operators on the right hand side of r that are considered quoted, that is they are not evaluated during any rewrite, but just applied formally to their arguments.

retract : % -> Equation(F)
from RetractableTo(Equation(F))
retractIfCan : % -> Union(Equation(F), "failed")
from RetractableTo(Equation(F))
rhs : % -> F

rhs(r) returns the right hand side of the rule r.

rule : (F, F) -> %

rule(f, g) creates the rewrite rule: f == eval(g, g is f), with left-hand side f and right-hand side g.

rule : (F, F, List(Symbol)) -> %

rule(f, g, [f1, ..., fn]) creates the rewrite rule f == eval(eval(g, g is f), [f1, ..., fn]), that is a rule with left-hand side f and right-hand side g; The symbols f1, ..., fn are the operators that are considered quoted, that is they are not evaluated during any rewrite, but just applied formally to their arguments.

suchThat : (%, List(Symbol), Mapping(Boolean, List(F))) -> %

suchThat(r, [a1, ..., an], f) returns the rewrite rule r with the predicate f(a1, ..., an) attached to it.

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

RetractableTo(Equation(F))

BasicType

CoercibleTo(OutputForm)

Eltable(F, F)

SetCategory

CoercibleFrom(Equation(F))