LING 364: Introduction to Formal Semantics Lecture 22 April 6th.

Slides:



Advertisements
Similar presentations
TRUTH TABLES Section 1.3.
Advertisements

TRUTH TABLES The general truth tables for each of the connectives tell you the value of any possible statement for each of the connectives. Negation.
LING 364: Introduction to Formal Semantics Lecture 24 April 13th.
LING 364: Introduction to Formal Semantics Lecture 8 February 7th.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/12.
LING 364: Introduction to Formal Semantics Lecture 17 March 9th.
LING 364: Introduction to Formal Semantics Lecture 28 May 2nd.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
2/17/2008Sultan Almuhammadi1 ICS Logic & Sets (An Overview) Week 1.
LING 364: Introduction to Formal Semantics Lecture 11 February 16th.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
1 Intro to Probability Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
LING 364: Introduction to Formal Semantics Lecture 19 March 20th.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/5.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
LING 364: Introduction to Formal Semantics Lecture 3 January 19th.
LING 364: Introduction to Formal Semantics Lecture 13 February 23rd.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
LING 388: Language and Computers Sandiway Fong Lecture 13: 10/10.
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
Truth Tables for Negation, Conjunction, and Disjunction.
3.2 – Truth Tables and Equivalent Statements
Logic ChAPTER 3.
Lecture 8 Introduction to Logic CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Intro to Discrete Structures
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.
LING 388: Language and Computers Sandiway Fong Lecture 7.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
(CSC 102) Lecture 3 Discrete Structures. Previous Lecture Summary Logical Equivalences. De Morgan’s laws. Tautologies and Contradictions. Laws of Logic.
Section 1.5. Section Summary Nested Quantifiers Order of Quantifiers Translating from Nested Quantifiers into English Translating Mathematical Statements.
Fall 2002CMSC Discrete Structures1 Let’s get started with... Logic !
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
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.
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.
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 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.
Simplifying Boolean Expressions. Boolean Operators (T/F) xyx AND y FFF FTF TFF TTT xyx OR y FFF FTT TFT TTT xyx XOR y FFF FTT TFT TTF xNOT x FT TF.
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.
Conditional Statements Lecture 2 Section 1.2 Fri, Jan 20, 2006.
LING 364: Introduction to Formal Semantics Lecture 21 April 4th.
1 Chapter 2.1 Chapter 2.2 Chapter 2.3 Chapter 2.4 All images are copyrighted to their respective copyright holders and reproduced here for academic purposes.
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
Spring 2003CMSC Discrete Structures1 Let’s get started with... Logic !
 2012 Pearson Education, Inc. Slide Chapter 3 Introduction to Logic.
Propositional and predicate logic
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
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,
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 22 April 6th

Administrivia Homework 5 –on quantification –out today –due next Thursday

Exercise 1 Truth Tables and Prolog

Exercise 1 Truth tables in Prolog Example: –% implies(P,Q,Result) –implies(true,false,false). –implies(false,true,true). –implies(false,false,true). –implies(true,true,true). –% or(P,Q,Result) –or(true,true,true). –or(true,false,true). –or(false,true,true). –or(false,false,false). P ⇒ Q TTT FTT FTF TFF PvQ TTT FTT FFF TTF Show using a Prolog query that implies/3 and or/3 are not equivalent ?- implies(P,Q,R1), or(P,Q,R2), \+ R1 = R2. remember: Prolog variables are implicitly existentially quantified What should the outcome of this query be?

Exercise 1 Homework Question A (3pts) –Using the Prolog query shown on the previous slide, –for what values of P and Q are implies/3 and or/3 incompatible? –Submit your run

Exercise 1 Define truth table negation as follows: –% neg(P,\+ P). –neg(true,false). –neg(false,true). Show using a Prolog query that P ⇒ Q is equivalent to ¬PvQ ?- implies(P,Q,R1), neg(P,NotP), or(NotP,Q,R2), \+ R1 = R2. What should the outcome of this query be? P¬P TF FT

Exercise 1 Homework Question B (2pts) –Define truth table and/3 in Prolog Homework Question C (4pts) –Using an appropriate Prolog query, and and/3, –Show that ¬(P ∨ Q) = ¬P ∧ ¬Q (De Morgan’s Rule) –Submit your run P ∧ Q TTT FFT FFF TFF

Exercise 1 Homework Question D (4pts) –Using an appropriate Prolog query, –Show that ¬(P ∧ Q) = ¬P ∨ ¬Q –(another side of De Morgan’s Rule) –Submit your run

Exercise 1 Summary –Submit answers to questions A through D –Points: –A: 3pts –B: 2pts –C: 4pts –D: 4pts –Total: 13 pts

Exercise 2 Universal Quantification and Sets

Exercise 2 Assume meaning grammar: s(M) --> qnp(M), vp(P), {predicate2(M,P)}. qnp(M) --> q(M), n(P), {predicate1(M,P)}. q((findall(_X,_P1,L1),findall(_Y,_P2,L2),subset(L1,L2 ))) --> [every]. n(woman(_)) --> [woman]. vp(M) --> v(M), np(X), {saturate2(M,X)}. v(likes(_X,_Y)) --> [likes]. np(ice_cream) --> [ice,cream]. saturate1(P,X) :- arg(1,P,X). saturate2(P,X) :- arg(2,P,X). subset([],_). subset([X|L1],L2) :- member(X,L2), subset(L1,L2). member(X,[X|_]). member(X,[_|L]) :- member(X,L). predicate1((findall(X,P,_),_),P) :- saturate1(P,X). predicate2((_,(findall(X,P,_),_)),P) :- saturate1(P,X). every has semantics: {X: P 1 (X)} ⊆ {Y: P 2 (Y)} e.g. every woman likes ice cream {X: woman(X)} ⊆ {Y:likes(Y,ice_cream)}

Exercise 2 Using the meaning grammar, we can compute a meaning expression for: –every woman likes ice cream using the Prolog query: –?- s(M,[every,woman,likes,ice,cream],[]). –M = findall(A,woman(A),B),findall(C,likes(C,ice_cream),D),subset(B,D)

Exercise 2 We can evaluate this meaning expression for various possible worlds using call/1 For example, given the database: –woman(mary).woman(jill). –likes(john,ice_cream).likes(mary,ice_cream). –likes(jill,ice_cream). we can evaluate: –?- s(M,[every,woman,likes,ice,cream],[]), call(M). the call is: –findall(A,woman(A),B),findall(C,likes(C,ice_cream),D),subset(B,D). with –B and D being [mary,jill] and [john,mary,jill] respectively

Exercise 2 Homework Question A (4pts) –Modify the meaning grammar to handle the sentence John likes ice cream Homework Question B (2pts) –Evaluate John likes ice cream against the database from the previous slide –Submit your run

Exercise 2 Homework Question C (10pts) –Treating names as Generalized Quantifiers (see below), –Further modify the meaning grammar to handle the sentences Every woman and John likes ice cream John and every woman likes ice cream –Evaluate the sentences and submit your runs Recall Lecture 21 Example every baby and John likes ice cream [ NP [ NP every baby] and [ NP John]] likes ice cream ({X: baby(X)} ∪ {X: john(X)}) ⊆ {Y: likes(Y,ice_cream)} note: set union ( ∪ ) is the translation of “and” Define set union as follows: % L1 ∪ L2 = L3“L3 is the union of L1 and L2” union(L1,L2,L3) :- append(L1,L2,L3).

Exercise 2 Summary –Answer questions A, B and C –A: 4pts –B: 2pts –C: 10pts –Total: 16pts

Exercise 3 Other quantifiers as generalized quantifiers

Exercise 3 Other quantifiers can also be expressed using set relations between two predicates: Example: no: {X: P 1 (X)} ∩ {Y: P 2 (Y)} = ∅ ∩ = set intersection ∅ = empty set no man smokes {X: man(X)} ∩ {Y: smokes(Y)} = ∅ should evaluate to true for all possible worlds where there is no overlap between men and smokers men smokers

Exercise 3 Other quantifiers can also be expressed using set relations between two predicates: Example: some: {X: P 1 (X)} ∩ {Y: P 2 (Y)} ≠ ∅ ∩ = set intersection ∅ = empty set some men smoke {X: man(X)} ∩ {Y: smokes(Y)} ≠ ∅ men smokers

Exercise 3 Homework Question A (8pts) –Modify the meaning grammar given in exercise 2 to handle the sentence: –No woman likes ice cream –Evaluate it against the database Homework Question B (8pts) –Modify the meaning grammar given in exercise 2 to handle the sentence: –Some women like ice cream –Evaluate it against the database

Exercise 3 Summary –Submit parts A and B –and the runs –A: 8pts –B: 8pts –Total: 16pts

Summary PLEASE SUBMIT EVERYTHING IN ONE FILE! Exercises 1: 13pts 2: 16pts 3: 16pts Grand total: 35pts