LING 364: Introduction to Formal Semantics Lecture 10 February 14th.

Slides:



Advertisements
Similar presentations
Computational Semantics Aljoscha Burchardt, Alexander Koller, Stephan Walter, Universität des Saarlandes,
Advertisements

October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
CSA2050: DCG I1 CSA2050 Introduction to Computational Linguistics Lecture 8 Definite Clause Grammars.
First-Order Logic (and beyond)
LING 388: Language and Computers Sandiway Fong Lecture 5: 9/5.
LING 364: Introduction to Formal Semantics Lecture 24 April 13th.
CSA4050: Advanced Topics in NLP Semantics IV Partial Execution Proper Noun Adjective.
LING 364: Introduction to Formal Semantics Lecture 18 March 21st.
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.
LING 388: Language and Computers Sandiway Fong Lecture 15.
LING 364: Introduction to Formal Semantics Lecture 8 February 7th.
LING 581: Advanced Computational Linguistics Lecture Notes April 23rd.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 3: 8/29.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
LING 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/12.
LING 364: Introduction to Formal Semantics Lecture 12 February 21st.
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Defining practical programming languages Carlos Varela RPI.
School of Computing and Mathematics, University of Huddersfield CAS810: WEEK 3 LECTURE: LAMBDA CALCULUS PRACTICAL/TUTORIAL: (i) Do exercises given out.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/21.
LING 364: Introduction to Formal Semantics
LING 388 Language and Computers Lecture 14 10/16/03 Sandiway FONG.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 6: 9/6.
LING 364: Introduction to Formal Semantics Lecture 11 February 16th.
LING 388: Language and Computers Sandiway Fong Lecture 6: 9/13.
LING 388 Language and Computers Take-Home Final Examination 12/9/03 Sandiway FONG.
LING 364: Introduction to Formal Semantics Lecture 7 February 2nd.
LING 364: Introduction to Formal Semantics Lecture 16 March 7th.
LING 364: Introduction to Formal Semantics Lecture 3 January 19th.
LING 364: Introduction to Formal Semantics Lecture 13 February 23rd.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 5: 9/5.
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
LING 388: Language and Computers Sandiway Fong Lecture 13: 10/10.
LING 388 Language and Computers Lecture 6 9/18/03 Sandiway FONG.
LING 388 Language and Computers Lecture 15 10/21/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 8.
LING 388: Language and Computers Sandiway Fong 10/4 Lecture 12.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
October 2004csa4050: Semantics II1 CSA4050: Advanced Topics in NLP Semantics II The Lambda Calculus Semantic Representation Encoding in Prolog.
Logical Equivalence & Predicate Logic
LING 388: Language and Computers Sandiway Fong Lecture 17.
CS 2104 Prog. Lang. Concepts Dr. Abhik Roychoudhury School of Computing Introduction.
LING 388: Language and Computers Sandiway Fong Lecture 7.
LING 388: Language and Computers Sandiway Fong Lecture 3.
CMSC 330: Organization of Programming Languages Lambda Calculus Introduction λ.
LING 388: Language and Computers Sandiway Fong Lecture 10.
October 2004CSA4050: Semantics III1 CSA4050: Advanced Topics in NLP Semantics III Quantified Sentences.
Computing Science, University of Aberdeen1 CS4025: Logic-Based Semantics l Compositionality in practice l Producing logic-based meaning representations.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
Semantic Construction lecture 2. Semantic Construction Is there a systematic way of constructing semantic representation from a sentence of English? This.
LING 388: Language and Computers Sandiway Fong Lecture 12.
Albert Gatt LIN3021 Formal Semantics Lecture 4. In this lecture Compositionality in Natural Langauge revisited: The role of types The typed lambda calculus.
Rules, Movement, Ambiguity
Types and Programming Languages Lecture 6 Simon Gay Department of Computing Science University of Glasgow 2006/07.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
 Chapter 8 (Part 2) Transformations Transformational Grammar Engl 424 Hayfa Alhomaid.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
CMSC 330: Organization of Programming Languages Operational Semantics.
LING 364: Introduction to Formal Semantics Lecture 21 April 4th.
CMSC 330: Organization of Programming Languages Lambda Calculus Introduction.
CSE-321 Programming Languages -Calculus (II) POSTECH March 26, 2007 박성우.
CSE 425: Functional Programming I Programs as Functions Some programs act like mathematical functions –Associate a set of input values from the function’s.
Week 3. Clauses and Trees English Syntax. Trees and constituency A sentence has a hierarchical structure Constituents can have constituents of their own.
Natural Language Processing
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 24 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 26 Sandiway Fong.
CSA4050: Advanced Topics in NLP
Presentation transcript:

LING 364: Introduction to Formal Semantics Lecture 10 February 14th

Administrivia Reminder –Homework 2 due tonight we did Exercises 1 through 3 in the lab class last Thursday need more help? see me after class today...

Administrivia Thursday –(3:30pm – 4:45pm) Computer Lab Class meet in Social Sciences 224 instead of here

Last Time Grammar Rule Recursion Recursion: –A phrase may contain embedded inside another instance of the same phrase Examples: –sentence with a relative clause [ Sbar [ S I saw [ NP the man [ Sbar who [ S attacked me]]]]] –possessive NPs [ NP [ NP [ NP John]’s mother]’s cat]

Last Time Grammar Rule Recursion (Fixed) Prolog Computation Rule: –always pick the first-mentioned matching grammar rule to try each time we expand a non-terminal General Rule for writing recursive rules: –put recursive case last –i.e. place non-recursive rules for a non-terminal ahead of the recursive ones DCG rules for Possessive NPs: –np --> np, [‘‘‘s‘], n. –n --> [mother]. –n --> [cat]. –np --> [john]. move recursive rule to the end avoid Infinite Loop in Prolog ERROR: out of local stack.

Last Time Chapter 3: More about Predicates Lambda Calculus vs. Prolog notation –easy to understand as just “syntactic sugar” i.e. just an equivalent way of expressing what we’ve been using Prolog for –every logic variable, e.g. X, must be “quantified” using lambda, e.g. λx. –result is a slightly more complicated-looking notation Example: –PhraseLambda CalculusProlog notation –barksλx.x barks barks(X). –Shelby barks[λx.x barks](Shelby) barks(X), X = shelby. Example (Quiz 3) transitive predicate : –PhraseLambda CalculusProlog notation –likes λy.[λx.x likes y] likes(X,Y). –likes Mary [λy.[λx.x likes y]](Mary) likes(X,Y), Y = mary.

Today’s Topic “The Lambda Calculus Lecture” –Getting comfortable with Lambda Calculus see it as another way of stating what we have been doing already using Prolog notation –do lots of examples

More on the Lambda Calculus Lambda Calculus vs. Prolog notation Example (Quiz 3) transitive predicate: –PhraseLambda CalculusProlog notation –likesλy.[λx.x likes y] likes(X,Y). –likes Mary [λy.[λx.x likes y]](Mary) likes(X,Y), Y = mary. – λx.x likes Mary likes(X,mary). –John likes Mary [λx.x likes Mary](John) likes(X,mary), X = john. – John likes Mary likes(john,mary).

More on the Lambda Calculus How to do variable substitution –Official Name: Beta (β)-reduction –ExampleExpression –likes [λy.[λx.x likes y]] –likes Mary [λy.[λx.x likes y]](Mary) –means (basically): –(1) delete the outer layer, i.e. remove [λy. ☐ ](Mary) part, and –(2) keep the ☐ part, and –(3) replace all occurrences of the deleted lambda variable y in ☐ with Mary [λy.[λx.x likes y]](Mary) [λx.x likes y][λy. ](Mary) [λx.x likes Mary]

More on the Lambda Calculus Note: nesting order of λy and λx matters why: λy.[λx.x likes y] λx.[λy.x likes y] here: lambda expression quantifier for the object must be outside because of phrase structure hierarchy Example: PhraseLambda Calculus likesλy.[λx.x likes y] likes Mary [λy.[λx.x likes y]](Mary) λx.x likes Mary John likes Mary [λx.x likes Mary](John) John likes Mary sentence np vp v John Mary likes marylikes(X,Y) likes(X,mary)john likes(john,mary) sentence np vp v John Mary likes Mary λy.[λx.x likes y] λx.x likes MaryJohn John likes Mary Prolog notation Lambda Calculus

More on the Lambda Calculus 3.3 Relative Clauses –(7) Hannibal is [who Shelby saw] semantics of relative clause [who Shelby saw]: –who Shelby saw is a bit like a sentence (proposition) who 1 Shelby saw e 1 wh-movement of who 1 leaving a trace e 1 Shelby saw whounderlying structure Prolog style: saw(shelby,who). saw(shelby,X). (using a logic variable for who) lambda calculus style: λx.Shelby saw x(straight translation from Prolog)

More on the Lambda Calculus We’re going to compare: –(7) Hannibal is [who Shelby saw] –(7’) Hannibal is happy Consider the semantics of (7’) sentence np vp v Hannibal happy is happy(X) hannibal happy(hannibal) Prolog notation cf. Homework 2 John is a student student(john). John is a baseball fan baseball_fan(john). sentence np vp v Hannibal happy is λx.x happyλy.y λx.x happyHannibal Hannibal happy Lambda calculus In the lambda calculus, the semantics of copula be is the identity function, e.g. λy.y Example Derivation: –PhraseLambda Calculus –isλy.y –happyλx.x happy –is happy[λy.y](λx.x happy) – λx.x happy basically the same derivation as... PhraseLambda Calculus barksλx.x barks Shelby barks [λx.x barks](Shelby) Shelby barks

sentence npvp v Hannibal is sbar sentence np vp v Shelby saw np e1e1 who 1 More on the Lambda Calculus Back to comparing: –(7) Hannibal is [who Shelby saw] –(7’) Hannibal is happy Semantics (Prolog-style): –(7) Hannibal is [saw(shelby,X)] –(7’) Hannibal is [ happy(X)] Semantics (Lambda calculus): –(7) Hannibal is [λx.Shelby saw x] –(7’) Hannibal is [ λx.x happy] Notice the similarity between (7) and (7’) wrt meaning: –both highlighted parts are single variable λx expressions –(unsaturated for subject) –we can say they are of the “same type” –This means we can use the same identity function λy.y for the copula in either case sentence np vp v Hannibal happy is λx.x happy Hannibal happy (Simplified Derivation) Points to remember: PhraseLambda calculus whoλx ex λy.y Hannibal λy.y saw xShelby [λy.y saw x](Shelby) Shelby saw x λx.Shelby saw x λx λx.Shelby saw x Shelby saw Hannibal x λx.[λy.y saw x]

More on the Lambda Calculus We could do topicalization in the same way as for relative clauses 3.4 Topicalization –(9) Shelby, Mary saw –(10) Shelby is who 1 Mary saw e 1 –(10’) Shelby is [λx.Mary saw x] –(10”) Mary saw Shelby