ARTIFICIAL INTELLIGENCE

Similar documents
Discrete Mathematics and Applications COT3100

Propositional logic ( ): Review from Mat 1348

ICS141: Discrete Mathematics for Computer Science I

DISCRETE STRUCTURES WEEK5 LECTURE1

Compound Propositions

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

Section 1.1 Propositional Logic. proposition : true = T (or 1) or false = F (or 0) (binary logic) the moon is made of green cheese

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Introduction Propositional Logic. Discrete Mathematics Andrei Bulatov

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Overview. 1. Introduction to Propositional Logic. 2. Operations on Propositions. 3. Truth Tables. 4. Translating Sentences into Logical Expressions

The Fundamentals of Logic. Foundations of Logic. Foundations of Logic. CMSC 302 Propositional Logic. In Rosen, ~98 slides, ~3 lectures

A statement is a sentence that is definitely either true or false but not both.

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

Boolean Logic. CS 231 Dianna Xu

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Note: The area of logic that deals with propositions is called the propositional calculus or propositional logic.

Propositional Logic 1

Discrete Structures of Computer Science Propositional Logic I

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

Introduction. Applications of discrete mathematics:

Sec$on Summary. Propositions Connectives. Truth Tables. Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional

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

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

Logic. Propositional Logic: Syntax

Logic. Def. A Proposition is a statement that is either true or false.

UNIT-I: Propositional Logic

15414/614 Optional Lecture 1: Propositional Logic

2/13/2012. Logic: Truth Tables. CS160 Rosen Chapter 1. Logic?

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

Section 1.1: Logical Form and Logical Equivalence

DISCRETE MATHEMATICS BA202

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies

Logic. Propositional Logic: Syntax. Wffs

Discrete Mathematics

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

1 Propositional Logic

Discrete Structures for Computer Science

CSC Discrete Math I, Spring Propositional Logic

Logic and Proofs. (A brief summary)

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Propositional Logic: Syntax

MAT2345 Discrete Math

Propositional Logic Not Enough

THE LOGIC OF COMPOUND STATEMENTS

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

Numbers that are divisible by 2 are even. The above statement could also be written in other logically equivalent ways, such as:

The Foundations: Logic and Proofs. Part I

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

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

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

Today s Topic: Propositional Logic

Chapter 1 Elementary Logic

Logical reasoning - Can we formalise our thought processes?

ECOM Discrete Mathematics

1 The Foundations. 1.1 Logic. A proposition is a declarative sentence that is either true or false, but not both.

Propositions. Frequently, we will use the word statement instead of proposition.

Chapter 1, Section 1.1 Propositional Logic

Logic and Propositional Calculus

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

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

EECS 1028 M: Discrete Mathematics for Engineers

3.2: Compound Statements and Connective Notes

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

The statement calculus and logic

Propositional Logic. Spring Propositional Logic Spring / 32

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

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

02 Propositional Logic

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

Symbolic Logic 3. For an inference to be deductively valid it is impossible for the conclusion to be false if the premises are true.

CSE 20 DISCRETE MATH. Fall

Logic and Propositional Calculus

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

Foundation of proofs. Jim Hefferon.

Logic and Proofs. (A brief summary)

PROPOSITIONAL CALCULUS

Discrete Mathematics and Its Applications

Proposition logic and argument. CISC2100, Spring 2017 X.Zhang

Where are my glasses?

Chapter 5: Section 5-1 Mathematical Logic

THE LOGIC OF COMPOUND STATEMENTS

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

Introduction to Sets and Logic (MATH 1190)

CSE 240 Logic and Discrete Mathematics

Definition 2. Conjunction of p and q

Logic. Readings: Coppock and Champollion textbook draft, Ch

Discrete Structures for Computer Science

COMP 2600: Formal Methods for Software Engineeing

Lecture 4: Proposition, Connectives and Truth Tables

Logic and Proof. Aiichiro Nakano

Artificial Intelligence. Propositional logic

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide

Chapter 4, Logic using Propositional Calculus Handout

Transcription:

ARTIFICIAL INTELLIGENCE LECTURE # 03 Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 1

Review of Last Lecture Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 2

Today s Lecture Review of last lecture Reasoning Types of Reasoning Logic Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 3

Reasoning Reasoning is the process of deriving logical conclusions from given facts. Durkin defines reasoning as the process of working with knowledge, facts and problem solving strategies to draw conclusions. Throughout this section, you will notice how representing knowledge in a particular way is useful for a particular kind of reasoning. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 4

Deductive reasoning As the name implies, is based on deducing new information from logically related known information. A deductive argument offers assertions that lead automatically to a conclusion, e.g. If there is dry wood, oxygen and a spark, there will be a fire Given: There is dry wood, oxygen and a spark We can deduce: There will be a fire. All men are mortal. Socrates is a man. We can deduce: Socrates is mortal Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 5

Inductive Reasoning Inductive reasoning is based on forming, or inducing a generalization from a limited set of observations, e.g. Observation: All the crows that I have seen in my life are black. Conclusion: All crows are black Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 6

Comparison of deductive and inductive reasoning The inductive reasoning is as follows: By experience, every time I have let a ball go, it falls downwards. Therefore, I conclude that the next time I let a ball go, it will also come down. The deductive reasoning is as follows: I know Newton's Laws. So I conclude that if I let a ball go, it will certainly fall downwards. Thus the essential difference is that inductive reasoning is based on experience, while deductive reasoning is based on rules, hence the latter will always be correct. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 7

Analogical Reasoning Analogical reasoning works by drawing analogies between two situations, looking for similarities and differences, e.g. when you say driving a truck is just like driving a car, by analogy you know that there are some similarities in the driving mechanism, But you also know that there are certain other distinct characteristics of each. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 8

Common-sense Reasoning Common-sense reasoning is an informal form of reasoning that uses rules gained through experience or what we call rules-of-thumb. It operates on heuristic knowledge and heuristic rules. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 9

Non-Monotonic Reasoning Non-Monotonic reasoning is used when the facts of the case are likely to change after some time, e.g. Rule: IF the wind blows THEN the curtains sway When the wind stops blowing, the curtains should sway no longer. However, if we use monotonic reasoning, this would not happen. The fact that the curtains are swaying would be retained even after the wind stopped blowing. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 10

Logic Algebra is a type of formal logic deals with number PROPOSITIONAL LOGIC PREDICATE CALCULUS/LOGIC Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 11

Proposition A proposition (p, q, r, ) is simply a statement (i.e., a declarative sentence) with a definite meaning, having a truth value that s either true (T) or false (F) Normally, a proposition is named e.g. P, Q, R etc. Propositional Logic is the logic of compound statements built from simpler statements using Boolean connectives. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 12

Proposition A proposition is a statement about the world that may be either true or false. Examples of propositions ( properly formed statements ): Ali s car is blue. Seven plus six equals twelve. (7 + 6 = 12) Amjad is Ali s uncle. Each of the sentences is a proposition - not to be broken down into its constituent parts. i. e., we simply assign true, say, to Amjad is Ali s uncle. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 13

Examples of non- propositions Ali s uncle Seven plus four Who s there? (interrogative, question) Just do it! (imperative, command) 1 + 2 (expression with a non-true/false value) Because we cannot assign truth value to them. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 14

Propositional Symbols Propositions are denoted by propositional symbols such as: P, Q, R, S,. Truth symbols are: true (or T), false (or F). Single propositions by themselves are not very interesting. We need to express complex propositions/compound propositions: The book is on the table or it is on the chair. If Socrates is a man then he is mortal. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 15

Propositional Symbols We can use logical connecters such as:...and...or...implies..is equivalent...not [conjunction] [disjunction] [implication / conditional] [biconditional] [negation] Sentences in the propositional calculus are formed from these atomic symbols according to the syntax rules. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 16

Operators / Connectives An operator or connective combines one or more operand expressions into a larger expression. (E.g., + in numeric exprs.) Unary operators take 1 operand (e.g., -3); Binary operators take 2 operands (eg 3 4). Propositional or Boolean operators operate on propositions or truth values instead of on numbers. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 17

The Negation Operator The unary negation operator (NOT) transforms a prop. into its logical negation. E.g. If p = I have brown hair. then p = I do not have brown hair. Truth table for NOT: p T F p F T Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 18

The Conjunction Operator The binary conjunction operator (AND) combines two propositions to form their logical conjunction. E.g. If p= I will have salad for lunch. and q= I will have steak for dinner., then p q= I will have salad for lunch and I will have steak for dinner. Conjunction Truth Table p q p q F F F F T F T F F T T T Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 19

The Disjunction Operator The binary disjunction operator (OR) combines two propositions to form their logical disjunction. Example: p= That car has a bad engine. q= That car has a bad carburetor. p q= Either that car has a bad engine, or that car has a bad carburetor. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 20

The Disjunction Operator Note that p q means that p is true, or q is true, or both are true! So this operation is also called inclusive or, because it includes the possibility that both p and q are true. Disjunction Truth Table p q p q F F F F T T T F T T T T Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 21

Examples Example: BCS AI Class P = Ali is the teacher Q = Saira is the student R= AI is a course teaching in BS P ^ Q = Ali is the teacher and Saira is the student. Q ^ R= Saira is the student and tought AI in BS The book is on the table or it is on the chair. If Socrates is a man then he is mortal. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 22

A Simple Exercise Let p= It rained last night, q= The sprinklers came on last night, r= The lawn was wet this morning. Translate each of the following into English: p q ^ r r p r p q Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 23

The Exclusive Or Operator The binary exclusive-or operator (XOR) combines two propositions to form their logical exclusive or. p = I will earn an A in this course, q = I will drop this course, p q = I will either earn an A for this course, or I will drop it (but not both!) Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 24

Exclusive-Or Truth Table Note that p q means that p is true, or q is true, but not both! This operation is called exclusive or, because it excludes the possibility that both p and q are true. p q p q F F F F T T T F T T T F Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 25

The Implication Operator The implication p q states that p implies q. It is FALSE only in the case that p is TRUE but q is FALSE. E.g., p= I am elected. q= I will lower taxes. p q = If I am elected, then I will lower taxes Its premise or antecedent is p and its conclusion or consequent is q Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 26

Implication Truth Table p q is false only when p is true but q is not true. Examples: p q p q F F T F T T T F F T T T If 1+1=2, then I am richer than Bill Gates. True or False? If the moon is made of green cheese, then I am richer than Bill Gates. True or False? Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 27

The Biconditional Operator The biconditional p q states that p is true if and only if (IFF) q is true. It is TRUE when both p q and q p are TRUE. p = It is raining. q = The home team wins. p q = If and only if it is raining, the home team wins. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 28

Biconditional Truth Table p q means that p and q have the same truth value. Note this truth table is the exact opposite of s! p q means (p q) p q does not imply p and q are true, or cause each other. p q p q F F T F T F T F F T T T Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 29

Truth Table p q p q p q p p q p q p q F F F F T T T T F T F T T T T F T F F T F F F F T T T T F T T T 30

Precedence of Logical Operators Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 31

Precedence of Logical Operators Operator Precedence Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 32

Some Alternative Notations Name: not and or xor implies iff Propositional logic: Boolean algebra: p pq + C/C++/Java (wordwise):! &&!= == C/C++/Java (bitwise): ~ & ^ Logic gates: Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 33

Propositional Calculus Sentences (Syntax) Every propositional symbol and truth symbol is a sentence. e. g., true, P, R. The negation of a sentence is a sentence. e. g., ~P, ~false The conjunction of two sentences is a sentence. e. g., P Q, P Ù Q The disjunction of two sentences is a sentence. e. g., Q Ú R The implication of one sentence for another is a sentence. e. g., P Q The equivalence of two sentences is a sentence e. g., P Ú Q = R Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 34

Exercise Fact 1: Saira likes cakes. = P Fact 2: Saira eats cakes. = Q P Q, P Q, Q, P Q, P Q???????? Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 35

Exercise Fact 1: Saira likes cakes. = P Fact 2: Saira eats cakes. = Q P Q, P Q, Q, P Q, P Q???????? P Q : Saira Likes cakes or eats cakes. P Q : Saira likes cakes and eats cakes. Q : Saira does not eat cakes. P Q: If Saira likes cakes then he eats cakes. P Q:Saira eats cakes if and only if he likes cakes. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 36

Limitations of Propositional logic We Can t describe things in terms of their properties or relationships (very limited expressive power) Propositional logic is declarative Propositional logic is compositional: meaning of B 1,1 P 1,2 is derived from meaning of B 1,1 and of P 1,2 We can t express rules or generalizations If the train is late and there are no taxis, john is late for the meeting If trains are late and there are no taxis, anyone traveling by trains is late for the meeting Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 37

Limitations Propositions can only represent knowledge as complete sentences, e.g. a = the ball s color is blue. Cannot analyze the internal structure of the sentence. No quantifiers are available, e.g. for-all, there-exists Propositional logic provides no framework for proving statements such as: All humans are mortal All women are humans Therefore, all women are mortals This is a limitation in its representational power. Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 38

References Artificial Intelligence: Structures and Strategies for Complex Problem Solving Internet Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 39

End of Lecture Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 40

Puzzle Game A farmer went to market and purchased a fox, a goose, and a bag of beans. On his way home, the farmer came to the bank of a river and hired a boat. But in crossing the river by boat, the farmer could carry only himself and a single one of his purchases - the fox, the goose, or the bag of the beans. If left alone, the fox would eat the goose, and the goose would eat the beans. The farmer's challenge was to carry himself and his purchases to the far bank of the river, leaving each purchase intact. How did he do it? Artificial Intelligence 2012 Lecture 03 Delivered By Zahid Iqbal 41