Hi Mikhail,
Sorry for the delayed response. I completely understand the general problem being difficult (but not undecidable right? As far as I can see it is regex equivalence problem:
http://en.wikipedia.org/wiki/Regular_expression#Deciding_equivalence_of_regular_expressions; we cannot encode loops in SMARTS to make it undecidable, right?). My problem is somewhat simpler in that I need to ensure that under a fully permissive SMARTS wildcard, i.e., any atom, I need to check equivalence of reactions. (I can even assume that every wildcard is just a match against "any atom")
My requirements are best illustrated by example. Below are four SMARTS that I need to ensure can be identified to be equivalent:
- [H,*:1]O[H].[H,*:2]N([H,*:4])C(=[H,*:3])[H,*:5]>>[H,*:1]OC(=[H,*:3])[H,*:5].[H,*:2]N([H,*:4])[H]
- [H,*:1]C(=[H,*:2])N([H,*:4])[H,*:5].[H,*:3]O[H]>>[H,*:1]C(=[H,*:2])O[H,*:3].[H,*:4]N([H,*:5])[H]
- [H,*:1]O[H].[H,*:2]N([H,*:5])C([H,*:3])=[H,*:4]>>[H,*:1]OC([H,*:3])=[H,*:4].[H,*:2]N([H,*:5])[H]
As you can see they are syntactically different but identical if you visualize them. And all wildcard are just "any atom". This is not as difficult as the general problem.
Thanks a lot for your help;
saurabh