Skip to content

Integration of MatchPy's algorithms #28

@Upabjojr

Description

@Upabjojr

MatchPy is a library claiming to implement state-of-the-art associative-commutative pattern matching in Python.

In particular, they claim:

We use the Hopcroft-Karp algorithm [HK73] to find an initial maximum
matching. However, since we are also interested in all matches
and the initial matching might have incompatible substitutions, we
use the algorithm described by Uno, Fukuda and Matsui [FM94],
[Uno97] to enumerate all maximum matchings.

MatchPy has been integrated into SymPy. MatchPy is also able to generate Python decision tree. See the generated RUBI decision tree. It would be nice to see how it would work with Julia's metaprogramming.

MatchPy's code generator has been ported into C++ as part of SymEngine (see the matchPyCpp subfolder on github).

The Hopcroft-Karp and Uno-Fukuda-Matsui algorithms have been ported into C++ (although the current lack of support for coroutines makes the code pretty slow). See the Hopcroft-Karp implementation and the Uno-Fukuda-Matsui implementation in SymEngine, which are translations of MatchPy's Python code.

Is there the possibility of integrating these algorithms into Rewrite.jl?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions