Albert Gatt LIN3021 Formal Semantics Lecture 3. Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

LIN3021 Formal Semantics Lecture 2
CAS LX 502 8a. Formal semantics Truth and meaning The basis of formal semantics: knowing the meaning of a sentence is knowing under what conditions.
Knowledge Representation Methods
1 Conditional XPath, the first order complete XPath dialect Maarten Marx Presented by: Einav Bar-Ner.
Artificial Intelligence First-Order Predicate Logic -
March 5: more on quantifiers We have encountered formulas and sentences that include multiple quantifiers: Take, for example: UD: People in Michael’s office.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
The Language of Propositional Logic The Syntax and Semantics of PL.
FIRST ORDER LOGIC Levent Tolga EREN.
Predicates and Quantifiers
Intro to Discrete Structures
DEDUCTIVE DATABASE.
Artificial Intelligence: Definition “... the branch of computer science that is concerned with the automation of intelligent behavior.” (Luger, 2009) “The.
First Order Logic Chapter 7. PL is a Weak Representational Language §Propositional Logic (PL) is not a very expressive language because: §Hard to identify.
1st-order Predicate Logic (FOL)
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
Chapter 8 Relational Calculus. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.8-2 Topics in this Chapter Tuple Calculus Calculus vs. Algebra.
Database Management Systems, R. Ramakrishnan1 Relational Calculus Chapter 4.
Pattern-directed inference systems
ARTIFICIAL INTELLIGENCE Lecture 3 Predicate Calculus.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
CS344: Introduction to Artificial Intelligence Lecture: Herbrand’s Theorem Proving satisfiability of logic formulae using semantic trees (from Symbolic.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 28– Interpretation; Herbrand Interpertation 30 th Sept, 2010.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
LDK R Logics for Data and Knowledge Representation PL of Classes.
Albert Gatt LIN3021 Formal Semantics Lecture 4. In this lecture Compositionality in Natural Langauge revisited: The role of types The typed lambda calculus.
Formal Methods in Software Engineering 1
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 8.
Key Concepts Representation Inference Semantics Discourse Pragmatics Computation.
1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ
CS6133 Software Specification and Verification
Artificial Intelligence First-Order Logic (FOL). Outline of this Chapter The need for FOL? What is a FOL? Syntax and semantics of FOL Using FOL.
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
LDK R Logics for Data and Knowledge Representation First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Semantics of Predicate Calculus For the propositional calculus, an interpretation was simply an assignment of truth values to the proposition letters of.
Artificial Intelligence First-Order Predicate Logic - First-Order Predicate Logic (FOL or FOPL), also called First-Order Predicate Calculus.
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
EEL 5937 Content languages EEL 5937 Multi Agent Systems Lecture 10, Feb. 6, 2003 Lotzi Bölöni.
Section 1.5 and 1.6 Predicates and Quantifiers. Vocabulary Predicate Domain Universal Quantifier Existential Quantifier Counterexample Free variable Bound.
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.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Propositional and predicate logic
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 04 : Logic.
Knowledge Representation Lecture 2 out of 5. Last Week Intelligence needs knowledge We need to represent this knowledge in a way a computer can process.
Propositional Calculus: Boolean Functions and Expressions
Logic II CSE 140 etc..
ARTIFICIAL INTELLIGENCE
Logics for Data and Knowledge Representation
1st-order Predicate Logic (FOL)
Back to “Serious” Topics…
Logics for Data and Knowledge Representation
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Predicates and Quantifiers
1st-order Predicate Logic (FOL)
Presentation transcript:

Albert Gatt LIN3021 Formal Semantics Lecture 3

Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of compositionality. First, we’ll do it by providing a compositional interpretation of a couple of formal languages. 2. We’ll then look at Natural Language, and ask how we can model meaning in the same sort of way.

Syntax and semantics of formal systems In defining a compositional semantics for formal languages like Propositional Logic, we: Specify the syntax using a set of recursive rules of the following kind: If α is a wff then γ = C( α ) is a wff. where C is some unary syntactic operation, such as logical negation If α is a wff and β is a wff, then γ = F( α, β ) is a wff. where F is some binary syntactic operation, such as logical conjunction Specify the semantics using recursive rules that correspond to the syntax: If α is interpreted as [[α]], then then γ = C( α ) is interpreted as M([[ α]] ) where M is a semantic operation corresponding to C If α is interpreted as [[α]] and β is interpreted as [[β]], then γ = F( α, β ) is interpreted as [[ γ ]] = G( [[α]], [[β]]) where G is a semantic operation corresponding to F. NB: this is not too different from the way we proceeded in describing the semantics of simple predicative expressions last week.

Part 1 Compositional semantics for propositional logic

Basic vocabulary We assume infinitely many propositional variables for atomic propositions: p, q, r, s, t,…, p 1, q 1, r 1, s 1,… We also have the logical connectives: ¬, , , ->,  We also need the two parentheses ( and ) No other symbol belongs to propositional logic.

Syntactic rules 1. Every propositional variable is a wff thus, p is a formula of propositional logic so is q, r etc 2. If α is a wff and β is a wff, then the following are also wffs: a) ¬ α b) ( α  β ) c) ( α  β ) d) ( α  β ) e) ( α  β ) 3. Only expressions constructed by these rules are wff’s. If α is a wff then γ = C( α ) is a wff. If α is a wff and β is a wff, then γ = F( α, β ) is a wff.

The semantics of Propositional Logic In Propositional Logic, we’re only dealing with atomic statements and combinations thereof (we’re not looking at the structure of those statements) All we can do with statements is assign them a true or false interpretation. So our semantic rules must: Specify the truth value of the atomic statements Specify the way that complex statements can be evaluated as a function of their structure. Let f be a function which assigns each atomic statement a truth value 1 (true) or 0 (false).

Semantic rules SyntaxSemantics 1. Every prop. variable is a wff. 2. If α is a wff and β is a wff, then the following are also wffs: a) ¬ α b) ( α  β ) c) ( α  β ) d) ( α  β ) e) ( α  β ) 3. Only expressions constructed by these rules are wff’s. 1. If α is a wff, then [[ α ]] = f( α ) 2. If α is a wff and β is a wff, then: a) [[¬ α ]] = 0 if [[ α ]=1; 1 otherwise. b) [[( α  β )]] = 1 iff [[ α ]] = 1 and [[ β ]] = 1 c) [[( α  β )]] =1 iff [[ α ]] = 1 or [[ β ]] = 1 d) [[( α  β )]] = 1 iff [[ α ]] = 0 or [[ β ]] = 1 e) [[ α  β ]] = 1 iff [[ α ]] = [[ β ]] Note: these semantic rules basically describe the structure of the truth tables for the connectives. If α is interpreted as [[α]], then then γ = C( α ) is interpreted as M([[ α]] ) If α is interpreted as [[α]] and β is interpreted as [[β]], then γ = F( α, β ) is interpreted as [[ γ ]] = G( [[α]], [[β]])

Using the rules for compositional interpretation In logic, every formula is unambiguous, i.e. can be assigned a unique derivation tree (compare this to NL). This means the semantic rules can operate unambiguously as well. Example: ¬(p  q) ¬(p  q) (syn. 2a) (p  q) (syn. 2c) q (syn. 1) p(syn. 1) 0 (sem. 2a) 1 (sem. 2c) 1 (sem.1) 0 (sem. 1)

Part 2 Compositional semantics for propositional logic

Basic vocabulary individual constants: a, b, c,… individual variables: x, y, z… predicate variables: P, Q, R… quantifiers: ,  Also, from propositional logic: propositional variables: p, q, r… logical connectives: ¬, , , ->,  parentheses: ( )

Some conventions We will use t1, t2, etc to stand for any individual term: a variable; or an individual constant. We will use Greek letters ( α, β …) to stand for well-formed formulas of predicate logic.

Syntactic rules 1. If t 1, t 2, …, t n are individual terms, and P is an n-place predicate, then P(t 1, t 2, …, t n ) is a wff. 2. If α is a wff and β is a wff, then the following are also wffs: a) ¬ α b) ( α  β ) c) ( α  β ) d) ( α  β ) e) ( α  β ) 3. If α is a wff and v is a variable, then (  v) α is a wff 4. If α is a wff and v is a variable, then (  v) α is a wff 5. Only the formulas constructed with these rules are wff’s of predicate logic. If α is a wff then γ = C( α ) is a wff. If α is a wff and β is a wff, then γ = F( α, β ) is a wff.

Semantics of Predicate Logic For PL, we need to deal with variables and other individual terms. So it’s crucial to specify a model: M = where U is our domain of individuals (what our variables range over) I is our interpretation function We’ll use last week’s model as our example: U = {Isabel Osmond, Emma Bovary, Alexander Portnoy, Beowulf} We also need to introduce a variable assignment function (denoted g). Roughly, this is just a function that, given a domain U, assigns each variable in a formula some value in U.

Variable assignments Consider:  x.clever(x) “Some x is clever.” x “stands for” some individual in the domain U. To determine whether this is true, we need to determine some value for x – there must be at least one which makes the formula come out true. Suppose our model stipulates that: [[clever]] M = {A. Portnoy, E. Bovary, I. Osmond} If we start with x = Beowulf, then the formula is false. We need to test alternative values of x while we’re interpreting the formula.

Semantic rules 1. If α is a constant, then [[ α ]] M,g = I( α ) Constants are fixed by our interpretation function 2. If α is a variable, then [[ α ]] M,g = g( α ) Variables are assigned by our variable assignment function 3. If P is an n-ary predicate and t 1,...,t n are terms, then [[P(t1,...,tn)]] = 1 iff  [[P]] M,g Predicates are interpreted as ordered n-tuples 4. If α is a wff and β is a wff, then: a) [[¬ α ]] M,g = 1 iff [[ α ]] M,g = 0 b) [[ α  β ]] M,g = 1iff [[ α ]] M,g = 1 and [[ β ]] M,g =1 c) [[ α  β ]] M,g =1 iff [[ α ]] M,g = 1 or [[ β ]] M,g =1 d) [[ α  β ]] M,g = 1 iff [[ α ]] M,g = 0 or [[ β ]] M,g =1 e) [[ α  β ]]M,g = 1 iff [[ α ]] M,g = [[ β ]] M,g 5. If α is a wff and v is a variable, then [[(  v) α ]] M,g = 1 iff for all x  U, [[ α ]] M,g[x/v] = 1 6. If α is a wff and v is a variable, then [[(  v) α ]]M,g = 1 iff there is at least one x  U, [[ α ]] M,g[x/v] = 1 If α is interpreted as [[α]], then then γ = C( α ) is interpreted as M([[ α]] ) If α is interpreted as [[α]] and β is interpreted as [[β]], then γ = F( α, β ) is interpreted as [[ γ ]] = G( [[α]], [[β]]) Essentially the same as for propositional logic, but we need to make reference to the model M and the assignment function g

A closer look If α is a wff and v is a variable, then [[(  v) α ]] M,g = 1 iff for all x  U, [[ α ]] M,g[x/v] = 1 6. If α is a wff and v is a variable, then [[(  v) α ]]M,g = 1 iff there is at least one x  U, [[ α ]] M,g[x/v] = 1 The notation [[ α ]] M,g[x/v] = 1 can be interpreted as a kind of instruction: Find an assignment function which is identical to the original, except that the value for v is substituted for x.

A closer look Our modelA formula U = {isabel, emma, Semantics} Constants: [[i]] M = Isabel [[e]] M = Emma [[s]] M = Semantics Predicates: [[person]] M = {isabel, emma} [[book]] M = {Semantics} [[read]] M = { } Initial variable assignment: g(x) = emma  x[book(x)  read(i,x)] Isabel reads a book Only if x = Semantics is this formula true  x[book(x)  read(i,x)] book(x)  read(i,x) x read(i,x)book(x) bookx xread i

Interpreting the formula We proceed bottom-up: [[book]] M,g = Semantics [[x] M,g = emma Therefore [[book(x)]] M,g = 0  x[book(x)  read(i,x)] book(x)  read(i,x) x read(i,x)book(x) bookx xread

Interpreting the formula We proceed bottom-up: [[book]] M,g = Semantics [[x] M,g = emma Therefore [[book(x)]] M,g = 0 [[read]] M,g = { } [[i] M,g = isabel [[x]] M,g = emma Therefore [[read(i,x)]] M,g = 0  x[book(x)  read(i,x)] book(x)  read(i,x) x read(i,x)book(x) bookx xread

Interpreting the formula We proceed bottom-up: [[book]] M,g = Semantics [[x] M,g = emma Therefore [[book(x)]] M,g = 0 [[read]] M,g = { } [[i] M,g = isabel [[x]] M,g = emma Therefore [[read(i,x)]] M,g = 0 [[book(x)  read(i,x)]] M,g = 0  x[book(x)  read(i,x)] book(x)  read(i,x) x read(i,x)book(x) bookx xread

The situation so far We have a formula where we’ve set the value for the free variable x using our initial variable assignment g. We know that its value is 0. At this point, we find that the variable is bound by the existential quantifier. And our interpretation rule says: find some assignment g’ identical to the original, except that the value for the free variable x is substituted for some other value so that the formula comes out true on this assignment  x[book(x)  read(i,x)] book(x)  read(i,x) x read(i,x)book(x) bookx xread

The situation so far Clearly, our assignment g doesn’t make the formula come out true. Can we find another assignment g’ identical to g, except that x in g’ is a different individual, which is a book? g’(x) = Semantics On this assignment, the formula comes out true.  x[book(x)  read(i,x)] book(x)  read(i,x) x read(i,x)book(x) bookx xread (The point is that the initial assignment was needed to get us up the tree, but ultimately had no effect on the final interpretation.)

In general To compositionally interpret Predicate Logic formulas, we need models and explicit consideration of how variables are assigned. We’ve seen an example with existential quantification. Things proceed in largely the same way with universal quantification, except that we have to check whether the formula is true for every value of the variable, on a given assignment.