Journal of Logic, Language and Information

, Volume 23, Issue 4, pp 441–480 | Cite as

Natural Language Inference in Coq

  • Stergios ChatzikyriakidisEmail author
  • Zhaohui Luo


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.


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



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.


  1. Asher, N. (2011). Lexical meaning in context: A web of words. Cambridge: Cambridge University Press.CrossRefGoogle Scholar
  2. Asher, N., & Luo, Z. (2012). Formalisation of coercions in lexical semantics. Sinn und Bedeutung 17, Paris 223.Google Scholar
  3. 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
  4. Blackburn, P., & Bos, J. (2005). Representation and inference for natural language. Stanford: CSLI Publications.Google Scholar
  5. 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.
  6. 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
  7. 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
  8. Callaghan, P., & Luo, Z. (2001). An implementation of LF with coercive subtyping and universes. Journal of Automated Reasoning, 27(1), 3–27.CrossRefGoogle Scholar
  9. 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
  10. 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
  11. 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
  12. Church, A. (1940). A formulation of the simple theory of types. The Journal of Symbolic Logic, 5(1), 56–68.Google Scholar
  13. 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.
  14. 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
  15. 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
  16. 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
  17. Fox, C., & Lappin, S. (1990). Foundations of intensional semantics. Oxford: Oxford University Press.Google Scholar
  18. 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
  19. Goguen, H. (1994). A typed operational semantics for type theory. Ph.D. thesis, University of Edinburgh.Google Scholar
  20. Gonthier, G. (2005). A computer-checked proof of the four colour theorem.
  21. Grudzinska, J., & Zawadowski, M. (2014). System with generalized quantifiers on dependent types for anaphora. In Proceedings of EACL 2014.Google Scholar
  22. 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
  23. 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
  24. Ljunglof, P., & Siverbo, M. (2011). A bilingual treebank for the FraCas test suite. Clt project report, University of Gothenburg.Google Scholar
  25. Luo, Z. (1994). Computation and reasoning: A type theory for computer science. Oxford: Oxford University Press.Google Scholar
  26. Luo, Z. (1999). Coercive subtyping. Journal of Logic and Computation, 9(1), 105–130.CrossRefGoogle Scholar
  27. Luo, Z. (2010). Type-theoretical semantics with coercive subtyping. Semantics and Linguistic Theory 20 (SALT20), Vancouver, 84(2), 28–56.Google Scholar
  28. 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
  29. 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
  30. Luo, Z. (2012). Formal semantics in modern type theories with coercive subtyping. Linguistics and Philosophy, 35(6), 491–513.CrossRefGoogle Scholar
  31. Luo, Z., Soloviev, S., & Xue, T. (2012). Coercive subtyping: Theory and implementation. Information and Computation, 223, 18–42.CrossRefGoogle Scholar
  32. MacCartney, B. (2009). Natural language inference. Ph.D. thesis, Stanford Universisty.Google Scholar
  33. 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
  34. Martin-Löf, P. (1975). An intuitionistic theory of types: predicative part. In H. Rose & J. C. Shepherdson (Eds.), Logic Colloquium’73.Google Scholar
  35. Martin-Löf, P. (1984). Intuitionistic type theory. Naples: Bibliopolis.Google Scholar
  36. 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
  37. Montague, R. (1974). Formal philosophy. New Haven: Yale University Press.Google Scholar
  38. Muskens, R. (2005). Sense and the computation of reference. Linguistics and Philosophy, 28(4), 473–504.Google Scholar
  39. 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
  40. 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
  41. Pulman, S. (2013). Second order inference in NL semantics. Talk given at the KCL Language and Cognition seminar, London.Google Scholar
  42. Pustejovsky, J. (1995). The generative lexicon. Cambridge: MIT.Google Scholar
  43. Ranta, A. (1994). Type-theoretical grammar. Oxford: Oxford University Press.Google Scholar
  44. Ranta, A. (2011). Grammatical framework: Programming with multilingual grammar. Stanford: CSLI Publications.Google Scholar
  45. 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
  46. Sundholm, G. (1989). Constructive generalized quantifiers. Synthese, 79(1), 1–12.CrossRefGoogle Scholar
  47. The Coq Development Team. (2007). The Coq Proof Assistant Reference Manual (Version 8.1), INRIA.Google Scholar
  48. Wilson, S., Fleuriot, A., & Smaill, A. (2010). Inductive proof automation for coq. In Proceedings of the 2nd Coq Workshop. EPTCS.Google Scholar
  49. Xue, T., & Luo, Z. (2012). Dot-types and their implementation. In Logical aspects of computational linguistics (LACL 2012). LNCS 7351.Google Scholar

Copyright information

© Springer Science+Business Media Dordrecht 2014

Authors and Affiliations

  1. 1.Department of Computer Science, Royal HollowayUniversity of LondonEghamUK
  2. 2.Open University of CyprusNicosiaCyprus

Personalised recommendations