Implementing Semantic Theories
In this chapter, a semantic theory is taken to be a collection of rules for specifying the interpretation of a class of natural language expressions. The chapter uses Haskell as the implementation language. It demonstrates that implementing a Montague style fragment in a functional programming language with flexible types is a breeze: Montague's underlying representation language is typed lambda calculus, be it without type flexibility, so Montague's specifications of natural language fragments in PTQ Montague and UG Montague are in fact already specifications of functional programs. The chapter also explains how to implement an evaluation function. As an example of the process of implementing inference for natural language, the chapter considers the language of the Aristotelian syllogism as a tiny fragment of natural language. One of the trademarks of Montague grammar is the use of possible worlds to treat intensionality. The simplest kind of communicative action probably is question answering.