Community bonding period is completed and coding period started on 31st May.

Our original plan was to rewrite the pattern matcher for SymPy and generate decision tree for Rubi rules from Downvalues[] generated by Francesco.

Aaron gave us a link to this paper by Manuel Krebber. Pattern matching algorithms discussed in the paper are implemented in MatchPy library.


MatchPy uses discrimination net’s to do many-to-one matching(i.e. matching one subject to multiple patterns). MatchPy generates its own discrimination net as we add patterns to its ManyToOneReplacer.

Discrimination nets can be more efficient than a decision tree hence we decided to use MatchPy as the pattern matcher for Rubi. I wrote basic matching programs which implements few Rubi rules MatchPy.

I found the following issues with MatchPy:

  • MatchPy cannot be directly added to SymPy because it is written in Python3.6(whereas SymPy supports Python2 also).

  • It lacked mathematical operations on its Symbols due to which it becomes difficult to implement Rubi constrains. A workaround this issue is to sympify the expression and do calculations in SymPy.

  • MatchPy uses external libraries such as Multiset, enum and typing. SymPy does not encourage using external libraries in its code. Those modules need to be reimplemented into SymPy if we are going to directly import MatchPy code into SymPy.

Re-implementing MatchPy algorithms in SymPy can be very challenging and time consuming task as I am not very familiar with the algorithms used in MatchPy.

I used 3to2 to convert MatchPy code to Python2 syntax. Majority tests are passing in Python2 Syntax. I am currently trying to get the code working in Python2.

In coming week I will import MatchPy code to SymPy directly. If there are some setbacks in this approach, I will reimplement MatchPy algorithms in SymPy.