CAS LX 502 8b. Formal semantics A fragment of English.

Slides:



Advertisements
Similar presentations
CAS LX 522 Syntax I Week 3b. Constituents.
Advertisements

Semantics Static semantics Dynamic semantics attribute grammars
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
Copyright © Cengage Learning. All rights reserved.
CAS LX 502 Semantics 4b. Events and modification
Grammars, constituency and order A grammar describes the legal strings of a language in terms of constituency and order. For example, a grammar for a fragment.
Grammars, Languages and Parse Trees. Language Let V be an alphabet or vocabulary V* is set of all strings over V A language L is a subset of V*, i.e.,
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
Statistical NLP: Lecture 3
CAS LX 502 8a. Formal semantics Truth and meaning The basis of formal semantics: knowing the meaning of a sentence is knowing under what conditions.
Chapter Chapter Summary Languages and Grammars Finite-State Machines with Output Finite-State Machines with No Output Language Recognition Turing.
Week 3b. Constituents CAS LX 522 Syntax I.
LTAG Semantics on the Derivation Tree Presented by Maria I. Tchalakova.
Artificial Intelligence Knowledge-based Agents Russell and Norvig, Ch. 6, 7.
Comp 205: Comparative Programming Languages Semantics of Imperative Programming Languages denotational semantics operational semantics logical semantics.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
CAS LX 502 Semantics 1b. The Truth Ch. 1.
Installment 10b. Raising, etc CAS LX 522 Syntax I.
CAS LX a. A notational holiday. Sets A set is a collection of entities of any kind. They can be finite: {√2, John Saeed, 1984}. They can be infinite:
Let remember from the previous lesson what is Knowledge representation
Syntactic Pattern Recognition Statistical PR:Find a feature vector x Train a system using a set of labeled patterns Classify unknown patterns Ignores relational.
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
Meaning and Language Part 1.
CAS LX 502 Semantics 2b. A formalism for meaning 2.5, 3.2, 3.6.
Models of Generative Grammar Smriti Singh. Generative Grammar  A Generative Grammar is a set of formal rules that can generate an infinite set of sentences.
Three Generative grammars
CAS LX 502 Semantics 3a. A formalism for meaning (cont ’ d) 3.2, 3.6.
Induction and recursion
INTRODUCTION TO THE THEORY OF COMPUTATION INTRODUCTION MICHAEL SIPSER, SECOND EDITION 1.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
CAS LX 502 Semantics 5b. Pronouns, assignments, and quantifiers 5.7(.1), 6.1.
CSNB143 – Discrete Structure Topic 11 – Language.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
LOGIC AND ONTOLOGY Both logic and ontology are important areas of philosophy covering large, diverse, and active research projects. These two areas overlap.
Semantic Construction lecture 2. Semantic Construction Is there a systematic way of constructing semantic representation from a sentence of English? This.
Interpreting Language (with Logic)
Albert Gatt LIN3021 Formal Semantics Lecture 4. In this lecture Compositionality in Natural Langauge revisited: The role of types The typed lambda calculus.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Rules, Movement, Ambiguity
Artificial Intelligence: Natural Language
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
CAS LX a. Plurals, mass, and measurement. Singular individuals The Last Juror is a book. Cat’s Cradle is a book. Semantics is a book. [book] M,g.
CAS LX 502 Semantics 5a. Plurals, mass, and measurement 5.5.
SYNTAX.
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
Parsing and Code Generation Set 24. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program,
CAS LX b. Binding. Syntactic base rules (F2) S  NP VPVP  Vt NP S  S ConjPVP  Vi ConjP  Conj SNP  Det N C S  Neg SNP  N P Det  the, a, everyN.
CAS LX b. Summarizing the fragment analysis, relative clauses.
Language and Cognition Colombo, June 2011 Day 2 Introduction to Linguistic Theory, Part 3.
CAS LX 502 9b. Formal semantics Pronouns and quantifiers.
Albert Gatt LIN3021 Formal Semantics Lecture 3. Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of.
1 Lecture 3 The Languages of K, T, B and S4. 2 Last time we extended the language PC to the language S5 by adding two new symbols ‘□’ (for ‘It is necessary.
NATURAL LANGUAGE PROCESSING
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
Week 3. Clauses and Trees English Syntax. Trees and constituency A sentence has a hierarchical structure Constituents can have constituents of their own.
King Faisal University جامعة الملك فيصل Deanship of E-Learning and Distance Education عمادة التعلم الإلكتروني والتعليم عن بعد [ ] 1 King Faisal University.
System Software Unit-1 (Language Processors) A TOY Compiler
Propositional Calculus: Boolean Functions and Expressions
3b. A formalism for meaning (cont’d again): F2 3.2, 3.6
Copyright © Cengage Learning. All rights reserved.
Chapter Eight Syntax.
11a. Predicate modification and adjectives
Part I: Basics and Constituency
Structural relations Carnie 2013, chapter 4 Kofi K. Saah.
Chapter Eight Syntax.
Natural Language - General
Axiomatic semantics Points to discuss: The assignment statement
Introducing Natural Deduction
Validity and Soundness, Again
Presentation transcript:

CAS LX 502 8b. Formal semantics A fragment of English

Infinite use, finite means A fundamental property of language is its recursive nature—we can create unboundedly many new sentences, and understand what they mean. “Infinite use of finite means,” one of the main reasons to suppose that our knowledge of language is systematic, that language is not a collection of habits and analogy, but must be described by a grammar.

Infinite use, finite means In the domain of syntax, the task is primarily to describe/explain why some arrangements of words count as sentences of English, others don’t, and more broadly, how this system relates to those underlying other languages, and how this system can arise.

Syntax The generally accepted view of syntax breaks sentences down into hierarchical parts. There are nouns, there are verbs, there are units made of verbs and nouns. New sentences can be created by mixing and matching these components together. [ S Pat [ AuxP will [ VP eat [ NP the sandwich]]]] [ S The students [ AuxP have [ VP risen [ PP in protest]]]]

Semantics We’re not here to study syntax, we’re here to study semantics, but we’re going to delve a bit into both. The syntactic system that defines what are “good sentences of English” provides hierarchical structures, but we know not only what sequences of words might be classified as “English” but we know what those sequences of words mean. Just as there must be a grammar that defines what sequences of words are English, there must also be a grammar that tells us how the meanings of the parts contribute to the meaning of the whole.

F1 To that end, we are going to create a “mini- grammar of English”, a fragment. This grammar will provide both the syntactic structure of a small number of English sentences and the rules by which we can understand their meaning. By doing this, we can start to understand what is involved in the grammar of semantics more generally.

F1 Rewrite rules (the syntax): S  N VPN  Pavarotti, Loren, Bond S  S conj SVi  is boring, is hungry, is cute S  neg SVt  likes VP  Vt NConj  and, or VP  ViNeg  it is not the case that

Using the syntax of F1 We start with S (we are building a sentence). S

Using the syntax of F1 We start with S (we are building a sentence). Several different rules can apply. We can either rewrite S as N VP, or as S conj S, or as neg S. Let’s pick N VP. S N VP

Using the syntax of F1 We start with S (we are building a sentence). Several different rules can apply. We can either rewrite S as N VP, or as S conj S, or as neg S. Let’s pick N VP. Now, N can be rewritten as Pavarotti, Loren, or Bond. S N VP Bond

Using the syntax of F1 We start with S (we are building a sentence). Several different rules can apply. We can either rewrite S as N VP, or as S conj S, or as neg S. Let’s pick N VP. Now, N can be rewritten as Pavarotti, Loren, or Bond. And VP can be rewritten either as Vt N or Vi. S N VP Vi Bond

Using the syntax of F1 We start with S (we are building a sentence). Several different rules can apply. We can either rewrite S as N VP, or as S conj S, or as neg S. Let’s pick N VP. Now, N can be rewritten as Pavarotti, Loren, or Bond. And VP can be rewritten either as Vt N or Vi. And Vi can be rewritten as is boring, is hungry, or is cute. S N VP Vi is hungry Bond

Using the syntax of F1 With this little grammar, we can already create an unbounded number of sentences. It is not the case that Bond is boring or Loren is hungry.

Using the syntax of F1 It is not the case that Bond is boring or Loren is hungry. S Neg S N VP BondVi is boring It is not the case that S N VP LorenVi is hungry SConj or

Using the syntax of F1 It is not the case that Bond is boring or Loren is hungry. S Neg S N VP BondVi is boring It is not the case that S N VP LorenVi is hungry SConj or

Compositionality A fundamental assumption about how it is that we can know what novel sentences mean is that meaning is compositional. The meaning of the whole is derived from the meaning of the parts and how the parts are arranged. The syntax gives us the parts and how they are arranged, now we must approach the question of how the meaning is assigned to the parts and from there to the whole.

Enter [ ] M Here, we turn to [ ] M, the evaluation function. We already talked about the first steps: M= [Pavarotti] M = F(Pavarotti) = Pavarotti [Loren] M = F(Loren) = Loren [Bond] M = F(Bond) = Bond [is boring] M = F(is boring) = {Loren, Pavarotti} [is hungry] M = F(is hungry) = {Bond, Pavarotti} [is cute] M = F(is cute) = {Loren, Bond}

[ ] M We can write the denotation of the terminal nodes using those rules. S N VP Vi is hungry Bond [Bond] M = F(Bond) = Bond [is hungry] M = F(is hungry) = {Bond, Pavarotti}

[ ] M We can write the denotation of the terminal nodes using those rules. And, on the principle of compositionality, we can assume the that nodes above share the same denotation (where there is no combination involved) S N VP Vi is hungry Bond [Bond] M = F(Bond) = Bond [is hungry] M = F(is hungry) = {Bond, Pavarotti}

[ ] M Now, to determine the meaning of the S as a whole, we want to combine the denotation of N and VP such that the S is true just in case (here), Bond is hungry. That is, true just in case [N] M is in the set [VP] M. S N VP Vi is hungry Bond [Bond] M = F(Bond) = Bond [is hungry] M = F(is hungry) = {Bond, Pavarotti}

[ ] M We can define a semantic rule for interpretation that says just that: [ S N VP] M = true iff [N] M  [VP] M, otherwise false. S N VP Vi is hungry Bond [Bond] M = F(Bond) = Bond [is hungry] M = F(is hungry) = {Bond, Pavarotti}

[ ] M Thus, we end up with an interpretation of this sentence that goes like this: [S] M = true iff F(Bond)  F(is hungry), otherwise false. Given this particular model, that boils down to [S] M = true iff Bond  {Bond, Pavarotti}, otherwise false. (True in this situation) S N VP Vi is hungry Bond [Bond] M = F(Bond) = Bond [is hungry] M = F(is hungry) = {Bond, Pavarotti}

A semantic rule for every structural rule Our goal is to design a semantics for F1 that can provide an interpretation (truth conditions) for any structure that the syntax can provide. So, we also need rules for structures like S conj S, neg S, Vt N.

Neg S As for Neg S, we want it to be false whenever S is true, and true whenever S is false. [Neg S] M =false if [S] M = true, true if [S] M = false. However, this is not quite enough—we want to have an interpretation for every node in the tree. This gives us an interpretation of [ S Neg S], but what is the interpretation of Neg?

Neg What Neg does is takes the truth value of the S it is next to and reverses it. It is a function—it takes the truth value of the S it is next to as an argument, and returns a truth value (the opposite one). [it is not the case that] M =true  false false  true

Neg S [ S [ Neg It is not the case that] [ S´ Pavarotti is boring]]. [Neg] M = [It is not the case that] M = true  false false  true [S´] M = true iff [N] M  [VP] M, otherwise false = true iff [Pavarotti] M  [Vi] M, otherwise false = true iff [Pavarotti] M  [is boring] M, otherwise false = F(Pavarotti)  F(is boring), otherwise false

Neg S [ S [ Neg It is not the case that] [ S´ Pavarotti is boring]]. And, so [ S Neg S´] M = [Neg] M ( [S´] M ). Resulting in: [S] M = false if F(Pavarotti)  F(is boring), otherwise true.

And For dealing with and and or, we also want to define a function. We want S 1 and S 2 to be true when S 1 is true and S 2 is true, and false under any other circumstance. [ S S 1 Conj S 2 ] M = [Conj] M ( ) [and] M =  true  false  false  false

Or For dealing with and and or, we also want to define a function. We want S 1 or S 2 to be false when S 1 is false and S 2 is false, and true under any other circumstance. [ S S 1 Conj S 2 ] M = [Conj] M ( ) [or] M =  true  true  true  false

Revisiting verbs Earlier, we defined a meaning for is boring by explicitly listing the set of boring individuals. This relies on a specific model/situation. We want to be more general than that, so that our interpretation rules work in any model. [is boring] M = {x: x is boring in M} [is boring] M = {x  U : x  F(is boring)}

Generalizing We also do not yet have a general statement of how to evaluate [ S N VP] M. [ VP [ Vi is boring]] M = {x : x is boring in M} [ S N VP] M = true iff [N] M  [VP] M, otherwise false

Transitive verbs The one piece of the model that we have not addressed yet are transitive verbs, like likes. S  N VP VP  Vt N Vt  likes We want to be able to evaluate [ S N VP] M the same way whether VP is built from a transitive verb or an intransitive verb. That is, we want [VP] M to be a predicate, a set of individuals.

Transitive verbs Essentially, we want [likes Bond] M to be a set of those individuals that like Bond in M. However, we need a definition for [likes] M (we already have one for [Bond] M ). It should be something that creates a set of individuals that depends on the individual next to it in the structure. A function again.

Transitive verbs Like and, likes relates two things, although likes relates two individuals, and and relates two sentences. So, we build a two-place predicate, in the same way: [likes] M = { : x likes y in M } For example, if P likes L, L likes B and that’s all the liking in this situation, then [likes] M = {, }

Transitive verbs And then, we define a rule that will interpret the VP in a sentence with a transitive verb: [ VP Vt N] M = {x :  [Vt] M } So if [N] M = Bond, then [ VP Vt N] M is the set containing those individuals who like Bond in M.

S  N VP[ S N VP] M = true iff [N] M  [VP] M, otherwise false S  S Conj S [ S S 1 Conj S 2 ] M = [Conj] M ( ) S  Neg S [ S Neg S´] M = [Neg] M ( [S´] M ). VP  Vt N[ VP Vt N] M = {x :  [Vt] M } VP  Vi N  Pavarotti, … [Pavarotti] M = F(Pavarotti) Vi  is boring, … [is boring] M = {x: x is boring in M} Vt  likes [likes] M = { : x likes y in M } Conj  and, … [and] M = {,true>,,false>, …} Neg  it is not the case that [iintct] M = {, }

What we have We have created a little fragment describing a (very small) subset of English, generating structural descriptions of syntactically valid sentences and providing the means to determine the truth conditions of these sentences. We did this by formulating a set of syntactic rewrite rules, each accompanied by a semantic rule of interpretation, such that every syntactic step can be interpreted compositionally.

One step more general Looking over the rules that we have, we can actually go a step further in generalizing our semantic rules (helpful as we expand our fragment’s coverage). There are basically two kinds of rules we have: Those that combine meanings of adjacent (sister) nodes in the syntactic structure, and those that define intrinsic (non-compositional) meanings.

Semantic type The entire semantics that we are creating here depends on two types of things, individuals and truth values. We can label individuals as being of type “e” (traditional, think “entity”), and truth values as being of type “t”. In these terms, names like Bond are of type, and sentences like Bond is hungry are of type.

Characteristic functions For predicates like is hungry, we have considered these to be sets of individuals (e.g., those that are hungry in the model). We can look at those same individuals in a slightly different way, using the characteristic function of the set. A characteristic function is a function that, given an argument, will return true iff the argument was a member of the set, and false otherwise. The same information content as the set.

Predicates as functions So, without losing information, we can view predicates from the perspective of their characteristic functions and define is hungry to instead be a function that, given an individual, will return true if the individual is hungry in the model. [is hungry] M =x  true if x is hungry in M x  false otherwise

Semantic type Predicates like is hungry can then be said to have semantic type. That is, a function from individuals to truth values. Similarly, it is not the case that can be taken to be of type, a function from truth values to truth values.

Transitive verbs For transitive verbs, what we want is a relation between two individuals, resulting in a truth value. The way we have it set up now, a verb like likes will combine with the object to form a simpler predicate like likes Bond, at which point it acts just like is boring. So, here, we want likes to take an argument of type and return a predicate of type. So, we define it as a function of type >.

Transitive verbs That is, we can define [likes] M as something like this: [likes] M = x  f where f is a function from individuals to truth values and f(y) = true iff y likes x in M, otherwise false. That is, [likes] M is a function from individuals to functions (from individuals to truth values): semantic type >.

Why we’re doing this Once we have defined things in terms of semantic type, and in terms of functions and arguments, we can collapse a number of our semantic interpretation rules into more general rules. Functional application: [   ] M = [  ] M ([  ] M ) or [  ] M ([  ] M ), whichever is defined. Pass up: [   ] M = [  ] M

            