SemanticsProgramming Language InterpreterSlide 3Interpreting in an EnvironmentCompilingWhat Counts as Understanding? some notionsSlide 7Slide 8Slide 9Slide 10Lecture PlanLogic: Some PreliminariesLogic: Lambda TermsSlide 14Lambda calculus vs. AP calculusLogic: Multiple ArgumentsSlide 17Grounding outSlide 19Logic: Interesting ConstantsLogic: Connectives & QuantifiersSlide 22Model TheoryRandom Variables: What is “variable” in “p(variable=value)”?A reasonable representation?Slide 26Use a QuantifierTense(Simplify Notation)Event PropertiesQuantifier OrderSlide 32Slide 33Slide 34Intensional ArgumentsSlide 36Possible WorldsPossible Worlds: More usesSlide 39Slide 40ControlNouns and Their ModifiersSlide 43Slide 44AdverbsSpeech ActsSlide 47Compositional SemanticsSlide 49Slide 50Slide 51Slide 52Slide 53Slide 54PowerPoint PresentationSlide 56Slide 57Slide 58Slide 59Slide 60Slide 61Slide 62Slide 63Slide 64Slide 65Slide 66In Summary: From the WordsOther Fun Semantic Stuff: A Few Much-Studied MiscellanyPragmaticsUncertainty about the WorldSlide 71600.465 - Intro to NLP - J. Eisner 1SemanticsFrom Syntax to Meaning!600.465 - Intro to NLP - J. Eisner 2Programming Language InterpreterWhat is meaning of 3+5*6?First parse it into 3+(5*6)+3*56EEFEEE3FN5N6N*+600.465 - Intro to NLP - J. Eisner 3Programming Language InterpreterWhat is meaning of 3+5*6?First parse it into 3+(5*6)Now give a meaning toeach node in the tree(bottom-up)+3*56EEFEEE3FN5N6N*+35 6303335 63033addmult600.465 - Intro to NLP - J. Eisner 4Interpreting in an EnvironmentHow about 3+5*x?Same thing: the meaningof x is found from theenvironment (it’s 6)Analogies in language?+3*5x35 63033EEFEEE3FN5N6N*+35 63033addmult600.465 - Intro to NLP - J. Eisner 5CompilingHow about 3+5*x?Don’t know x at compile time“Meaning” at a nodeis a piece of code, not a numberEEFEEE3FN5NxN*+35 xmult(5,x)add(3,mult(5,x))addmult5*(x+1)-2 is a different expression that produces equivalent code (can be converted to the previous code by optimization)Analogies in language?600.465 - Intro to NLP - J. Eisner 6What Counts as Understanding?some notionsBe able to translate (a compiler is a translator …)Good definition? Depends on target language.English to English? bah humbug!English to French? reasonableEnglish to Chinese? requires deeper understandingEnglish to logic? deepest - the definition we’ll use!all humans are mortal = x [human(x) mortal(x)]Assume we have logic-manipulating rules that then tell us how to act, draw conclusions, answer questions …600.465 - Intro to NLP - J. Eisner 7What Counts as Understanding?some notionsWe understand if we can respond appropriatelyok for commands, questions (these demand response)“Computer, warp speed 5”“throw axe at dwarf”“put all of my blocks in the red box”imperative programming languagesdatabase queries and other questionsWe understand a statement if we can determine its truthIf you can easily determine whether it’s true, why did anyone bother telling it to you?Comparable notion for understanding NP is to identify what it refers to. Useful, but what if it’s out of sight?600.465 - Intro to NLP - J. Eisner 8What Counts as Understanding?some notionsWe understand statement if we know how to determine its truth (in principle!)Compile it into a procedure for checking truth against the world“All owls in outer space are bachelors”for every object if x is a owl if location(x) outerspace if x is not a bachelor return falsereturn trueWhat if you don’t have an flying robot? (Write the code anyway)How do you identify owls and bachelors? (Assume library calls)What if space is infinite, so the procedure doesn’t halt? Same problem for “All prime integers …” (You won’t actually run it)meaning600.465 - Intro to NLP - J. Eisner 9What Counts as Understanding?some notionsWe understand statement if we know how one could (in principle) determine its truthCompile it into a procedure that checks truth against the worldBetter: Compile it into a mathematical formulax owl(x) ^ outerspace(x) bachelor(x)Now you don’t have to worry about running itEither true or false in the world: a mathematical question!Statement claims that the world is such that this statement is true.Auden (1956): “A sentence uttered makes a world appear Where all things happen as it says they do.”But does this help? Can you check math against the real world?What are the x’s that x ranges over? Which ones make owl(x) true?Model the world by an infinite collection of facts and entitiesWittgenstein (1921): “The world is all that is the case. The world is the totality of facts, not of things.”600.465 - Intro to NLP - J. Eisner 10What Counts as Understanding?some notionsWe understand statement if we know how one could (in principle) determine its truthCompile it into a procedure that checks truth against the worldBetter: Compile it into a mathematical formulax owl(x) ^ outerspace(x) bachelor(x)Equivalently, be able to derive all logical consequences What else is true in every world where this statement is true?Necessary conditions – let us draw other conclusions from sentenceAnd what is false in every world where this sentence is falseSufficient conditions – let us conclude the sentence from other facts“Recognizing textual entailment” is an NLP task ( competitions!)John ate pizza. Can you conclude that John opened his mouth?Knowing consequences lets you answer questions (in principle):Easy: John ate pizza. What was eaten by John?Hard: White’s first move is P-Q4. Can Black checkmate?600.465 - Intro to NLP - J. Eisner 11Lecture PlanToday: First, intro to -calculus and logical notationLet’s look at some sentences and phrases What logical representations would be reasonable?Tomorrow:How can we build those representations?Another course (AI):How can we reason with those representations?600.465 - Intro to NLP - J. Eisner 12Logic: Some PreliminariesThree major kinds of objects1. Booleans Roughly, the semantic values of sentences2. Entities Values of NPs, e.g., objects like this slideMaybe also other types of entities, like times3. Functions of various types A function returning a boolean is called a “predicate” – e.g.,
View Full Document