LING 364: Introduction to Formal Semantics Lecture 28 May 2nd.

Slides:



Advertisements
Similar presentations
1 Knowledge Representation Introduction KR and Logic.
Advertisements

LING 364: Introduction to Formal Semantics Lecture 24 April 13th.
LING 388: Language and Computers Sandiway Fong Lecture 5: 9/8.
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
Logic.
F22H1 Logic and Proof Week 7 Clausal Form and Resolution.
Knowledge Representation Methods
LING 364: Introduction to Formal Semantics Lecture 8 February 7th.
LING 581: Advanced Computational Linguistics Lecture Notes April 23rd.
LING 364: Introduction to Formal Semantics Lecture 26 April 20th.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 3 Syntax of Propositional Logic Parse trees revised Construction of parse trees Semantics of propositional.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/12.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
LING 388: Language and Computers Sandiway Fong Lecture 28: 12/6.
LING 364: Introduction to Formal Semantics Lecture 27 April 27th.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
LING 364: Introduction to Formal Semantics Lecture 22 April 6th.
LING 364: Introduction to Formal Semantics Lecture 1 January 12th.
LING 364: Introduction to Formal Semantics Lecture 19 March 20th.
LING 388 Language and Computers Take-Home Final Examination 12/9/03 Sandiway FONG.
LING 364: Introduction to Formal Semantics Lecture 3 January 19th.
LING 364: Introduction to Formal Semantics Lecture 13 February 23rd.
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
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.
LING 364: Introduction to Formal Semantics Lecture 25 April 18th.
Tweedledum: “I know what you’re thinking, but it isn’t so. No how.” Tweedledee: “Contrariwise, if it was so, it might be; and if it were so, it would be;
LING 388: Language and Computers Sandiway Fong 10/4 Lecture 12.
Copyright © Cengage Learning. All rights reserved.
Lecture 8 Introduction to Logic CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
1 Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2011 Suprakash Datta Office: CSEB 3043 Phone: ext
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:
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.
LING 388: Language and Computers Sandiway Fong Lecture 7.
LING 388: Language and Computers Sandiway Fong Lecture 3.
LDK R Logics for Data and Knowledge Representation Modeling First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia.
1 Introduction to Abstract Mathematics The Logic and Language of Proofs Instructor: Hayk Melikya Proposition: Informal introduction to.
(CSC 102) Lecture 3 Discrete Structures. Previous Lecture Summary Logical Equivalences. De Morgan’s laws. Tautologies and Contradictions. Laws of Logic.
Math 240: Transition to Advanced Math Deductive reasoning: logic is used to draw conclusions based on statements accepted as true. Thus conclusions are.
CSE 311 Foundations of Computing I Lecture 8 Proofs and Set Theory Spring
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
Of 33 lecture 12: propositional logic – part I. of 33 propositions and connectives … two-valued logic – every sentence is either true or false some sentences.
LING 581: Advanced Computational Linguistics Lecture Notes March 8th.
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
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Semantics Day 38 LING Computational Linguistics Harry Howard Tulane University.
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
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.
1/10/ Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007 Suprakash Datta Office: CSEB 3043 Phone:
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
LING 364: Introduction to Formal Semantics Lecture 21 April 4th.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Propositional and predicate logic
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
PROJECT Inequalities in Geometry Chapter 6 - beginning on page 202 Student Notes.
Week 3. Clauses and Trees English Syntax. Trees and constituency A sentence has a hierarchical structure Constituents can have constituents of their own.
Artificial Intelligence Logical Agents Chapter 7.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
Logic.
LING 581: Advanced Computational Linguistics
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
ece 720 intelligent web: ontology and beyond
Logical and Rule-Based Reasoning Part I
Presentation transcript:

LING 364: Introduction to Formal Semantics Lecture 28 May 2nd

Administrivia Homework 6 –was due at the beginning of class

Administrivia Today’s Agenda: –A Note on Grading and Course Objectives –Homework 6 Review –Homework Final –Class Evaluations

Back at the Beginning [Lecture 1: Slide 13] Mix of homeworks and short quizzes –expect approx. 6 homework assignments longer and more in-depth in nature worth many more points –a short quiz (just about) every week gauge your understanding Grading –In total, homeworks will generally be worth much more than the short quizzes about a 75-70% / 25-30% ratio –There may or may not be a final exam depends on how the class is doing (if so) view it as an opportunity to improve your score if given, it will be a take- home exam worth about 25% of the grade due by midnight the next day

Grading Points-wise

Course objectives were... Two goals: –(1) on the theoretical side –Understand what is meant by natural language semantics what does it mean to work out the “meaning” of a sentence, phrase or utterance what quasi-technical terms like entailment, possible worlds, truth conditions, quantification, scope ambiguity, synonymy, presupposition, logical deduction, reference, inference rule etc. mean the relation between natural language and formal logic the relation between syntax and semantics with respect to formal grammars awareness of issues and data etc...

Course objectives were... Two goals: –(2) on the practical side –gain experience with formal systems and build something tangible first-hand experience on how to write logic expressions practice how to formalize notions how to run logical deduction on computers use and write grammars for semantics we’ll use SWI-Prolog by the end of this course you will be able to write formal grammars integrating the computation of meaning as well as syntax for fragments of English

Nature of the Course Formalization of natural language –involves... –being mathematical –being used to thinking precisely with respect to manipulating formalisms –being comfortable with logic (lambda-calculus) –learning to write logic that runs on a computer (otherwise course would be mostly theoretical Each of these can be challenging first time around

Homework 6 Review

A simple grammar for tense and time sbar(R) --> adjunct(R1), s(R2), {append(R1,R2,R)}. sbar(R) --> s(R). s(R) --> np, vp(R). np --> [i]. np --> [noah]. vp(R) --> v(R1,go), [for,a,hike], {append([(subset(e,t))],R1,R)}. vp(R) --> v(R1,have), [a,rash], {append([intersect(e,t)],R1,R)}. v([(t [went]. v([(t=s)],go) --> [go]. v([(s [will,go]. v([(t [had]. v([(t=s)],have) --> [have]. v([(s [will,have]. adjunct([(t [last,month]. adjunct([(t [yesterday]. adjunct([(s=t),t=today(s)]) --> [today]. adjunct([(s [tomorro infer(R,[(Z<Y)]) :- select((X<Y),R,R1), select(subset(Z,X),R1,_). % select(X,L,L’) % selects X a member of list L, % L’ is the list L with X removed select(X,[X|L],L). select(X,[Y|L],[Y|Lp]) :- select(X,L,Lp).

Homework 6 Review Exercise 1: –Tomorrow, I will go for a hike Run: –?- sbar(X,[tomorrow,i,will,go,for,a,hike],[]). –X = [s<t,t=tomorrow(s),subset(e,t),s<t] ? ; –no –?- sbar(X,[tomorrow,i,will,go,for,a,hike],[]), infer(X,Y). –X = [s<t,t=tomorrow(s),subset(e,t),s<t], –Y = [s<e] ? ; –X = [s<t,t=tomorrow(s),subset(e,t),s<t], –Y = [s<e] ? ; –no If X < Y and Z ⊆ Y we can infer: X < Z infer(R,[(X<Z)]) :- select((X<Y),R,R1), select(subset(Z,Y),R1,_). s<t e⊆te⊆t s<e

Homework 6 Review Exercise 2: –Diagram “Yesterday, Noah had a rash” sbar adjuncts npvp va rashnoah had yesterday v([(t [had]. vp(R) --> v(R1,have), [a,reash], {append([intersect(e,t)],R1,R)}}. [t<s] [intersect(e,t),t<s] s(R) --> np, vp(R). adjunct([(t [yesterday]. [(t<s),t=yesterday(s)] sbar(R) --> adjunct(R1), s(R2), {append(R1,R2,R)}. [t<s,t=yesterday(s),intersect(e,t),t<s] S yesterday 0:0023:5915:50 T E  

Homework 6 Review Exercise 3: Inconsistency Explain formally what is wrong with the following sentences: –(i) # Yesterday, I will go for a hike –(ii) # Tomorrow, Noah had a rash ?- sbar(X,[yesterday,i,will,go,for,a,hike],[]). X = [t<s,t=yesterday(s),subset(e,t),s<t] ? ; no ?- sbar(X,[tomorrow,noah,had,a,rash],[]). X = [s<t,t=tomorrow(s),intersect(e,t),t<s] ? ; no ?- sbar(X,[yesterday,i,will,go,for,a,hike],[]), inconsistent(X). X = [t<s,t=yesterday(s),subset(e,t),s<t] ? ; no ?- sbar(X,[tomorrow,noah,had,a,rash],[]), inconsistent(X). X = [s<t,t=tomorrow(s),intersect(e,t),t<s] ? ; no inconsistent(R) :- select((X<Y),R,R1), select((Y<X),R1,_).

Homework Final

Instructions –7 Questions –Due tomorrow by midnight in my mailbox deductions if you’re late zero points if you are a day late –Answer as many questions as you can in the time available –Attempt every question –It’s a second chance to show you understand the course material, homework reviews, etc. Good luck!

Homework Final Instructions –Do not panic. –Consult referenced homework slides –Consult homework reviews All questions on this homework final can be answered with the knowledge in those lecture slides –You may discuss the homework final you must cite classmates or other sources

Question 1 [Homework 1: Lecture 3] Introduction to Prolog and Truth Conditions –Let database fact p represent the proposition “All dogs bark” [4pts] Construct the Prolog statement for “it is not the case that both all dogs bark and not all dogs bark” [4pts] Show that the translated (into Prolog) statement is a tautology. –(Submit your Prolog run.)

Question 2 [Homework 2: Lecture 8] Phrase Structure and Meaning Grammars –[8pts] Give a phrase structure grammar for the following sentences. –Why is John sad? –[ CP [ Adv why][ Cbar [ C is][[ IP [ NP John][ VP [ V trace][ AP [ NP trace][ Abar [ A sad]]]]]] –Why is John not sad? –[ CP [ Adv why][ Cbar [ C is][[ IP [ NP John][ NegP [ Neg not][[ VP [ V trace][ AP [ NP trace][ Abar [ A sad]]]]]]] –Why isn’t John sad? –[ CP [ Adv why][ Cbar [ C isn’t][[ IP [ NP John][ NegP [ Neg trace][[ VP [ V trace][ AP [ NP trace][ Abar [ A sad]]]]]]] [Follow the bracketing given exactly. Treat trace as if it was a real word. Treat isn’t as a single word in Prolog: ‘isn\’t’.]

Question 2 [Homework 2: Lecture 8] Phrase Structure and Meaning Grammars –[3pts] Show your grammar works. –Why is John sad? ?- cp(PS,[why,is,john,trace,trace,sad],[]). –Why is John not sad? ?- cp(PS,[why,is,john,not,trace,trace,sad],[]). –Why isn’t John sad? ?- cp(PS,[why,’isn\’t’,john,trace,trace,trace,sad],[]). –(Submit your runs.)

Question 2 [Homework 2: Lecture 8] Phrase Structure and Meaning Grammars –[6pts] Modify your rules involving trace to allow empty categories as follows: Old rule: x(x(trace)) --> [trace]. New rule: x(x(trace)) --> []. –Show your new rules work. –How many parses for each of the following queries? –Why is John sad? ?- cp(PS,[why,is,john,sad],[]). –Why is John not sad? ?- cp(PS,[why,is,john,not,sad],[]). –Why isn’t John sad? ?- cp(PS,[why,’isn\’t’,john,sad],[]). –(Submit your runs.)

Question 3 [Homework 3: Lecture 13] Phrase Structure and Meaning Grammars Contd. [8pts] Give a meaning grammar for sentence/meaning pairs: –dog(shelby). Shelby is a dog –(white(shelby),dog(shelby)). Shelby is a white dog –[Assume white is an intersective adjective.] [6pts] Evaluate your generated meanings against the Prolog versions of the following possible worlds: –(A) Shelby is a dog and Shelby is white –(B) Shelby is a dog and Shelby is brown (Submit your runs and possible worlds.)

Question 4 [Homework 4: Lecture 18] Plural and Mass Terms. Assume the lattice-style definition for the plural dogs: –:- dynamic dog/1. –dogs(Plural) :- findall(X,dog(X),L), plural(L,Plural). –plural(L,X+Y) :- selectone(X,L,L1), selectone(Y,L1,_). –plural(L,X+PL) :- selectone(X,L,L1), plural(L1,PL). –selectone(X,[X|L],L). –selectone(X,[Y|L],L2) :- selectone(X,L,L2). [4pts] Give a Prolog query for “two dogs” [4pts] Give a Prolog query for “two or more dogs” [4pts] Give a Prolog query for “not more than two dogs”

Question 5 [Homework 5: Lecture 22] Truth Tables and Quantification. Assume the Prolog definitions given in HW 5 for logical implication ( ⇒ ) and negation (¬) [8pts] Are P ⇒ Q and ¬Q ⇒ ¬P equivalent? Prove your answer using Prolog truth tables (Submit your Prolog query and run.) P ⇒ Q TTT FTT FTF TFF P¬P TF FT

Question 6 [Homework 5: Lecture 22] Truth Tables and Quantification. Define |S| to be the size of set S –examples: –|{a,b}| = 2 –|{a,b,c}| / 2 > |{a}| [10pts] Give the set-theoretic, i.e. Generalized Quantifier- based, semantics for the sentences: –Most men smoke –Most smokers are men (You may use set notation or Prolog notation.) (There is no need to run a Prolog query.)

Question 7 [Homework 6: Lecture 27] Tense and Aspect. [8pts] Give the relations between S, E, T for the sentences: –John had left yesterday –John has left [3pts] According to the theory, what is semantically odd about? –# John has left yesterday

Summary Total: 82 pts –Q1: 8pts –Q2: 19pts –Q3: 14pts –Q4: 12pts –Q5: 8pts –Q6: 10pts –Q7: 11pts