pattern.spad line 374 [edit on github]
Tools for patterns.
addBadValue(p, v)
adds v
to the list of "bad values" for p
; p
is not allowed to match any of its "bad values".
badValues(p)
returns the list of "bad values" for p
; p
is not allowed to match any of its "bad values".
predicate(p)
returns the predicate attached to p
, the constant function true
if p
has no predicates attached to it.
satisfy?(v, p)
returns f
(v
) where f
is the predicate attached to p
.
satisfy?([v1, ..., vn], p)
returns f(v1, ..., vn)
where f
is the top-level predicate attached to p
.
suchThat(p, [f1, ..., fn])
makes a copy of p
and adds the predicate f1
and ... and fn
to the copy, which is returned.
suchThat(p, [a1, ..., an], f)
returns a copy of p
with the top-level predicate set to f(a1, ..., an)
.
suchThat(p, f)
makes a copy of p
and adds the predicate f
to the copy, which is returned.