# Natural Language Inference in Coq

- 281 Downloads
- 9 Citations

## Abstract

In this paper we propose a way to deal with natural language inference (NLI) by implementing Modern Type Theoretical Semantics in the proof assistant Coq. The paper is a first attempt to deal with NLI and natural language reasoning in general by using the proof assistant technology. Valid NLIs are treated as theorems and as such the adequacy of our account is tested by trying to prove them. We use Luo’s Modern Type Theory (MTT) with coercive subtyping as the formal language into which we translate natural language semantics, and we further implement these semantics in the Coq proof assistant. It is shown that the use of a MTT with an adequate subtyping mechanism can give us a number of promising results as regards NLI. Specifically, it is shown that a number of inference cases, i.e. quantifiers, adjectives, conjoined noun phrases and temporal reference among other things can be successfully dealt with. It is then shown, that even though Coq is an interactive and not an automated theorem prover, automation of all of the test examples is possible by introducing user-defined automated tactics. Lastly, the paper offers a number of innovative approaches to NL phenomena like adjectives, collective predication, comparatives and factive verbs among other things, contributing in this respect to the theoretical study of formal semantics using MTTs.

## Keywords

Type theory Coercive subtyping Natural language inference Formal semantics Coq FraCas test suite## Notes

### Acknowledgments

This work is supported by the Grant F/07-537/AJ of the Leverhulme Trust in U.K. Two anonymous reviewers are also thanked for providing detailed and insightful comments and suggestions on an earlier draft of this paper.

## References

- Asher, N. (2011).
*Lexical meaning in context: A web of words*. Cambridge: Cambridge University Press.CrossRefGoogle Scholar - Asher, N., & Luo, Z. (2012). Formalisation of coercions in lexical semantics.
*Sinn und Bedeutung 17*, Paris 223.Google Scholar - Bassac, C., Mery, M., & Retoré, C. (2010). Towards a type-theoretical account of lexical semantics.
*Journal of Logic Language and Information*,*19*, 229–245.CrossRefGoogle Scholar - Blackburn, P., & Bos, J. (2005).
*Representation and inference for natural language*. Stanford: CSLI Publications.Google Scholar - Blazy, S., Dargaye, Z., & Leroy, X. (2006) Formal verification of a C compiler front-end. In
*FM 2006: International symposium on formal methods. Lecture Notes in Computer Science*(Vol. 4085, pp. 460–475). Berlin: Springer. http://gallium.inria.fr/~xleroy/publi/cfront.pdf. - Bos, J., & Markert, K. (2005). Recognising textual entailment with logical inference. In
*Proceedings of the 2005 conference on empirical methods in natural language processing (EMNLP)*(pp. 98–103).Google Scholar - Bos, J., & Markert, K. (2006). When logical inference helps determining textual entailment (and when it doesn’t). In
*Proceedings of the 2nd PASCAL challenges workshop on recognising textual entailment*.Google Scholar - Callaghan, P., & Luo, Z. (2001). An implementation of LF with coercive subtyping and universes.
*Journal of Automated Reasoning*,*27*(1), 3–27.CrossRefGoogle Scholar - Chatzikyriakidis, S. (2014). Adverbs in a modern type theory. In N. Asherl & S. Soloviev (Eds.),
*Proceedings of LACL2014. LNCS 8535*(pp. 44–56).Google Scholar - Chatzikyriakidis, S., & Luo, Z. (2012). An account of natural language coordination in type theory with coercive subtyping. In Y. Parmentier & D. Duchier (Eds.),
*Proceedings of constraint solving and language processing (CSLP12)*(pp. 31–51). LNCS 8114, Orleans.Google Scholar - Chatzikyriakidis, S., & Luo, Z. (2013). Adjectives in a modern type-theoretical setting. In G. Morrill & J. Nederhof (Eds.),
*Proceedings of formal grammar 2013*(pp. 159–174). LNCS 8036.Google Scholar - Church, A. (1940). A formulation of the simple theory of types.
*The Journal of Symbolic Logic*,*5*(1), 56–68.Google Scholar - Cooper, R., Crouch, D., van Eijck, J., Fox, C., van Genabith, J., Jaspars, J., Kamp, H., Milward, D., Pinkal, M., Poesio, M., & Pulman, S. (1996).
*Using the framework*. Technical Report LRE 62–051r. http://www.cogsci.ed.ac.uk/~fracas/. - Dagan, I., Glickman, D., & Magnini, B. (2006). The PASCAL recognising textual entailment challenge. In J. Quionero-Candela, I. Dagan, B. Magnini & F. d’Alch-Buc (Eds.),
*Machine learning challenges*(pp. 177–190). LNCS 3944.Google Scholar - Davidson, D. (1967). Compositionality and coercion in semantics: The semantics of adjective meaning. In N. Rescher (Ed.),
*The logical form of action sentences*(pp. 81–95). Pittsburgh: University of Pittsburgh Press.Google Scholar - Davidson, D. (1967). The logical form of action sentences. In N. Rescher (Ed.),
*The logic of decision and action*. Pittsburgh: University of Pittsburgh Press.Google Scholar - Fox, C., & Lappin, S. (1990).
*Foundations of intensional semantics*. Oxford: Oxford University Press.Google Scholar - Girard, J. Y. (1971). Une extension de l’interpretation fonctionelle de Gödel à l’analyse et son application à l’élimination des coupures dans et la théorie des types’. In
*Proceedings of 2nd Scandinavian logic symposium*, North-Holland.Google Scholar - Goguen, H. (1994).
*A typed operational semantics for type theory*. Ph.D. thesis, University of Edinburgh.Google Scholar - Gonthier, G. (2005).
*A computer-checked proof of the four colour theorem*. http://research.microsoft.com/~gonthier/4colproof.pdf. - Grudzinska, J., & Zawadowski, M. (2014). System with generalized quantifiers on dependent types for anaphora. In
*Proceedings of EACL 2014*.Google Scholar - Kamp, H. (1975). Formal semantics of natural language. In E. Keenan (Ed.),
*Two theories about adjectives*(pp. 123–155). Cambridge: Cambridge University Press.Google Scholar - Lappin, S. (To appear). Curry typing, polymorphism, and fine-grained intensionality. In S. Lappin & C. Fox (Eds.),
*Handbook of contemporary semantic theory*. Oxford: Blackwell.Google Scholar - Ljunglof, P., & Siverbo, M. (2011).
*A bilingual treebank for the FraCas test suite*. Clt project report, University of Gothenburg.Google Scholar - Luo, Z. (1994).
*Computation and reasoning: A type theory for computer science*. Oxford: Oxford University Press.Google Scholar - Luo, Z. (1999). Coercive subtyping.
*Journal of Logic and Computation*,*9*(1), 105–130.CrossRefGoogle Scholar - Luo, Z. (2010). Type-theoretical semantics with coercive subtyping.
*Semantics and Linguistic Theory 20 (SALT20), Vancouver*,*84*(2), 28–56.Google Scholar - Luo, Z. (2011). Contextual analysis of word meanings in type-theoretical semantics. In
*Logical aspects of computational linguistics*(LACL’2011) (pp. 159–174). LNAI 6736.Google Scholar - Luo, Z. (2012). Common nouns as types. In D. Bechet & A. Dikovsky (Eds.),
*Logical aspects of computational linguistics*(LACL’2012) (pp. 173–185). LNCS 7351.Google Scholar - Luo, Z. (2012). Formal semantics in modern type theories with coercive subtyping.
*Linguistics and Philosophy*,*35*(6), 491–513.CrossRefGoogle Scholar - Luo, Z., Soloviev, S., & Xue, T. (2012). Coercive subtyping: Theory and implementation.
*Information and Computation*,*223*, 18–42.CrossRefGoogle Scholar - MacCartney, B. (2009).
*Natural language inference*. Ph.D. thesis, Stanford Universisty.Google Scholar - Maienborn, C., & Schafer, M. (2011). Adverbs and adverbials. In C. Maienborn, K. von Heusinger, & P. Portner (Eds.),
*Semantics: An international handbook of natural language meaning*(pp. 1390–1420). Mouton: De Gruyter.CrossRefGoogle Scholar - Martin-Löf, P. (1975). An intuitionistic theory of types: predicative part. In H. Rose & J. C. Shepherdson (Eds.),
*Logic Colloquium’73*.Google Scholar - Martin-Löf, P. (1984).
*Intuitionistic type theory*. Naples: Bibliopolis.Google Scholar - Montague, R. (1973). The proper treatment of quantification in ordinary English. In J. Hintikka, J. Moravcsik & P. Suppes (Eds.),
*Approaches to natural languages*(pp. 221–242).Google Scholar - Montague, R. (1974).
*Formal philosophy*. New Haven: Yale University Press.Google Scholar - Muskens, R. (2005). Sense and the computation of reference.
*Linguistics and Philosophy*,*28*(4), 473–504.Google Scholar - Partee, B. (2007). Compositionality and coercion in semantics: The semantics of adjective meaning. In G. Bouma, I. Krämer & J. Zwarts (Eds.),
*Cognitive foundations of interpretation*(pp. 145–161). Royal Netherlands Academy of Arts and Sciences.Google Scholar - Partee, B. (2010). Privative adjectives: Subsective plus coercion. In R. Bauerle & U. Reyle (Eds.),
*Presuppositions and discourse: Essays offered to Hans Kamp*(pp. 123–155). Bingley: Emerald Group Publishing.Google Scholar - Pulman, S. (2013).
*Second order inference in NL semantics*. Talk given at the KCL Language and Cognition seminar, London.Google Scholar - Pustejovsky, J. (1995).
*The generative lexicon*. Cambridge: MIT.Google Scholar - Ranta, A. (1994).
*Type-theoretical grammar*. Oxford: Oxford University Press.Google Scholar - Ranta, A. (2011).
*Grammatical framework: Programming with multilingual grammar*. Stanford: CSLI Publications.Google Scholar - Sundholm, G. (1986). Proof theory and meaning. In D. Gabbay & F. Guenthner (Eds.),
*Handbook of philosophical logic III: Alternatives to classical logic*(pp. 471–506). Reidel.Google Scholar - Sundholm, G. (1989). Constructive generalized quantifiers.
*Synthese*,*79*(1), 1–12.CrossRefGoogle Scholar - The Coq Development Team. (2007).
*The Coq Proof Assistant Reference Manual*(Version 8.1), INRIA.Google Scholar - Wilson, S., Fleuriot, A., & Smaill, A. (2010). Inductive proof automation for coq. In
*Proceedings of the 2nd Coq Workshop*. EPTCS.Google Scholar - Xue, T., & Luo, Z. (2012). Dot-types and their implementation. In
*Logical aspects of computational linguistics*(LACL 2012). LNCS 7351.Google Scholar