Skip to content

Commit d9bba7e

Browse files
committed
enhance commutative term matcher to validate operation type
1 parent 9288f7c commit d9bba7e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/matchers.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ function term_matcher_constructor(term, acSets)
152152
function commutative_term_matcher(success, data, bindings)
153153
!islist(data) && return nothing # if data is not a list, return nothing
154154
!iscall(car(data)) && return nothing # if first element is not a call, return nothing
155+
operation(term) !== operation(car(data)) && return nothing # if the operation of data is not the correct one, don't even try
155156

156157
T = symtype(car(data))
157158
f = operation(car(data))

0 commit comments

Comments
 (0)