Open ricardoV94 opened 2 years ago
This might require a simple/naive canonicalization that involves string name/auto-ID ordering of inputs to associative/commutative (AC) Op
s. Such a canonicalization should be consistent across recreations of equivalent graphs, so I'm not sure if a direct auto-ID approach is actually sound. It might be, though.
All I know for sure is that we don't want to perform anything like AC matching/unification numerous times.
One more direct way would be to include op information about what inputs are commutative and in the merge optimization we compare those via set equality instead of order equality like we do now for all inputs.
Just some care would be needed for repeated inputs, so maybe via a Counter instead of set
One more direct way would be to include op information about what inputs are commutative and in the merge optimization we compare those via set equality instead of order equality like we do now for all inputs.
Just some care would be needed for repeated inputs, so maybe via a Counter instead of set
Yes, that's basically how the permutation goals and AC unification work in kanren
. The issue I was alluding to involves the need to construct those sets/Counter
s multiple times.