To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
In this chapter we introduce the computational toolset that we are going to use throughout the book: the programming language Haskell. No prior knowledge of programming is assumed; you will learn everything you need to know about Haskell and (functional) programming as we go along.
The Programming Language Haskell
As a functional programming language, Haskell is a member of the Lisp family, as are Scheme, ML, Occam, Clean, and Erlang. It was designed to form a standard for functional programming languages and was named after the mathematician and logician Haskell B. Curry. We already mentioned that it is based on the lambda calculus, just like the other family members. In fact, Haskell is so faithful to its origins that it is purely functional, i.e. functions in Haskell do not have any side effects. (However, there is a way to perform computations with side effects, like change of state, in a purely functional fashion. We will come across this later on in the book, but it will not be of concern for us now.)
Three very important characteristic features of Haskell are the following. First, functions are first-class citizens. This means that functions may be passed as arguments to other functions and also can be returned as the result of some function. Second, functions are permitted to be recursive. The significance of this we will see in Section 3.5.
The view of computational semantics that informs and drives this book is one that sees the computation of linguistic meaning as that of computing logically transparent representations of meaning from “raw linguistic data”, linguistic input as it reaches a recipient when he hears something or reads it, and to which he has to attach a sense. The book abstracts away from the differences between hearing and reading in that it assumes that the “raw data” have already been preprocessed as strings of words. Such computations of meaning are generally assumed to involve the computation of structure at several levels, minimally at a level of syntactic form and then, via the syntactic structure obtained at that level, of the semantic representation. This implies that in order to do computational semantics properly you need proficiency in at least three things: (i) proficiency in computation (you need to be proficient in the use of at least one suitable programming language), (ii) proficiency in syntax, and (iii) proficiency in semantics, in the more narrow sense in which semantics is understood by many linguists, but also in a broader sense.
The message this book drives home is that computing semantic representations from “raw data” isn't all there is to computational semantics. Computing semantic representations wouldn't be of much use to us if, once we have constructed them, there wouldn't be anything we could do with them.
This book on applications of logic in the semantic analysis of language pays the reader the compliment of not assuming anything about what he or she knows (in particular, no specific logical knowledge or experience with programming is presupposed), while making very flattering assumptions about his or her intelligence and interest in the subject matter.
The method used throughout in the book is the pursuit of logical questions and implementation issues occasioned by concrete examples of formally defined language fragments. At first, no distinction is made between formal and natural language; in the first chapter it is explained why. At the end of the text the reader should have acquired enough knowledge and skills for the development of (at least the semantic part of) fairly serious Natural Language Processing applications. The reader who makes it to the end of the book will also find that he or she has acquired considerable programming skills, and will have learned how to put a wide variety of logical systems to use for natural language analysis.
Throughout the text, abstract concepts are linked to concrete representations in the functional programming language Haskell. Haskell is a language that is well suited for our purposes because it comes with a variety of very easy to use interpreters: Hugs, GHCi, and Helium. Haskell interpreters, compilers, and documentation are freely available from the Internet.
In this chapter we will interpret verb phrases as relations of various arities, using a type of arbitrary arity relations. The problem of encoding relations in type theory in such a way that the usual logical operations can be applied to them (relations should be ‘conjoinable’, as the jargon has it) has been studied extensively in the semantic literature. We will define conjunction, disjunction, and complementation on our relational types. Next we turn to the interpretation of determiner phrases as functions from (n+1)-ary relations to n-ary relations, the interpretation of m-ary sequences of determiner phrases as functions from (n + m)-ary relations to n-ary relations, and to the handling of scope reversal for such functions.
Interpreting NP Lists
Instead of analysing the sentence Every unicorn ate a lettuce leaf as a relation between the CN property of being a unicorn and the VP property of eating lettuce leaves (namely the relation of inclusion), it is also possible to look at the complex expression Every unicorn _ a lettuce leaf, and interpret that as a function that takes a relation (a denotation of a transitive verb) and produces a truth value. Similarly, Every unicorn was fed a lettuce leaf by some fairy can be analysed as stating that the set of unicorns is included in the set of entities that were fed a lettuce leaf by some fairy, but it is also possible to look at the complex expression Every unicorn _ a lettuce leaf by some fairy, and even at Every unicorn _ a lettuce leaf _ some fairy.
In the last chapter we gave an indirect interpretation for our natural language fragment. We translated natural language sentences into logical forms and then evaluated these logical forms with respect to a model. Logical forms were predicate logical formulas, which were constructed from type logical expressions. We used Haskell as a lambda calculus engine for this construction procedure. This worked very well, but it has the disadvantage that the Haskell interpreter hides the details of how expressions of typed logic get simplified. In this chapter, we will demonstrate that the composition of meaning can be carried out without a logical form language as intermediate representation level. We will give direct instructions for connecting natural language expressions to the “world” outside language (represented by an appropriate model). We will show how models of predicate logic can be extended to models of typed logic, and how typed logic yields appropriate meaning representations for the lexical items of natural language fragments and provides the means for building up meanings in a compositional way. But before we engage in this, we must focus on a key ingredient in natural language semantics: quantifiers.
Rules of the Game
An invitation to translate English sentences from an example fragment of natural language given by some set of grammar rules into some logic – predicate logic, or typed logic – presupposes two things: (i) that you grasp the meanings of the formulas of the representation language, and (ii) that you understand the meanings of the English sentences.
And now, Dear Reader who got this far, let us take a minute to address you, before we take our leave. You have come a long way indeed. You started out wanting to know a thing or two about natural language semantics, and look where you are now. At the end of this book you find yourself well on your way towards mastery of functional programming. Also, you have gained quite a bit of experience in the application of formal tools in semantic and pragmatic analysis of natural language. For sure, there is a lot more to be learned, but now it is time to relax and be proud of what you have achieved. At least treat yourself to a beer. We think you have earned it.
The semantic treatment we have given up to now consisted of evaluation in a single (predicate logical) model. In this chapter, we will make the distinction between extensional and intensional evaluation. Extension is interpretation in a single model, intension is interpretation across different possible situations. In the preceding chapters we talked about expressions (signifiers) and their interpretations (referents). In this chapter we will discuss a way to make technical sense of the sense or the signified, the concept or idea that an expression invokes in a user of the language. The resulting semantics is called possible world semantics or intensional semantics. It is one of the trademarks of Montague grammar.
Sense and Reference, Intension and Extension
In his paper On Sense and Reference (1892) the German mathematician and philosopher Gottlob Frege made a famous distinction between the sense (German: Sinn) of an expression and its reference (German: Bedeutung). The reference of a name, according to Frege, is the thing that the name refers to. The sense of the name is the thought that allows us to identify the referent. Frege discusses various examples. If a, b, c denote the lines that connect the vertices of a triangle to the midpoints of the opposite sides, then the intersection of a and b coincides with the intersection of b and c.
This chapter introduces computational semantics as the art and science of computing meanings for the expressions of a language. The chapter starts with a general overview of the formal study of language. The broad areas of syntax, semantics and pragmatics are distinguished, and the concept of meaning is discussed. Since the book will focus on language as a tool for describing states of affairs and for conveying information, and since logicians have designed special purpose tools for just these tasks, logic will be important to us. The chapter emphasizes the similarities between natural languages and the formal languages that have been designed by logicians and computer scientists. The chapter ends with a discussion of the usefulness of (functional) programming for computational semantics, and with an overview of the rest of the book.
The Study of Natural Language
Language is one of the most remarkable capacities of human beings and one of the distinctive features that set us apart from other inhabitants of this planet. Human languages are sophisticated systems for manipulating information-encoding symbols, and for composing sounds into structured expressions such as words, phrases, and sentences. These expressions can then serve in numerous ways for communicative actions like information exchange, persuading and deceiving, expressing thoughts, reasoning, and much more.
Linguistics is the scientific study of human language. To make linguistics into a science it is necessary to specify the object of study.
This chapter explains the basics of formal notation, lambda calculus, type theory, and functional programming.
Sets and Set Notation
All mathematical and logical concepts we will come across in the course of the book can be defined in terms of the fundamental concept of a set. We will thus start by introducing some basic set theory.
A set is a collection of definite, distinct objects. This is too vague for a definition, but unfortunately we cannot do better, and fortunately that does not matter. Let us give some examples of sets instead. Our first example is the set of words in the third edition of the Oxford Advanced Learner's Dictionary of Current English. Other examples are the set of colours of the Dutch flag, or the set of letters of the Greek alphabet. Yet another example is the set of even natural numbers greater than seven. And so on.
The elements of a set are also called its members. To indicate that a is an element of a set A we write a ∈ A. To deny that a is an element of a set A we write a ∉ A. The symbol ∈ is the symbol for membership. The elements of a set can be anything: words, colours, people, numbers.
The domei is a popular narrative art form among the Mende people of Sierra Leone. Although it is a traditional form, the narratives are not remembered or retold, but on each occasion the performers recreate out of a common stock of characters and plots domeisia, which are singular and sometimes brilliant expressions of a singular, and often brilliant, culture. In this book Donald Cosentino presents a large selection of these narratives, as he collected them in dramatic performance on the verandahs and around the cooking fires of a Mende village. The domei is told to please, and Dr Cosentino details the various elements that constitute the pleasure of an oral performance. But beneath the surface glitter of these ironic, horrifying, bawdy and haunting narrative performances, there is an intellectual hardness of argument and debate which shines through the domeisia included here. Dominating these performances, and emblematic of the entire artistic tradition, are the 'everywoman' figure of the Defiant Maid, Yombo, and the 'everyman' Stubborn Farmer, Kpana.