delph-in / pydelphin

Python libraries for DELPH-IN
https://pydelphin.readthedocs.io/
MIT License
79 stars 27 forks source link

mrs.is_isomorphic() fails for isomorphic graphs that are not well-formed MRSs #296

Closed goodmami closed 4 years ago

goodmami commented 4 years ago

This issue was originally discussed on the matrix-dev mailing list for a failure in the Matrix regression test for neg-mod-mod.

The mrs.is_isomorphic() function implements VF2 but only seems to consider connected graphs.

>>> from delphin import mrs
>>> from delphin.codecs import simplemrs
>>> m = simplemrs.decode('[ TOP: h0 INDEX: e2 RELS: < [ _rain_v_1 LBL: h3 ARG0: e4 ] > HCONS: < h0 qeq h1 > ]')
>>> mrs.is_isomorphic(m, m)
False

Isomorphism should be separate from MRS well-formedness criteria (as much as possible).

arademaker commented 4 years ago

What is the definition of MRS isomorphism? What are applications for it? The structural similarity can be consider a proxy to the meaning equivalence?

goodmami commented 4 years ago

I don't think there's a published and authoritative definition for MRS, but you can see section 5.3.2 in my dissertation for some background. But basically graph isomorphism means that two MRSs are exactly equivalent, even if things like the variable forms or EP order on the RELS list differ.