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)addsvto the list of “bad values” forp;pis not allowed to match any of its “bad values”.
- badValues: Pattern R -> List D
badValues(p)returns the list of “bad values” forp;pis not allowed to match any of its “bad values”.
- predicate: Pattern R -> D -> Boolean
predicate(p)returns the predicate attached top, the constant functiontrueifphas no predicates attached to it.
- satisfy?: (D, Pattern R) -> Boolean
satisfy?(v, p)returnsf(v) wherefis the predicate attached top.
- satisfy?: (List D, Pattern R) -> Boolean
satisfy?([v1, ..., vn], p)returnsf(v1, ..., vn)wherefis the top-level predicate attached top.
- suchThat: (Pattern R, D -> Boolean) -> Pattern R
suchThat(p, f)makes a copy ofpand adds the predicatefto the copy, which is returned.