LING 364: Introduction to Formal Semantics Lecture 19 March 20th.

Slides:



Advertisements
Similar presentations
Geometry Logic.
Advertisements

TRUTH TABLES Section 1.3.
LING 364: Introduction to Formal Semantics Lecture 24 April 13th.
RMIT University; Taylor's College This is a story about four people named Everybody, Somebody, Anybody and Nobody. There was an important job to be done.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 3 Syntax of Propositional Logic Parse trees revised Construction of parse trees Semantics of propositional.
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 9 February 9th.
1 Problem Solving CS 331 Dr M M Awais Representational Methods Formal Methods Propositional Logic Predicate Logic.
2/17/2008Sultan Almuhammadi1 ICS Logic & Sets (An Overview) Week 1.
LING 364: Introduction to Formal Semantics Lecture 19 March 28th.
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.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
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.
Survey of Mathematical Ideas Math 100 Chapter 3, Logic
Predicates and Quantifiers
Logic ChAPTER 3.
Lecture 8 Introduction to Logic CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
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.
Section 1-4 Logic Katelyn Donovan MAT 202 Dr. Marinas January 19, 2006.
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics:
Lecture for Week Spring.   Introduction to Propositional Logic  Types of Proposition  Operator and Truth table Agenda.
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.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
Chapter 5 – Logic CSNB 143 Discrete Mathematical Structures.
Math 240: Transition to Advanced Math Deductive reasoning: logic is used to draw conclusions based on statements accepted as true. Thus conclusions are.
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.
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.
Chapter 7 Logic, Sets, and Counting
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.
MLS 570 Critical Thinking Reading Notes for Fogelin: Propositional Logic Fall Term 2006 North Central College.
CS1022 Computer Programming & Principles Lecture 1 Logic and Proof.
How do I show that two compound propositions are logically equivalent?
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
Logic. Statements, Connectives, and Quantifiers In symbolic logic, we only care whether statements are true or false – not their content. In logic, a.
6.1 Logic Logic is not only the foundation of mathematics, but also is important in numerous fields including law, medicine, and science. Although the.
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
1 Propositional Logic Introduction. 2 What is propositional logic? Propositional Logic is concerned with propositions and their interrelationships. 
Logical Operations – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Logical Operations Reading: Kolman, Section 2.1.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
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
LING 364: Introduction to Formal Semantics Lecture 21 April 4th.
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.
Spring 2003CMSC Discrete Structures1 Let’s get started with... Logic !
 2012 Pearson Education, Inc. Slide Chapter 3 Introduction to Logic.
Reasoning and Proof Chapter Use Inductive Reasoning Conjecture- an unproven statement based on an observation Inductive reasoning- finding a pattern.
Propositional and predicate logic
Chapter 1 Logic and proofs
Section 3.2: Truth Tables for Negation, Conjunction, and Disjunction
LING 581: Advanced Computational Linguistics Lecture Notes May 4th.
Lecture 1 – Formal Logic.
LING 581: Advanced Computational Linguistics
LING 581: Advanced Computational Linguistics
LING 581: Advanced Computational Linguistics
Copyright © Cengage Learning. All rights reserved.
Presentation transcript:

LING 364: Introduction to Formal Semantics Lecture 19 March 20th

Administrivia Handout: Chapter 6 –Quantifiers –hard topic –we’ll start on it today Read it for next Tuesday –Short Quiz 5

Administrivia We’ll review Homework 4 next time –a bit behind on grading...

Leftover from Last Lecture Example: –(29) Only John loves his mother –(29’) Only John doesn’t love his mother World 1 for (29) (=31): –loves(john,mother(john)). –also, no other facts in the database that would satisfy the query –?- loves(X,mother(john)), \+ X=john. World 2 for (29) (=32): –loves(john,mother(john)). –also no other facts in the database that would satisfy the query – ? - loves(X,mother(X)),\+ X=john. Both Worlds are possible since (29) is ambiguous Which one is preferred?

Leftover from Last Lecture Example: –(29) Only John loves his mother –(29’) Only John doesn’t love his mother World 3 for (29’): –loves_not(john,mother(john)). –also, no other facts in the database that would satisfy the query –?- loves_not(X,mother(john)), \+ X=john. World 4 for (29’): –loves_not(john,mother(john)). –also no other facts in the database that would satisfy the query – ? - loves_not(X,mother(X)),\+ X=john. Both Worlds are possible since (presumably) (29’) is also ambiguous like (29) Which one is preferred?

Today’s Topic Chapter 6: Quantifiers

Quantifiers Not all noun phrases (NPs) are (by nature) directly referential like names Quantifiers: –“something to do with indicating the quantity of something” Examples: –every child –nobody –two dogs –several animals –most people –nobody has seen a unicorn – could simply means something like (Prolog-style): –?- findall(X,(person(X), seen(X,Y), unicorn(Y)),Set),length(Set,0).

Quantifiers Recall: compositionality idea: –elements of a sentence combine in piecewise fashion to form an overall (propositional) meaning for the sentence Example: –(4) Every baby cried –WordMeaning –criedcried(X). –babybaby(X). –every? –every baby criedproposition (True/False) – that can be evaluated in a given world

(6)every baby exactly one baby most babies cried ✓✓ jumped ✓ swam ✓ Quantifiers Scenario (Possible World): –suppose there are three babies... baby(noah). baby(merrill). baby(dani). –all three cried cried(noah). cried(merrill). cried(dani). –only Dani jumped jumped(dani). –Noah and Dani swam swam(noah). swam(dani). 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

Quantifiers think of quantifiers as “properties-of-properties” –every_baby(P) true for P=cried –every_baby(P) false for P=jumped and P=swam Generalized Quantifiers (scary jargon alert!) –the idea that quantified NPs represent sets of sets –this idea is not as wierd as it sounds –we know every_baby(P) is true for certain properties –view every_baby(P) = set of all properties P for which this is true –in our scenario every_baby(P) = {cried} –we know cried can also be view as a set itself cried = set of individuals who cried –in our scenario cried = {noah, merrill, dani}

Quantifiers how do we define the expression every_baby(P)? (Montague-style) every_baby(P) is shorthand for –for all individuals X, baby(X) -> P(X) –-> : if-then (implication : logic symbol) written another way (lambda calculus-style): –λP.[ ∀ X.[baby(X) -> P(X)]] – ∀ : for all (universal quantifier: logic symbol) Example: –every baby walks for all individuals X, baby(X) -> walks(X) –more formally –[ NP every baby] [ VP walks] λP.[ ∀ X.[baby(X) -> P(X)]](walks) ∀ X.[baby(X) ->walks(X)]

Quantifiers how do we define this Prolog-style? Example: –every baby walks –[ NP every baby] [ VP walks] λP.[ ∀ X (baby(X) -> P(X))](walks) ∀ X (baby(X) ->walks(X)) Possible World (Prolog database): –:- dynamic baby/1.(allows us to modify the baby database online) –baby(a).baby(b). –walks(a).walks(b). walks(c). –individual(a).individual(b). individual(c). What kind of query would you write? One Possible Query (every means there are no exceptions): –?- \+ (baby(X), \+ walks(X)).(NOTE: need a space between \+ and ( here) –Yes(TRUE) –?- baby(X), \+ walks(X). –No –?- assert(baby(d)). –?- baby(X), \+ walks(X). –X = d ; –Yes using idea that ∀ X P(X) is the same as ¬ ∃ X ¬P(X) ∃ = “there exists” (quantifier) (implicitly: all Prolog variables are existentially quantified variables)

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 TTT ¬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 TTT ¬(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)

Quantifiers how do we define this Prolog-style? Example: –every baby walks –[ NP every baby] [ VP walks] λP.[ ∀ X.[baby(X) -> P(X)]](walks) ∀ X.[baby(X) ->walks(X)] Another Possible World (Prolog database): –:- dynamic baby/1. –:- dynamic walks/1. –% no facts(% = comment) Does ?- \+ (baby(X), \+ walks(X)). still work? Yes because –?- baby(X), \+ walks(X). –No cannot be satisfied

Quantifiers how do we define the expression every_baby(P)? (Montague-style) every_baby(P) is shorthand for –λ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

Quantifiers (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)} ⊆ {X: walks(X)} the “baby” set must be a subset of the “walks” set How to express this as a Prolog query? 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 Need a Prolog definition of the subset relation. This one, for example: subset([],_). subset([X|L1],L2) :- member(X,L2), subset(L1,L2). member(X,[X|_]). member(X,[_|L]) :- member(X,L).

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|_ ],L) :- member(X,L). 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