diff options
Diffstat (limited to 'src/algebra/patmatch1.spad.pamphlet')
-rw-r--r-- | src/algebra/patmatch1.spad.pamphlet | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/algebra/patmatch1.spad.pamphlet b/src/algebra/patmatch1.spad.pamphlet index 8d6408ed..087b8c71 100644 --- a/src/algebra/patmatch1.spad.pamphlet +++ b/src/algebra/patmatch1.spad.pamphlet @@ -263,7 +263,7 @@ PatternMatchSymbol(S:SetCategory): with ++ Keywords: pattern, matching, kernel. PatternMatchKernel(S, E): Exports == Implementation where S: SetCategory - E: Join(OrderedSet, RetractableTo Kernel %, + E: Join(SetCategory, RetractableTo Kernel %, ConvertibleTo Pattern S, PatternMatchable S) PAT ==> Pattern S @@ -460,7 +460,7 @@ PatternMatchPushDown(S, A, B): Exports == Implementation where ++ Keywords: pattern, matching, tools. PatternMatchTools(S, R, P): Exports == Implementation where S: SetCategory - R: Join(Ring, OrderedSet) + R: Ring P: Join(Ring, ConvertibleTo Pattern S, RetractableTo R) PAT ==> Pattern S @@ -498,9 +498,10 @@ PatternMatchTools(S, R, P): Exports == Implementation where mn1 := convert(-1::P)@Pattern(S) negConstant l == - for x in l repeat - ((r := retractIfCan(x)@Union(R, "failed")) case R) and - (r::R < 0) => return x + if R has OrderedSet then + for x in l repeat + ((r := retractIfCan(x)@Union(R, "failed")) case R) and + (r::R < 0) => return x "failed" -- tries to match the list of patterns lp to the list of subjects rc.s |