PatternFunctions1(R, D)¶
pattern.spad line 374 [edit on github]
R: SetCategory
D: Type
Tools for patterns.
- addBadValue: (Pattern R, D) -> Pattern R
addBadValue(p, v)
addsv
to the list of “bad values” forp
;p
is not allowed to match any of its “bad values”.
- badValues: Pattern R -> List D
badValues(p)
returns the list of “bad values” forp
;p
is not allowed to match any of its “bad values”.
- predicate: Pattern R -> D -> Boolean
predicate(p)
returns the predicate attached top
, the constant functiontrue
ifp
has no predicates attached to it.
- satisfy?: (D, Pattern R) -> Boolean
satisfy?(v, p)
returnsf
(v
) wheref
is the predicate attached top
.
- satisfy?: (List D, Pattern R) -> Boolean
satisfy?([v1, ..., vn], p)
returnsf(v1, ..., vn)
wheref
is the top-level predicate attached top
.
- suchThat: (Pattern R, D -> Boolean) -> Pattern R
suchThat(p, f)
makes a copy ofp
and adds the predicatef
to the copy, which is returned.