Lecture 30 introduction to logic

15
Introduction to Logic Lecture-30 Hema Kashyap 1

Transcript of Lecture 30 introduction to logic

Page 1: Lecture 30 introduction to logic

1

Introduction to LogicLecture-30

Hema Kashyap

Page 2: Lecture 30 introduction to logic

2

Introduction• Logic is the expression given to the reasoning process

performed by mind in the form of symbolic language of a calculus.

• Logic is the language used to represent facts.• The elementary knowledge representation methodologies are:– Representation using binary numbers– Representation as a set of pixels– Representation in graphical form– Representation in propositional logic– Representation in predicate logic– Representation through semantic nets– Representation using conceptual dependency structures.

Page 3: Lecture 30 introduction to logic

3

Introduction• A knowledge representation technique should have

following characteristics:– It should be adequate to express all the necessary information– It should provide natural scheme for expressing the required

knowledge– It should support efficient execution for inferencing purpose.

• Logic is a formal language to represent knowledge and facts. There are two types of logic used in the field of AI:– Propositional logic or propositional calculus– Predicate calculus

Page 4: Lecture 30 introduction to logic

4

Propositional Calculus

• Propositions are statements or sentences and is classified as declarative sentence whose value is either ‘true’ or ‘false’.

• Propositions can be atomic propositions – Ex: New Delhi is the capital of India– The squareroot of 4 is 2.– No, thank you!

• and molecular /complex propositions– Ex: Sachin Tendulkar is a cricketer and Steffi Graf is a

tennis player.

Page 5: Lecture 30 introduction to logic

5

Propositional Calculus

Page 6: Lecture 30 introduction to logic

6

Syntax of propositional Calculus

• Atomic Symbols:

Page 7: Lecture 30 introduction to logic

7

Syntax of propositional Calculus

• Logical Connectives:

Page 8: Lecture 30 introduction to logic

8

Page 9: Lecture 30 introduction to logic

9

Semantics of propositional Calculus• Semantics or the meaning of these sentences or assigning true or false values to

these sentences• The truth value assignment to a propositional sentence is called Interpretation,

which is an assertion about the its truthness.• In simple words, interpretation determines the truth value of a statement. The

interpretation of the truth value for sentences is determined by :

Page 10: Lecture 30 introduction to logic

10

p q ¬p p q∧ p q∨ p ←q p →q p ↔q

true true false true true true true true

true false false false true true false false

false true true false true false true false

false false true false false true true true

Note that we only talk about the truth value in an interpretation. Propositions may have different truth values in different interpretations.

Page 11: Lecture 30 introduction to logic

11

Example

Page 12: Lecture 30 introduction to logic

12

Semantics of Propositional Calculus

• Logical operators define by truth tables

• Conjunction

Page 13: Lecture 30 introduction to logic

13

• Disjunction:

• Implication:

• Biconditional:

Page 14: Lecture 30 introduction to logic

14

• Example : Suppose there are three atoms: ai_is_fun, happy, andlight_on.Suppose interpretation I1 assigns true to ai_is_fun, false to happy, and true to light_on. That is, I1 is defined by the function π1 defined by π1(ai_is_fun)=true, π1(happy)=false, and π1(light_on)=true. Then ai_is_fun is true in I1. ¬ai_is_fun is false in I1. happy is false in I1. ¬happy is true in I1. ai_is_fun happy∨  is true in I1. ai_is_fun ←happy is true in I1. happy ←ai_is_fun is false in I1. ai_is_fun ←happy light_on∧  is true in I1.

Page 15: Lecture 30 introduction to logic

15

• Supposesinterpretation I2 assigns false to ai_is_fun, true to happy, and false to light_on: ai_is_fun is false in I2. ¬ai_is_fun is true in I2. happy is true in I2. ¬happy is false in I2. ai_is_fun happy∨  is true in I2. ai_is_fun ←happy is false in I2. ai_is_fun ←light_on is true in I2. ai_is_fun ←happy light_on∧  is true in I2.