LING 364: Introduction to Formal Semantics Lecture 21 April 4th.

Slides:



Advertisements
Similar presentations
TRUTH TABLES Section 1.3.
Advertisements

LING 364: Introduction to Formal Semantics Lecture 24 April 13th.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
LING 364: Introduction to Formal Semantics Lecture 8 February 7th.
LING 364: Introduction to Formal Semantics Lecture 23 April 11th.
Logic Chapter 2. Proposition "Proposition" can be defined as a declarative statement having a specific truth-value, true or false. Examples: 2 is a odd.
LING 364: Introduction to Formal Semantics Lecture 10 February 14th.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
2/17/2008Sultan Almuhammadi1 ICS Logic & Sets (An Overview) Week 1.
LING 364: Introduction to Formal Semantics Lecture 22 April 6th.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
LING 364: Introduction to Formal Semantics Lecture 19 March 20th.
CPSC 322, Lecture 21Slide 1 Bottom Up: Soundness and Completeness Computer Science cpsc322, Lecture 21 (Textbook Chpt 5.2) March, 5, 2010.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
EE1J2 – Discrete Maths Lecture 5
Through the Looking Glass, 1865
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
Propositional Logic 7/16/ Propositional Logic A proposition is a statement that is either true or false. We give propositions names such as p, q,
LING 364: Introduction to Formal Semantics Lecture 25 April 18th.
Chapter 3 Introduction to Logic © 2008 Pearson Addison-Wesley. All rights reserved.
Predicates and Quantifiers
Logic ChAPTER 3.
Lecture 8 Introduction to Logic CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Intro to Discrete Structures
Section 1.5 Implications. Implication Statements If Cara has a piano lesson, then it is Friday. If it is raining, then I need to remember my umbrella.
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics:
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
Chapter 1 The Logic of Compound Statements. Section 1.1 Logical Form and Logical Equivalence.
Foundations of Computing I CSE 311 Fall CSE 311: Foundations of Computing I Fall 2014 Lecture 1: Propositional Logic.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
MATH 102 Contemporary Math S. Rook
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
LING 581: Advanced Computational Linguistics Lecture Notes March 8th.
Quantifiers Not all noun phrases (NPs) are (by nature) directly referential like names Quantifiers: “something to do with indicating the quantity of something”
LOGIC Lesson 2.1. What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are.
CompSci 102 Discrete Math for Computer Science
Conditional Statements
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
How do I show that two compound propositions are logically equivalent?
Review Given p: Today is Thursday q: Tomorrow is Friday
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
Logical Form and Logical Equivalence M Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.
Logical Operations – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Logical Operations Reading: Kolman, Section 2.1.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Boolean Logic.
TRUTH TABLES. Introduction The truth value of a statement is the classification as true or false which denoted by T or F. A truth table is a listing of.
Joan Ridgway. If a proposition is not indeterminate then it is either true (T) or false (F). True and False are complementary events. For two propositions,
Outline Logic Propositional Logic Well formed formula Truth table
Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
 2012 Pearson Education, Inc. Slide Chapter 3 Introduction to Logic.
Propositional and predicate logic
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Chapter 1 Logic and proofs
Section 3.2: Truth Tables for Negation, Conjunction, and Disjunction
LING 581: Advanced Computational Linguistics Lecture Notes May 4th.
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
Logical functors and connectives. Negation: ¬ The function of the negation is to reverse the truth value of a given propositions (sentence). If A is true,
Lecture 1 – Formal Logic.
COT 3100, Spr Applications of Discrete Structures
LING 581: Advanced Computational Linguistics
LING 581: Advanced Computational Linguistics
LING 581: Advanced Computational Linguistics
Predicates and Quantifiers
Presentation transcript:

LING 364: Introduction to Formal Semantics Lecture 21 April 4th

Administrivia Homework 3 –graded and returned –homework 4 should be coming back this week as well

Administrivia this Thursday –computer lab class –fun with quantifiers... homework 5 –meet in SS 224

Today’s Topic Continue with –Reading Chapter 6: Quantifiers –Quiz 5 (end of class: postponed)

(6)every baby exactly one baby most babies cried ✓✓ jumped ✓ swam ✓ Last Time Quantified NPs: –“something to do with indicating the quantity of something” –every child, nobody –two dogs, several animals –most people think of quantifiers as “properties-of-properties” every_baby(P) is a proposition P: property every_baby(P) true for P=cried every_baby(P) false for P=jumped and P=swam Generalized quantifiers: sets of sets property = set

Last Time Defining every_baby(P)? (Montague-style) every_baby(P) is shorthand for –λP.[ ∀ X.[baby(X) -> P(X)]] – ∀ : for all (universal quantifier: logic symbol) Example: –every baby walks –[ NP every baby] [ VP walks] λP.[ ∀ X.[baby(X) -> P(X)]] (walks) ∀ X.[baby(X) ->walks(X)] Prolog-style: ?- \+ (baby(X), \+ walks(X)). “it’s not true that there is a baby (X) who doesn’t walk”

Conversion to Prolog form Show – ∀ X.[baby(X) -> walks(X)] is equivalent to (can be translated into): –?- \+ (baby(X), \+ walks(X)). We’re going to use the idea that ∀ X P(X) is the same as ¬ ∃ X ¬P(X) let’s call this the “no exception” idea ∃ = “there exists” (quantifier) (implicitly: all Prolog variables are existentially quantified variables) need to translate this a Prolog variable like X in this query has the meaning: “give me some value of X such that baby(X) is true” i.e. “give me some X” i.e. ∃ X baby(X)

Aside: Truth Tables logic of implication P -> Q = (truth value) T T T F T T F F T T F F i.e. if P is true, Q must be true in order for P->Q to be true if P is false, doesn’t matter what Q is, P->Q is true conventionally written as: P->Q TTT FTT FTF TFF PvQ TTT FTT FFF TTF ¬PvQ TFTT FTTT FF TFTT PvQ=F only when both P and Q are F ¬ PvQ=F only when P=T and Q=F P->Q=F only when P=T and Q=F Hence, P->Q is equivalent to ¬PvQ

Aside: Truth Tables De Morgan’s Rule ¬(P ∨ Q) = ¬P ∧ ¬Q PvQ TTT FTT FFF TTF ¬(PvQ) F F T F ¬P ∧ ¬Q FTF TFFFT TFT FTF ¬(PvQ)=T only when both P and Q are F ¬P ∧ ¬Q=T only when both P and Q are F Hence, ¬(PvQ) is equivalent to ¬P ∧ ¬Q

Conversion into Prolog Note: \+ (baby(X), \+walks(X)) is Prolog for ∀ X (baby(X) -> walks(X)) Steps: – ∀ X (baby(X) -> walks(X)) – ∀ X (¬baby(X) v walks(X)) (since P->Q = ¬PvQ, see truth tables from two slides ago) –¬ ∃ X ¬ (¬baby(X) v walks(X)) (since ∀ X P(X) = ¬ ∃ X ¬P(X), no exception idea from 3 slides ago) –¬ ∃ X (baby(X) ∧ ¬walks(X)) (by De Morgan’s rule, see truth table from last slide) –¬(baby(X) ∧ ¬walks(X)) (can drop ∃ X since all Prolog variables are basically existentially quantified variables) –\+ (baby(X) ∧ \+walks(X)) (\+ = Prolog negation symbol) –\+ (baby(X), \+walks(X)) (, = Prolog conjunction symbol)

Last Time Defining every_baby(P)? (Montague-style) λP.[ ∀ X.baby(X) -> P(X)] (Barwise & Cooper-style) think directly in terms of sets leads to another way of expressing the Prolog query Example: every baby walks {X: baby(X)}set of all X such that baby(X) is true {X: walks(X)}set of all X such that walks(X) is true Subset relation ( ⊆ ) {X: baby(X)} ⊆ {X: walks(X)} the “baby” set must be a subset of the “walks” set Imagine a possible world: –baby(a). –baby(b). –baby(c). –walks(a). –walks(b). –walks(c). –walks(d). –{a,b,c} ⊆ {a,b,c,d} –baby ⊆ walks

Subset and Prolog How to express this as a Prolog query? Findall/3 queries: ?- findall(X,baby(X),L1).L1 is the set of all babies in the database ?- findall(X,walks(X),L2).L2 is the set of all individuals who walk Also need a Prolog definition of the subset relation. For example: subset([],_).“empty set is a subset of anything” subset([X|L1],L2) :- member(X,L2), subset(L1,L2). member(X,[X|_]). member(X,[_|L]) :- member(X,L). Prolog Head-Tail List Notation: [a,b,c] a is the head of the list (the first element) [b,c] is the tail of the list (all but the first element) we can write a list as follows: [head | tail] [a | [b,c] ] programmatically: [ X | L1] will match [a,b,c] when X = a, L1 = [b,c]

Generalized Quantifiers Example: every baby walks {X: baby(X)} ⊆ {X: walks(X)} the “baby” set must be a subset of the “walks” set Assume the following definitions are part of the database: subset([],_). subset([X|L1],L2) :- member(X,L2), subset(L1,L2). member(X,[X|_ ]). member(X,[ _|L]) :- member(X,L). Prolog Query: ?- findall(X,baby(X),L1), findall(X,walks(X),L2), subset(L1,L2). True for world: –baby(a).baby(b). –walks(a).walks(b). walks(c). L1 = [a,b] L2 = [a,b,c] ?- subset(L1,L2) is true False for world: –baby(a).baby(b). baby(d). –walks(a).walks(b). walks(c). L1 = [a,b,d] L2 = [a,b,c] ?- subset(L1,L2) is false

Generalized Quantifiers Example: every baby walks (Montague-style) ∀ X (baby(X) -> walks(X)) (Barwise & Cooper-style) {X: baby(X)} ⊆ {X: walks(X)} how do we define every_baby(P)? (Montague-style) λP.[ ∀ X (baby(X) -> P(X))] (Barwise & Cooper-style) {X: baby(X)} ⊆ {X: P(X)} how do we define every? (Montague-style) λP 1.[λP 2.[ ∀ X (P 1 (X) -> P 2 (X))]] (Barwise & Cooper-style) {X: P 1 (X)} ⊆ {X: P 2 (X)}

Quantifiers how do we define the expression every? (Montague-style) λP 1.[λP 2.[ ∀ X (P 1 (X) -> P 2 (X))]] Let’s look at computation in the lambda calculus... Example: every man likes John –WordExpression –everyλP 1.[λP 2.[ ∀ X (P 1 (X) -> P 2 (X))]] –manman –likesλY.[λX.[ X likes Y]] –John John Syntax: [ S [ NP [ Q every][ N man]][ VP [ V likes][ NP John]]]

Quantifiers Example: [ S [ NP [ Q every][ N man]][ VP [ V likes][ NP John]]] –WordExpression –everyλP 1.[λP 2.[ ∀ X (P 1 (X) -> P 2 (X))]] –manman –likesλY.[λX.[ X likes Y]] –John John Steps: [ Q every][ N man]]λP 1.[λP 2.[ ∀ X (P 1 (X) -> P 2 (X))]](man) [ Q every][ N man]]λP 2.[ ∀ X (man(X) -> P 2 (X))] [ VP [ V likes][ NP John]]λY.[λX.[ X likes Y]](John) [ VP [ V likes][ NP John]]λX.[ X likes John] [ S [ NP [ Q every][ N man]][ VP [ V likes][ NP John]]] λP 2.[ ∀ X (man(X) -> P 2 (X))](λX.[ X likes John]) ∀ X (man(X) -> λX.[ X likes John](X))

Quantifiers Example: [ S [ NP [ Q every][ N man]][ VP [ V likes][ NP John]]] –WordExpression –every\+ (P1, \+ P2). –manman(X). –likeslikes(X,Y). –John john Steps (Prolog-style): [ Q every][ N man] ?- Q = (\+ (P1,\+P2)), N= man(X), arg(1,E,C), saturate1(C,N). [ NP [ Q every][ N man]]]NP = \+ (man(X), \+ P2). (pass up saturated Q as the value for the NP) [ V likes][ NP John] ?- V = likes(X,Y), NP=john, saturate2(V,NP). [ VP [ V likes][ NP John]]VP = likes(X,john). (pass up saturated V as the value for the VP) [ NP [ Q every][ N man]][ VP [ V likes][ NP John]] ?- NP = (\+ (man(X), \+ P2)), VP = likes(X,john), arg(1,NP,C), arg(2,C,Neg),arg(1,Neg,VP). [ S [ NP [ Q every][ N man]][ VP [ V likes][ NP John]]] S = \+ (man(X),\+likes(X,john)) (pass up saturated NP as the value for S) extra parentheses needed here I’ve cheated a bit here... this X is the same X as the X in man(X)... in a program I would have to also saturate both to the same variable

Quantifiers Example: [ S [ NP [ Q every][ N man]][ VP [ V likes][ NP John]]] –WordExpression –everyfindall(U,P1,L1),findall(V,P2,L2),subset(L1,L2). –manman(M). –likeslikes(A,B). –John john Steps: [ Q every][ N man]]Q= (findall(U,P1,L1),findall(V,P2,L2),subset(L1,L2)), N = man(M), arg(1,Q,FA1),arg(2,FA1,N), saturate1(FA1,X), saturate1(N,X). [ NP [ Q every][ N man]]]NP = findall(X,man(X),L1),findall(V,P2,L2),subset(L1,L2) (pass up saturated Q as the value for the NP) [ V likes][ NP John]V=likes(A,B), NP=john, saturate2(V,NP). [ VP [ V likes][ NP John]]VP = likes(A,john) (pass up saturated V as the value for the VP) [ NP [ Q every][ N man]][ VP [ V likes][ NP John]] NP = (findall(X,man(X),L1),findall(V,P2,L2),subset(L1,L2)), VP = likes(A,john), arg(2,NP,C2), arg(1,C2,FA2), arg(2,FA2,VP), saturate1(FA2,Y), saturate1(VP,Z). Set theory version

Quantifiers Example: [ S [ NP [ Q every][ N man]][ VP [ V likes][ NP John]]] –WordExpression –everyfindall(U,P1,L1),findall(V,P2,L2),subset(L1,L2). –manman(M). –likeslikes(A,B). –John john Steps: [ NP [ Q every][ N man]][ VP [ V likes][ NP John]] ?- NP = (findall(X,man(X),L1),findall(V,P2,L2),subset(L1,L2)), VP = likes(A,john), arg(2,NP,C2), arg(1,C2,FA2), arg(2,FA2,VP), saturate1(FA2,Y), saturate1(VP,Z). [ S [ NP [ Q every][ N man]][ VP [ V likes][ NP John]]] S = findall(X,man(X),L1),findall(Y,likes(Y,john),L2),subset(L1,L2) (pass up saturated NP as the value for S)

Names as Generalized Quantifiers In earlier lectures, we mentioned that names directly refer Here is another idea Conjunction –X and Y –both X and Y have to be of the same type –in particular, semantically... –we want them to have the same semantic type what is the semantic type of every baby? Example every baby and John likes ice cream [ NP [ NP every baby] and [ NP John]] likes ice cream every baby likes ice cream {X: baby(X)} ⊆ {Y: likes(Y,ice_cream)} John likes ice cream ??? ⊆ {Y: likes(Y,ice_cream)} John ∈ {Y: likes(Y,ice_cream)} want everything to be a set (to be consistent) i.e. want to state something like ({X: baby(X)} ∪ {X: john(X)}) ⊆ {Y: likes(Y,ice_cream)} note: set union ( ∪ ) is the translation of “and”

Negative Polarity Items Negative Polarity Items (NPIs) Examples: –every, any Constrained distribution: –have to be licensed in some way –grammatical in a “negated environment” or “question” Examples: –(13a) Shelby won’t ever bite you –(13b) Nobody has any money –(14a) *Shelby will ever bite you –(14b) *Noah has any money –*= ungrammatical –(15a) Does Shelby ever bite? –(15b) Does Noah have any money?

Negative Polarity Items Inside an if-clause: –(16a) If Shelby ever bites you, I’ll put him up for adoption –(16b) If Noah has any money, he can buy some candy Inside an every-NP: –(17a) Every dog which has ever bitten a cat feels the admiration of other dogs –(17b) Every child who has any money is likely to waste it on candy Not inside a some-NP: –(17a) Some dog which has ever bitten a cat feels the admiration of other dogs –(17b) Some child who has any money is likely to waste it on candy Not to be confused with free choice (FC) any (meaning: ∀ ): any man can do that