LING 364: Introduction to Formal Semantics Lecture 4 January 24th.

Slides:



Advertisements
Similar presentations
Artificial Intelligence: Natural Language and Prolog
Advertisements

Prolog programming....Dr.Yasser Nada. Chapter 8 Parsing in Prolog Taif University Fall 2010 Dr. Yasser Ahmed nada prolog programming....Dr.Yasser Nada.
Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.
Augmented Transition Networks
CSA2050: DCG I1 CSA2050 Introduction to Computational Linguistics Lecture 8 Definite Clause Grammars.
LING 388: Language and Computers Sandiway Fong Lecture 5: 9/5.
LING 364: Introduction to Formal Semantics Lecture 24 April 13th.
LING 388: Language and Computers Sandiway Fong Lecture 5: 9/8.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Prolog COMP 112 #
Chapter 4 Syntax.
Dr. Abdullah S. Al-Dobaian1 Ch. 2: Phrase Structure Syntactic Structure (basic concepts) Syntactic Structure (basic concepts)  A tree diagram marks constituents.
LING 388: Language and Computers Sandiway Fong Lecture 2: 8/24.
LING 364: Introduction to Formal Semantics Lecture 8 February 7th.
CSE 425: Logic Programming I Logic and Programs Most programs use Boolean expressions over data Logic statements can express program semantics –I.e., axiomatic.
LING 581: Advanced Computational Linguistics Lecture Notes April 23rd.
Natural Language Processing - Feature Structures - Feature Structures and Unification.
LING 364: Introduction to Formal Semantics Lecture 10 February 14th.
LING 388 Language and Computers Lecture 2 9/04/03 Sandiway FONG.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
Parsing: Features & ATN & Prolog By
LING 364: Introduction to Formal Semantics
LING 388: Language and Computers Sandiway Fong Lecture 28: 12/6.
LING 364: Introduction to Formal Semantics Lecture 11 February 16th.
LING 364: Introduction to Formal Semantics Lecture 2 January 17th.
LING 388: Language and Computers Sandiway Fong Lecture 4: 8/31.
LING 388: Language and Computers Sandiway Fong Lecture 3: 8/29.
LING 364: Introduction to Formal Semantics Lecture 1 January 12th.
LING 388 Language and Computers Take-Home Final Examination 12/9/03 Sandiway FONG.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
LING 364: Introduction to Formal Semantics Lecture 3 January 19th.
LING 388 Language and Computers Lecture 18 10/30/03 Sandiway FONG.
LING 364: Introduction to Formal Semantics Lecture 13 February 23rd.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Formal Aspects of Computer Science – Week 12 RECAP Lee McCluskey, room 2/07
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
1 LING 438/538 Computational Linguistics Sandiway Fong Lecture 4: 8/31.
LING 388: Language and Computers Sandiway Fong Lecture 13: 10/10.
Models of Generative Grammar Smriti Singh. Generative Grammar  A Generative Grammar is a set of formal rules that can generate an infinite set of sentences.
LING 388: Language and Computers Sandiway Fong 10/4 Lecture 12.
THE PARTS OF SYNTAX Don’t worry, it’s just a phrase ELL113 Week 4.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
LING 388: Language and Computers Sandiway Fong Lecture 7.
LING 388: Language and Computers Sandiway Fong Lecture 3.
LING 388: Language and Computers Sandiway Fong Lecture 30 12/8.
IV. SYNTAX. 1.1 What is syntax? Syntax is the study of how sentences are structured, or in other words, it tries to state what words can be combined with.
1 LIN 1310B Introduction to Linguistics Prof: Nikolay Slavkov TA: Qinghua Tang CLASS 13, Feb 16, 2007.
LING 388: Language and Computers Sandiway Fong Lecture 26 11/22.
LING 388: Language and Computers Sandiway Fong Lecture 10.
I am Dr. Abdulrahman Alqurashi
CT214 – Logical Foundations of Computing Lecture 8 Introduction to Prolog.
Artificial Intelligence: Natural Language
Albert Gatt LIN3021 Formal Semantics Lecture 4. In this lecture Compositionality in Natural Langauge revisited: The role of types The typed lambda calculus.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Rules, Movement, Ambiguity
Making it stick together…
 Chapter 8 (Part 2) Transformations Transformational Grammar Engl 424 Hayfa Alhomaid.
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
LING/C SC/PSYC 438/538 Lecture 18 Sandiway Fong. Adminstrivia Homework 7 out today – due Saturday by midnight.
In The Name Of Allah Lab 03 1Tahani Aldweesh. objectives Searching for the solution’s. Declaration. Query. Comments. Prolog Concepts. Unification. Disjunction.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
LING/C SC 581: Advanced Computational Linguistics Lecture Notes Feb 3 rd.
Welcome to the flashcards tool for ‘The Study of Language, 5 th edition’, Chapter 8 This is designed as a simple supplementary resource for this textbook,
Beginning Syntax Linda Thomas
LING 581: Advanced Computational Linguistics
Lecture 3: Functional Phrases
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
BBI 3212 ENGLISH SYNTAX AND MORPHOLOGY
X-bar Schema Linguistics lecture series
Principles and Parameters (I)
Presentation transcript:

LING 364: Introduction to Formal Semantics Lecture 4 January 24th

Administrivia Reminder: –Homework 1 due on Thursday –in my inbox (midnight deadline) –need clarification, help? ask questions now There may be another lab class this Thursday (a short one: room is in demand) –check your –and the course homepage

Last Time Computer lab class: –First time with SWI-Prolog –... as will become apparent during this course, it’s a very convenient and powerful tool for expressing the rules of language

Last Time Important Concepts –English to logic facts –e.g. Mary is a baseball fan. ➔ baseball_fan(mary). –predicate: baseball_fan –argument: mary –e.g. Mary likes John ➔ likes(mary,john). –multiple arguments: express relations inference rules –e.g. snoring presupposes sleeping ➔ sleeping(X) :- snoring(X). –logic variable: X –if: :- –note: basically expresses idea... snoring(X) ⇒ sleeping(X)

Last Time Important Concepts –Prolog database the database represents a scenario or possible world initially, the world is empty we can assert and retract facts and rules –e.g. ?- assert(baseball_fan(mary)). asserted facts and rules are true in that world Closed World Assumption: –things that are not asserted or inferable are false (in this world) can’t have negated facts (or head of rules) in the database –e.g. ?- assert((\+ baseball_fan(mary))). is not allowed –e.g. ?- assert((\+ baseball_fan(X) :- hates(X,baseball)). is not allowed –e.g. ?- assert((baseball_fan(X) :- \+ hates(X,baseball)). is allowed

Last Time Important Concepts –finally, we can evaluate logical queries with respect to this database e.g ?- baseball_fan(X). is true provided world contains one or more baseball_fan/1 facts is false otherwise logic variable X is bound to the value produced by matching query to fact multiple matches are possible: semicolon ; (disjunction) query may also match against the head of a rule e.g. baseball_fan(X) :- loves(X,baseball). results in subquery: ?- loves(X,baseball). –means to prove baseball_fan(X) we have to in turn prove loves(X,baseball)

Last Time Important Concepts –negated queries are ok (though they return no answer other than Yes/No) –query ?- \+ baseball_fan(X). is true if –subquery ?- baseball_fan(X). is not true –?- baseball_fan(X). would be not true for all possible worlds where there are no baseball fans –i.e. no baseball_fan/1 facts –and we have no rules that could be used to conclude baseball_fan/1 is true from logical inference –e.g. no world like baseball_fan(X) :- loves(X,baseball). loves(john,baseball). loves(john,football).

Larger Picture Computer Lab homework –asks you to write Prolog facts, rules and queries corresponding to a series of English sentences and questions examples: –Mary is a student –Pete is a baseball fan –who is both a student and a baseball fan? –who is a baseball fan and not a student?

Larger Picture You’re translating English into logical meaning Mary is a student who is a student? student(mary). ?- student(X). to do this you have to be able to parse and assign meaning to the English input

Larger Picture Goal: Formalize language so this can be done step by step Mary is a student who is a student? student(mary). ?- student(X).

Larger Picture In just a few more lectures, we’ll be able to do this quick demo to do this we have to be able to (1)parse, and (2)assign meaning to the English input we’ll be developing the tools and techniques to do this

Today’s Topic We begin with... Syntax (or grammar) motivation: –to understand a sentence, we also have to be able to “diagram it” –i.e. know its constituents –subject –verb or predicate –object

Syntactic Structure A formal grammar enables us to logically break down a sentence into its constituent parts X-bar phrase structure constituent labels C2 = CP = S-bar (clause) I2 = S (sentence) VP = Verb Phrase V = Verb NP = Noun Phrase DET = determiner N1 = Noun (bar level 1)

Syntactic Structure A formal grammar enables us to logically break down a sentence into its constituent parts X-bar phrase structure subject: [ I2 [ NP john] I1 ] VP: is a student copula: is complement of VP: [ NP [ DET a][ N1 student]] (predicate NP)

Syntactic Structure A formal grammar enables us to logically break down a sentence into its constituent parts X-bar phrase structure constituent labels C2 = CP = S-bar (clause) C = complementizer I2 = S (sentence) VP = Verb Phrase V = Verb NP = Noun Phrase DET = determiner NPt = NP trace

Syntactic Structure A formal grammar enables us to logically break down a sentence into its constituent parts X-bar phrase structure specifier of CP: [ CP [ NP who] C1 ] head of CP: C: auxiliary verb is subject: [ I2 [ NP trace] I1 ] subject is coindexed [1] with specifier of CP VP: [ V trace] a student verb (trace) is coindexed [2] with is complement of VP: [ NP [ DET a][ N1 student]]

Syntactic Structure We could but don’t have to specifically use X-bar phrase structure to diagram sentences –idea that all phrases have regular internal structure –[ XP specifier [ X1 [ X head] complement ]] –X = {C,I,V,N,A,P,..} –so long as we’re able to identify (recover) configurations and (implied) grammatical positions subject object verb (predicate)

Phrase Structure Rules Simple rules: SBar → S S → NP VP VP → V NP V → is NP → DET N NP → ProperNoun ProperNoun → John DET → a N → student subject object

Phrase Structure Rules Simple rules: SBar → S S → NP VP VP → V NP V → is NP → DET N NP → ProperNoun ProperNoun → John DET → a N → student subject object –John is a [ pred student] –John [ pred likes] Mary –John is [ pred happy] which is the predicate? –V (main verb: likes) –V aux is (copula carries little meaning) –complement of copula is the predicate Note: –gotta be careful –John is the student

Phrase Structure Rules Rules: SBar → WhNoun Aux S WhNoun → who Aux → is S → NPtrace VP NPtrace →ε VP → Vtrace NP Vtrace →ε NP → DET N DET → a N → student empty subject object plus associations by coindexation between traces and contentful items

Phrase Structure Rules To come... –a very cool thing we’ll be using is that Prolog has a grammar rule system built into it i.e. we can ask Prolog to do the diagramming for us... of course, we have to supply the phrase structure rules

Reading Assignment(s) for later this week –handout –Chapter 2: Putting a Meaning Together from Pieces –we will discuss it on Thursday are you comfortable diagramming sentences? –if not, grab any grammar/syntax book –or search the web: Thursday –there will be a 15 minute quiz at the end of class