rule.spad line 1 [edit on github]
Rules for the pattern matcher.
elt(r, f, n)
or r
(f
, n
) applies the rule r
to f
at most n
times.
lhs(r)
returns the left hand side of the rule r
.
pattern(r)
returns the pattern corresponding to the left hand side of the rule r
.
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.
rhs(r)
returns the right hand side of the rule r
.
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, 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(r, [a1, ..., an], f)
returns the rewrite rule r
with the predicate f(a1, ..., an)
attached to it.
Eltable(F, F)