Logical Structures in Natural Language: First order Logic (FoL)

Similar documents
Logic: First Order Logic

Logic: Propositional Logic Truth Tables

Logic: First Order Logic

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

Logic Overview, I. and T T T T F F F T F F F F

CS 2800: Logic and Computation Fall 2010 (Lecture 13)

Propositional Logic Not Enough

Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo

Proseminar on Semantic Theory Fall 2013 Ling 720 First Order (Predicate) Logic: Syntax and Natural Deduction 1

Proseminar on Semantic Theory Fall 2013 Ling 720 Propositional Logic: Syntax and Natural Deduction 1

Mathematical Logic. Reasoning in First Order Logic. Chiara Ghidini. FBK-IRST, Trento, Italy

First Order Logic: Syntax and Semantics

2. Use quantifiers to express the associative law for multiplication of real numbers.

Notes on Propositional and First-Order Logic (CPSC 229 Class Notes, January )

Automated Reasoning Lecture 5: First-Order Logic

Reasoning. Inference. Knowledge Representation 4/6/2018. User

CS 1571 Introduction to AI Lecture 14. First-order logic. CS 1571 Intro to AI. Midterm

Introduction to Sets and Logic (MATH 1190)

Logic and Modelling. Introduction to Predicate Logic. Jörg Endrullis. VU University Amsterdam

Logic. Foundations of First Order Logic. franconi. Enrico Franconi

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

cis32-ai lecture # 18 mon-3-apr-2006

Comp487/587 - Boolean Formulas

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1

Discrete Mathematics and Its Applications

Predicate Calculus. Lila Kari. University of Waterloo. Predicate Calculus CS245, Logic and Computation 1 / 59

Deductive Systems. Lecture - 3

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16)

Section 2.1: Introduction to the Logic of Quantified Statements

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Ling 130 Notes: Predicate Logic and Natural Deduction

Logic: Propositional Logic (Part I)

CHAPTER 11. Introduction to Intuitionistic Logic

Logic: First Order Logic (Part I)

Marie Duží

Introduction to first-order logic:

First Order Logic Semantics (3A) Young W. Lim 9/17/17

All psychiatrists are doctors All doctors are college graduates All psychiatrists are college graduates

COMP 2600: Formal Methods for Software Engineeing

Propositional logic (revision) & semantic entailment. p. 1/34

Discrete Structures for Computer Science

Formal (Natural) Deduction for Predicate Calculus

Propositional and First-Order Logic

Semantics and Pragmatics of NLP

Today s Lecture. ICS 6B Boolean Algebra & Logic. Predicates. Chapter 1: Section 1.3. Propositions. For Example. Socrates is Mortal

Recall that the expression x > 3 is not a proposition. Why?

Predicate Calculus - Syntax

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

Logic for Computer Science - Week 2 The Syntax of Propositional Logic

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

LIN1032 Formal Foundations for Linguistics


First-order logic Syntax and semantics

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Logic. (Propositional Logic)

Logic. Readings: Coppock and Champollion textbook draft, Ch

Predicate Logic - Deductive Systems

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

First Order Logic Semantics (3A) Young W. Lim 8/9/17

THE LOGIC OF COMPOUND STATEMENTS

Introduction to Logic in Computer Science: Autumn 2006

LING 501, Fall 2004: Quantification

Announcement. Homework 1

First-Order Logic. Chapter Overview Syntax

Logics - Introduction

Math Fundamentals of Higher Math

Predicate Logic: Sematics Part 1

KRIPKE S THEORY OF TRUTH 1. INTRODUCTION

Mat 243 Exam 1 Review

Predicate Calculus lecture 1

Propositional Logic: Syntax

LING 106. Knowledge of Meaning Lecture 3-1 Yimei Xiang Feb 6, Propositional logic

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

A Little Deductive Logic

Test 1 Solutions(COT3100) (1) Prove that the following Absorption Law is correct. I.e, prove this is a tautology:

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

ITS336 Lecture 6 First-Order Logic

Propositional Logic: Logical Agents (Part I)

E-type interpretation without E-type pronoun: How Peirce s Graphs. capture the uniqueness implication of donkey sentences

Intermediate Logic. First-Order Logic

J Propositional logic is declarative J Propositional logic is compositional: q meaning of B 1,1 P 1,2 is derived from meaning of B 1,1 and of P 1,2

1 Predicates and Quantifiers

Syntax of propositional logic. Syntax tree of a formula. Semantics of propositional logic (I) Subformulas

It rains now. (true) The followings are not propositions.

Why Knowledge Representation?

A Little Deductive Logic

Philosophy 240 Symbolic Logic Russell Marcus Hamilton College Fall 2014

! Predicates! Variables! Quantifiers. ! Universal Quantifier! Existential Quantifier. ! Negating Quantifiers. ! De Morgan s Laws for Quantifiers

Rules Build Arguments Rules Building Arguments

Formal Logic Lecture 11

Why Knowledge Representation? Example. Example. CSE 3401: Intro to AI & LP Knowledge Representation & First-Order Logic

Math 10850, fall 2017, University of Notre Dame

CHAPTER 10. Predicate Automated Proof Systems

Foundation of proofs. Jim Hefferon.

Predicate Calculus. Formal Methods in Verification of Computer Systems Jeremy Johnson

King s College London

CS70 is a course about on Discrete Mathematics for Computer Scientists. The purpose of the course is to teach you about:

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Generalized Quantifiers Logical and Linguistic Aspects

Transcription:

Logical Structures in Natural Language: First order Logic (FoL) Raffaella Bernardi Università degli Studi di Trento e-mail: bernardi@disi.unitn.it

Contents 1 How far can we go with PL?................................ 4 1.1 Inference........................................... 5 1.2 Exercise: Predicates and entities...................... 6 1.3 Housing lottery problem............................. 7 1.4 Graph Coloring Problem............................. 8 1.5 Syllogism.......................................... 9 1.6 Quantifiers......................................... 10 1.7 Quantifiers......................................... 11 1.8 Variables and Quantifiers............................ 12 1.9 Summing up: Motivations to move to FOL............. 13 2 Syntax of FoL............................................. 14 3 Domain and Interpretation................................. 15 3.1 Semantics of FOL: intuition.......................... 17 4 Sub-formulas, free and bound............................... 18 5 Exercises on FoL syntax.................................... 19 6 Tableaux................................................. 21 7 Heuristics................................................ 23

7.1 Heuristic (II)....................................... 26 8 Exercises................................................. 27 9 Next steps................................................ 30

1. How far can we go with PL? 1. Casper is bigger than John 2. John is bigger than Peter 3. Therefore, Casper is bigger than Peter. Questions: How would you formalize this inference in PL? What do you need to express that cannot be expressed in PL? Answer: You need to express: relations (is bigger than) and entities (Casper, John, Peter)

1.1. Inference 1. Bigger(casper,john) 2. Bigger(john,peter) 3. Therefore, Bigger(casper,peter) Question: Do you still miss something?

1.2. Exercise: Predicates and entities Formalize: John is bigger than Peter or Peter is bigger than John If Raffaella is speaking, then Rocco is listening If Peter is laughing, than John is not biting him. Predicates represent sets of objects (entities). For example: is listening is the set of all those entities that are listening i.e. all of you!

1.3. Housing lottery problem Housing lotteries are often used by university housing administrators to determine which students get first choice of dormitory rooms. Consider the following problem: 1. Bob is ranked immediately ahead of Jim. 2. Jim is ranked immediately ahead of a woman who is a biology major. 3. Lisa is not near to Bob in the ranking. 4. Mary or Lisa is ranked first. Is it true that Jim is immediately ahead of Lisa and Lisa is the last of the ranking and Mary is the first? Questions: How would you formalize the problem in PL? What do you need to express that you cannot express in PL? It would be handy to say, e.g. that there exists a woman who is a biology major.

1.4. Graph Coloring Problem Formalization of our general knowledge about graphs and color assignments. First of all let 1, 2... n be our vertices, and B (blue), R (red), G (green)... be our colors, and let B i, C i,j stand for i is of color B and i is connected to j. Symmetry of edges: C 1,2 C 2,1,... (so for the other connected vertices) Coloring of vertices: B 1 G 1 R 1... (so for the colors and for the other vertices) Uniqueness of colors per veritex: B 1 ( G 1 R 1 )... (so for the other vertices) Secondly, we have an explicitly given constraint: the coloring function has to be such that no two connected vertices have the same color: Explicit Constraint: C 1,2 (B 1 B 2 ) (R 1 R 2 ) (G 1 G 2 )... (so for the other colors and the other vertices) Question: Which could be a way to express these properties of colors and edges in a few words? We could speak to properties that hold for all colors, or all vertices!

1.5. Syllogism 1. Some four-legged creatures are genus 2. All genus are herbivores 3. Therefore, some four-legged creatures are herbivores Question: What is the schema behind the reasoning? What you could not express in PL even if we add relations and entity? 1. Some F are G 2. All G are H 3. Therefore, some F are H We still need quantifiers to express some and all.

1.6. Quantifiers Quantifiers like truth-functional operators (,,, ) are logical operators; but instead of indicating relationships among sentences, they express relationships among the sets designated by predicates. For example, statements like that is All A are B assert that the set A is a subset of the set B, A B; all the members of A are also members of B.

1.7. Quantifiers Statements like Some A are B assert that the set A shares at least one member with the B A B 0; Note, hence Some A are B is considered to be different from standard usage: at least one member it does not presuppose that not all A are B

1.8. Variables and Quantifiers All A are B can be read as saying: For all x, if x is A then x is B. i.e. what we said before: all the members of A are also members of B, i.e A is included in B, A B. We write this as: x.a(x) B(x) Some A are B can be read as saying: For some x, x is A and x is B. i.e. what we said before: there exists at least a members of A that is also a members of B. We write this as: x.a(x) B(x)

1.9. Summing up: Motivations to move to FOL We can already do a lot with propositional logic. But it is unpleasant that we cannot access the structure of atomic sentences. Atomic formulas of propositional logic are too atomic they are just statements which my be true or false but which have no internal structure. In First Order Logic (FOL) the atomic formulas are interpreted as statements about relationships between objects.

2. Syntax of FoL Formulas: φ, ψ P (t 1,..., t n ) atomic formulas false true φ negation φ ψ conjunction φ ψ disjunction φ ψ implication φ ψ equivalence x. φ universal quantification x. φ existential quantification E.g. Everyone in England is smart: x. In(x, england) Smart(x) Someone in France is smart: x. In(x, f rance) Smart(x)

3. Domain and Interpretation Socrates, Plato, Aristotle are philosophers Mozart and Beethoven are musicians All of them are human beings Socrates knows Plato. Mozart knows Beethoven. Which do you thing is the Domain of discourse? What s the meaning of knows, and of musician, philosopher and human beings? Are the statements below true or false in the above situation? 1. x.humanbeings(x)? 2. x.humanbeings(x) M usicians(x)? 3. x.f emale(x) M usicians(x)?

3.1. Semantics of FOL: intuition Just like in propositional logic, a (complex) FOL formula may be true (or false) with respect to a given interpretation. An interpretation specifies referents for constant symbols objects predicate symbols relations An atomic sentence P (t 1,..., t n ) is true in a given interpretation iff the objects referred to by t 1,..., t n are in the relation referred to by the predicate P. An interpretation in which a formula is true is called a model for the formula.

4. Sub-formulas, free and bound Sub-formula is a string inside a wff such that it is also a wff. For instance, in the wff: x(p (x) Q(y)) the sub-formulas are: x(p (x) Q(y)) P (x) Q(y) P (x) Q(y) Quantifier It is always before a sub-formula (its scope) and it is associated to a variable (the variable appearing just after the quantifier and of which the quantifier express its quantification.) Variable A variable inside a formula is said to be free if it does not occur in any subformula preceded by a quantifier associated to such variable. Otherwise, it is said to be bound. In the example above x is bound whereas y is free. A formula is said to be closed if it does not contain free variable, it is said to be open if it contains free variable.

5. Exercises on FoL syntax How do you represent in FOL the following sentences? 1. All lectures teach Logic. x.lectures(x) Teach(x, logic) 2. Not all lecturers teach Logic. ( x.lectures(x) Teach(x, logic)) 3. Some lectures teach logic x.lectures(x) Teach(x, logic) 4. Some lectures do not teach Logic x.lectures(x) Teach(x, logic) Question: Are any of these sentences/formulas equivalent? Yes: 2 and 4! Question: What do you conclude? How can you generalize this claim? x.a = x A

6. Tableaux A B A B A A B B A B A B A B A B A B A A (A B) A B (A B) A B (A B) A B A B (A B) A B

(10) x.a(x) A(t) where t is a term (11) x.a(x) A(t) where t is a term which has not been used in the derivation so far. (12) x(a(x)) x( A(x)) (13) x(a(x)) x( A(x))

7. Heuristics Prove x.( y.(r(x, y))) R(a, a) is valid. 1. ( x.( y.r(x, y))) R(a, a)) 2. x.( y.(r(x, y))) Rule (8) applied to 1. 3. R(a, a) Rule (8) applied to 1. 4. y.r(a, y) Rule (11) applied to 2. 5. R(a, a) Rule (11) applied to 4. Can we conclude that the x.( y.(r(x, y))) R(a, a) is valid? Let us interpret the above theorem as following: Let the natural numbers be our domain of interpretation. Let R(x, y) stand for x < y Then, x.( y.(r(x, y))) is satisfiable. E.g. 2 < 4. From this it follows that R(a, a) should be true as well, but it is not. Hence, x.( y.(r(x, y))) R(a, a) is not satisfiable in this interpretation, much less valid.

On line 5. Rule (11) has violeted the constraint: the term a was already used. Similarly, a could have not been used in line 4. either. Hence we don t get a contraddiction and the tableau is not closed. Note : The same term can be used many times for universal instantiation. Heuristic : When developing a semantic tableau in FOL use the existential instantiation rule (Rule 11) before the universal instantiation rule (Rule 10).

7.1. Heuristic (II) 1. ( x.(a(x) B(x)) x.a(x)) 2. x.(a(x) B(x)) Rule (8) applied to 1. 3. ( x.a(x)) Rule (8) applied to 1. 4. x. A(x) Rule (12) applied to 3. 5. A(a) Rule (11) applied to 4. 6. A(a) B(a) Rule (10) applied to 2. 7. A(a) Rule (1) applied to 6. 8. B(a) Rule (1) applied to 6. Closed Note: if we had used Rule 10 before we would have not been able to apply Rule 11.

8. Exercises Prove each of the following using semantic tableaux: 1. x.(a(x) (B(x) A(x))) 2. x.a(x) A(a) 3. ( x.a(x) x.b(x)) x.(a(x) B(x))

x.(a(x) (B(x) A(x))) 2. x.(a(x)) A(a) 1. ( x.(a(x) (B(x) A(x)))) 2. x.( (A(x) (B(x) A(x)))) Rule (12) applied to 1. 3. (A(a) (B(a) A(a))) Rule (8) applied to 2. 4. A(a) Rule (12) applied to 3. 5. (B(a) A(a)) Rule (8) applied to 3. 6. B(a) Rule (8) applied to 5. 7. A(a) Rule (8) applied to 5. Closed We cannot close the branch. 1. ( x.(a(x)) A(a)) 2. x.a(x) Rule (8) to line 1 3. A(a) Rule (8) to line 1 4. A(b) Rule (11) to line 2

3. ( xa(x) xb(x)) x(a(x) B(x)) 1. (( xa(x) xb(x)) x(a(x) B(x))) 2. xa(x) xb(x) Rule (8) to line 1 3. ( x(a(x) B(x))) Rule (8) to line 1 4. x (A(x) B(x)) Rule (13) to line 3 5. xa(x) Rule (1) to line 2 6. xb(x) Rule (1) to line 2 7. A(a) Rule (11) to line 5 8. B(b) Rule (11) to line 6 9. (A(a) B(a)) Rule (10) to line 4 10. A(a) B(a) Rule (6) to line 9 We cannot close the right branch. We could have used b in line 9 to give (A(b) B(b)), but then the left branch could have not been closed.

9. Next steps Wednesday 12th of April FoL and tableaux (ex. on reasoning) [shall we start at 12:30? or 12:45?] Thursday 13rd of April FoL and tableaux (formalization) Wednesday 19th Recap (what you tell me we should practice more) Thu. 20th of April sample Exam Wed. discussion sample exam