Checking for equality of two DRSs is very useful when generating readings of a sentence. For example, the glue module generates two readings for the sentence John sees Mary:
>>> from nltk.sem.glue import DrtGlue >>> readings = drtglue.parse_to_meaning('John sees Mary'.split()) >>> for drs in sorted([r.simplify().normalize() for r in readings], key=str): ... print(drs) ([z1,z2],[John(z1), Mary(z2), sees(z1,z2)]) ([z1,z2],[Mary(z1), John(z2), sees(z2,z1)])
However, it is easy to tell that these two readings are logically the same, and therefore one of them is superfluous. We can use the theorem prover to determine this equivalence, and then delete one of them. A particular theorem prover may be specified, or the argument may be left off to use the default.
>>> readings[0].equiv(readings[1]) True
--
You received this message because you are subscribed to the Google Groups "nltk-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nltk-dev+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/nltk-dev/bb3be04d-527d-4bf4-b1bc-e1a75d25c163%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/nltk-dev/69D91763-83AC-4A58-B76B-D1C86A883569%40gmail.com.