First Order Logic Arguments (5A) Young W. Lim 3/10/17

Similar documents
First Order Logic Arguments (5A) Young W. Lim 2/24/17

Propositional Logic Arguments (5A) Young W. Lim 2/23/17

First Order Logic Implication (4A) Young W. Lim 4/6/17

Propositional Logic Arguments (5A) Young W. Lim 11/30/16

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

Propositional Logic Resolution (6A) Young W. Lim 12/12/16

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

Propositional Logic Resolution (6A) Young W. Lim 12/31/16

Propositional Logic Logical Implication (4A) Young W. Lim 4/11/17

Propositional Logic Logical Implication (4A) Young W. Lim 4/21/17

Propositional Logic Arguments (5A) Young W. Lim 11/29/16

Propositional Logic (2A) Young W. Lim 11/8/15

Propositional Logic Arguments (5B) Young W. Lim 11/30/16

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

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

Logic Background (1A) Young W. Lim 5/14/18

Resolution (14A) Young W. Lim 8/15/14

Logic Background (1A) Young W. Lim 12/14/15

Logic (3A) Young W. Lim 11/2/13

Logic (3A) Young W. Lim 10/31/13

First Order Logic (1A) Young W. Lim 11/5/13

Logic (3A) Young W. Lim 10/29/13

First Order Logic (1A) Young W. Lim 11/18/13

Resolution (7A) Young Won Lim 4/21/18

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Implication (6A) Young Won Lim 3/17/18

Advanced Topics in LP and FP

Logic (3A) Young W. Lim 12/5/13

Implication (6A) Young Won Lim 3/12/18

Predicate Logic. Andreas Klappenecker

Proofs. Example of an axiom in this system: Given two distinct points, there is exactly one line that contains them.

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

CSE 20 DISCRETE MATH. Fall

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

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

Rules Build Arguments Rules Building Arguments

Discrete Mathematical Structures: Theory and Applications

CSE 20 DISCRETE MATH. Winter

A. Propositional Logic

A Quick Lesson on Negation

Computational Intelligence Lecture 13:Fuzzy Logic

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

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

Deductive and Inductive Logic

MAI0203 Lecture 7: Inference and Predicate Calculus

Propositional Logic: Review

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference)

PROPOSITIONAL CALCULUS

Chapter 1: The Logic of Compound Statements. January 7, 2008

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Inference in first-order logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

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

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

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

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

Relations (3A) Young Won Lim 3/27/18

Supplementary Logic Notes CSE 321 Winter 2009

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

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

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

The Logic of Compound Statements cont.

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Propositional Logic Review

Logic, Sets, and Proofs

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

COMP Intro to Logic for Computer Scientists. Lecture 6

Lecture 10: Even more on predicate logic" Prerequisites for lifted inference: Skolemization and Unification" Inference in predicate logic"

Artificial Intelligence Knowledge Representation I

Logic and Proofs. (A brief summary)

1 The Foundation: Logic and Proofs

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Manual of Logical Style

Analyzing Arguments with Truth Tables

Propositional Logic. Fall () Propositional Logic Fall / 30

Readings: Conjecture. Theorem. Rosen Section 1.5

Learning Goals of CS245 Logic and Computation

Logic - recap. So far, we have seen that: Logic is a language which can be used to describe:

Outline. Rules of Inferences Discrete Mathematics I MATH/COSC 1056E. Example: Existence of Superman. Outline

Inference in first-order logic

PHIL12A Section answers, 28 Feb 2011

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

(Refer Slide Time: 02:20)

1 The Foundation: Logic and Proofs

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

DISCRETE MATHEMATICS BA202

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Inf2D 13: Resolution-Based Inference

software design & management Gachon University Chulyun Kim

Valid Reasoning. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing February, Outline Truth and Validity Valid Reasoning

Methods of Proof. 1.6 Rules of Inference. Argument and inference 12/8/2015. CSE2023 Discrete Computational Structures

Artificial Intelligence. Propositional Logic. Copyright 2011 Dieter Fensel and Florian Fischer

Artificial Intelligence: Knowledge Representation and Reasoning Week 2 Assessment 1 - Answers

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

PHI Propositional Logic Lecture 2. Truth Tables

Lecture overview. Knowledge-based systems in Bioinformatics, 1MB602. Reasoning. Reasoning cont. Inference in propositional logic.

Transcription:

First Order Logic (5A) Young W. Lim

Copyright (c) 2016-2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions) to youngwlim@hotmail.com. This document was produced by using LibreOffice

Based on Contemporary Artificial Intelligence, R.E. Neapolitan & X. Jiang Logic and Its Applications, Burkey & Foxley 3

An argument consists of a set of formula : The premises formula The conclusion formula propositions propositions proposition List of premises followed by the conclusion A 1 formula A 2 A n -------- B premises conclusion 4

Formulas and Sentences An formula A atomic formula The operator followed by a formula Two formulas separated by,,, A quantifier following by a variable followed by a formula A sentence A formula with no free variables x love(x,y) : free variable y : not a sentence x tall(x) : no free variable : a sentence 5

Entailment Definition If the truth of a statement P guarantees that another statement Q must be true, then we say that P entails Q, or that Q is entailed by P. the key term, must be true Must be is stating that something is necessary, something for which no other option or possibility exists. Must be encodes the concept of logical necessity. http://www.kslinker.com/valid-and-invalid-arguments.html 6

Entailment Examples P: Mary knows all the capitals of the United States Q: Mary knows the capital of Kentucky P: Every one in the race ran the mile in under 5 minutes Q: John, a runner in the race, ran the mile in less than 5 minutes P: The questionnaire had a total of 20 questions, and Mary answered only 13 Q: The questionnaire answered by Mary had 7 unanswered questions P: The winning ticket starts with 3 7 9 Q: Mary's ticket starts with 3 7 9 so Mary's ticket is the winning ticket conceptually familiarity true conditional statements, or true implications are examples of entailment. any conditional statement, ( if.... then ) which is true, is an example of entailment. In Mathematics, the more familiar term is implication. http://www.kslinker.com/valid-and-invalid-arguments.html 7

Entail The premises is said to entail the conclusion If in every model in which all the premises are true, the conclusion is also true List of premises followed by the conclusion A 1 A 2 A n -------- B whenever all the premises are true the conclusion must be true for the entailment 8

Entailment Notation Suppose we have an argument whose premises are A 1, A 2,, A n whose conclusion is B Then A 1, A 2,, A n B if and only if A 1 A 2 A n B (logical implication) logical implication: if A 1 A 2 A n B is tautology (always true) The premises is said to entail the conclusion If in every model in which all the premises are true, the conclusion is also true 9

Entailment and Logical Implication A 1, A 2,, A n B A 1 A 2 A n B A 1 A 2 A n B is a tautology (logical implication) If all the premises are true, then the conclusion must be true T T T T T T T F F X X T 10

Sound Argument and Fallacy A sound argument A 1, A 2,, A n B If the premises entails the conclusion A fallacy A 1, A 2,, A n B If the premises does not entail the conclusion 11

Valid Argument Criteria If all the premises are true, then the conclusion must be true. the truth of the conclusion is guaranteed if all the premises are true It is impossible to have a false conclusion if all the premises are true The premises of a valid argument entail the conclusion. http://www.kslinker.com/valid-and-invalid-arguments.html 12

Valid Argument Examples If John makes this field goal, then the U of A will win. John makes the field goal. Therefore the U of A wins Modus Ponens If the patient has malaria, then a blood test will indicate that his blood harbors at least one of these parasites: P. falciparum, P. vivax, P. ovale and P. malaria Blood test indicate that the patient harbors none of these parasites Therefore the patient does not have malaria. Modus Tollens Either The Patriots or the Philadelphia Eagles will win the Superbowl The Patriots lost Therefore The Eagles won Disjunctive Syllogism (Process of Elimination) If John gets a raise, then he will buy a house. If John buys a house, he will run for a position on the neighborhood council. Therefore, if John gets a raise, he will run for a position on the neighborhood council Hypothetical Syllogism If P then Q P Therefore Q If P then Q Not Q Therefore Not P Either P or Q Not P Therefore Q If P then Q If Q then R Therefore If P then R http://www.kslinker.com/valid-and-invalid-arguments.html 13

Valid An argument form is valid if and only if whenever the premises are all true, then conclusion is true. An argument is valid if its argument form is valid. If If premises : true false false true then conclusion : true true false then never false http://math.stackexchange.com/questions/281208/what-is-the-difference-between-a-sound-argument-and-a-valid-argument 14

Sound An argument is sound if it is valid and all the premises are actually true. for an argument to be sound, two conditions must be meet: 1) the argument must be valid, and 2) the argument must actually have all true premises. What can be said about the conclusion to a sound argument? Since the argument is sound, then it is both valid and actually has all true premises, so the conclusion must be true, by definition of validity. an example of a sound argument: If a number is greater than 7 it is greater than 3. 8 is greater than 7. Therefore 8 is greater than 3. http://www.iep.utm.edu/val-snd/ 15

Soundness A deductive argument is sound if and only if it is both valid, and all of its premises are actually true. Otherwise, a deductive argument is unsound. Always premises : true therefore conclusion : true http://www.iep.utm.edu/val-snd/ 16

Models and Interpretations First specify a signature Constant Symbols Predicate Symbols Function Symbols Determines the language Given a language A model is specified A domain of discourse a set of entities An interpretation constant assignments function assignments truth value assignments - predicate 17

Satisfiability of a sentence If a sentence s evaluates to True under a given interpretation I I satisfies s; I s A sentence is satisfiable if there is some interpretation under which it is true. 18

Valid Formulas and Sentences A formula is valid if it is satisfied by every interpretation Every tautology is a valid formula A valid sentence: human(john) human(john) A valid sentence: x (human(x) human(x) A valid formula: loves(john, y) loves(john, y) True regardless of which individual in the domain of discourse is assigned to y This formula is true in every interpretation 19

Validity and Satisfiability of Formulas A formula is valid if it is true for all values of its terms. Satisfiability refers to the existence of a combination of values to make the expression true. So in short, a proposition / a formula is satisfiable if there is at least one true result in its truth table, valid if all values it returns in the truth table are true. 20

Contradiction A sentence is a contradiction if there is no interpretation that satisfies it x (human(x) human(x) not satisfiable under any interpretation 21

Well-formed Strings A term A constant symbol A variable symbol A function symbol with comma separated list An atomic formula A predicate symbol A predicate symbol with comma separated list Two terms separated by the = symbol An formula A atomic formula The operator followed by a formula Two formulas separated by,,, A quantifier following by a variable followed by a formula A sentence A formula with no free variables 22

An argument consists of set of formulas, called the premises And a formula called the conclusion The premises entail the conclusion If in every model in which all the premises are true, the conclusion is also true. If the premises entail the conclusion, the argument is sound otherwise, it is a fallacy A set of inference rules : a deductive system A deductive system is sound if it only derives sound arguments A deductive system is complete if it can derive every sound argument 23

Quantifiers Universal Quantifier x for all entity e in the domain of discourse Existential Quantifier x for some entity e in the domain of discourse 24

Instantiation and Generalization Universal Instantiation x A(x) for all entities e in the domain of discourse A(c) for any constant term c Universal Generalization A(e) for every entity e in the domain of discourse x A(x) Existential Instantiation x A(x) A(e) for some entity e in the domain of discourse Existential Generalization A(e) for an entity e in the domain of discourse x A(x) 25

Universal Instantiation x A(x) for all entities x in the domain of discourse A(c) for any constant term c If A(x) has value T for all entities in the domain of discourse, then it must have value T for term t man(john) x man(x) human(x) human(john) man(john) x man(x) human(x) man(john) human(john) human(john) 26

Universal Generalization A(e) for every entity e in the domain of discourse x A(x) If A(e) has value T for every entity e, Then x A(x) has value T The rule is ordinarily applied by showing that A(e) has value T for an arbitrary entity e x (man(x) human(x)) x ( human(x) man(x)) x (man(x) human(x)) man(e) human(e) human(e) man(e) human(e) man(e) x ( human(x) man(x)) Modus Tolens A B B A 27

Existential Instantiation x A(x) A(e) for some entity e in the domain of discourse If x A(x) has value T, then A(e) has value T for some entity e x man(x) x man(x) human(x) x human(x) x man(x) x man(x) human(x) man(e) man(e) human(e) human(e) x human(x) 28

Existential Generalization A(e) for an entity e in the domain of discourse x A(x) If A(e) has value T for some entity e, Then x A(x) has value T man(john) x man(x) human(x) x human(x) man(john) x man(x) human(x) man(john) human(john) human(john) x human(x) 29

Unification Two sentences A and B A unification of A and B A substitution θ of values for some of the variables in A and B that make the sentences identical The set of substitutions θ is called the unifier loves(dave, y) loves(x, Gloria) θ ={x/dave, y/gloria} loves(dave, Gloria) 30

Unification different variable parents(dave, y, z) parents(y, Mary, Sam) rename parents(x, Mary, Sam) θ ={x/dave, y/may, z/sam} parents(dave, Mary, Sam) parents(x, father(x), mother(dave)) parents(dave, father(dave), y) θ ={x/dave, y/mother(dave)} parents(dave, father(dave), mother(dave)) 31

Unifier Instance father(x, Sam) father(y, z) father(dave, Sam) θ ={x/dave, y/dave, z/sam} father(x, Sam) father(y, z) instance θ ={x/y, z/sam} more general unifier father(y, Sam) 32

Most General Unifier If every other unifier θ is an instance of θ in the sense that θ can be derived by making substitutions in θ θ Most General Unifier Instances of θ father(y, Sam) y/dave θ 1 θ 2 θ 3 father(dave, Sam 33

Unification Algorithm Input : Two sentences A and B; an empty set of substitution theta Output : a most general unifier of the sentences if they can be unified; otherwise failure. Procedure unify (A, B, var theta) Scan A and B from left to right Until A and B disagree on a symbol or A and B are exhausted If A and B are exhausted Let x and y be the symbols where A and B disagree If x is a variable Theta = theta U {x/y} unify(subst(theta, A), subst(theta, B), theta) Else if y is a variable Theta = theta U {y/x} unify(subst(theta, A), subst(theta, B), theta) Else Theta = failure; Endif endif 34

Subst Procedure subst Input : a set of substitutions θ and a sentence A Applies the substitutions θ in to A A: parents(dave, y, z) θ = {x/dave, y/mary, z/sam} subst(a, θ) parents(dave, May, Sam) 35

Generalized Modus Ponens Suppose we have sentences A, B, and C, and the the sentence A B, which is implicitly universally quantified for all variables in the sentence. The Generalized Modus Ponens (GMP) rule is as follows A B, C, unify(a, C, θ) subst(b, θ) 36

Modus Ponens 1. mother(mary, Scott) 2. sister(mary, Alice) 3. x y z mother(x,y) sister(x,z) aunt(z,y) 4. mother(mary, Scott) sister(mary, Alic) 5. y z mother(mary,y) sister(mary,z) aunt(z,y) 6. z mother(mary,scott) sister(mary,z) aunt(z,scott) 7. mother(mary,scott) sister(mary,alice) aunt(alice,scott) 8. aunt(alice,scott) 37

Generalized Modus Ponens 1. mother(mary, Scott) 2. sister(mary, Alice) 3. x y z mother(x,y) sister(x,z) aunt(z,y) 4. mother(mary, Scott) sister(mary, Alic) 5. θ = {x/mary, y/scott, z/alice} 6. aunt(alice,scott) 38

Logical Equivalences,,,, 39

References [1] en.wikipedia.org [2] en.wiktionary.org [3] U. Endriss, Lecture Notes : Introduction to Prolog Programming [4] http://www.learnprolognow.org/ Learn Prolog Now! [5] http://www.csupomona.edu/~jrfisher/www/prolog_tutorial [6] www.cse.unsw.edu.au/~billw/cs9414/notes/prolog/intro.html [7] www.cse.unsw.edu.au/~billw/dictionaries/prolog/negation.html [8] http://ilppp.cs.lth.se/, P. Nugues,` An Intro to Lang Processing with Perl and Prolog 40