Skip to content

Commutativity prblem in @rule macro #837

@Bumblebee00

Description

@Bumblebee00
julia> @syms a b c
(a, b, c)

julia> r = @rule ~a*~b + ~a*~c => ~a * (~b+~c)
~a * ~b + ~a * ~c => ~a * (~b + ~c)

julia> r(a*b + a*c)
a*(b + c)

julia> r(b*a + b*c)

julia> 

a way to fix could be generate the permutations of all commutative operations at the top level, and not during the recursion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions