Topic To Be Covered:
Logic & Inferences
Jagdamba Education Society's
SND College of Engineering & Research Centre
Department of Computer Engineering
SUBJECT: Artificial Intelligence & Robotics
Lecture No-07(UNIT-03)
Logic & Reasoning
Prof.Dhakane Vikas N
Logic & Inferences
What is Logic?
 Logic can be defined as the proof or validation behind any reason
provided.
 It was important to include logic in Artificial Intelligence because
we want our agent (system) to think and act humanly, and for doing
so, it should be capable of taking any decision based on the current
situation.
 If we talk about normal human behavior, then a decision is made by
choosing an option from the various available options. There are
reasons behind selecting or rejecting an option. So, our artificial
agent should also work in this manner.
 Logic is the key behind any knowledge. It allows a person to filter
the necessary information from the bulk and draw a conclusion. In
artificial intelligence, the representation of knowledge is done via
logics
Logic & Inferences
What is Inference?
 In artificial intelligence, we need intelligent agent/computers which
can create new logic from old logic or by evidence, so generating the
conclusions from evidence and facts is termed as Inference.
 Logic is the systematic study of valid rules of inference, i.e. the
relations that lead to the acceptance of one proposition (the
conclusion) on the basis of a set of other propositions (premises).
 Example:
Minor Premise: Every mammal has spine.
Major Premise: Dog is mammal
Conclusion: Dog has Spine
Formal Logic
What is Formal Logic?
 In the logical level, the raw and discrete information which is
present in the knowledge level is encoded into sentences.
 This level uses some formal language to represent the knowledge
the agent has.
 Formal Logic is way of representation of logic :1)Proposition Logic
2) First order logic.
 At the logical level, an encoding of knowledge into logical sentences
occurs
Formal Logic
What is Formal Logic?
 Formal logic is the abstract study of propositions, statements, or
assertively used sentences .
 Proposition is always a declarative/assertive statement which can
be true or false but not both at the same time such as:
Ex: Narendra modi is a prime minister of India.
If He is -Then it is true, otherwise false.
Formal Logic
What is Formal Logic?
 Sentence can be assertive, imperative and interrogative such as:
Ex: Open the door.(Imperative)
Ex: Do you know me? (Interrogative)
These are not proposition but are sentence according to its function.
 Conclusion: Every proposition can be a sentence but every sentence
can never be a proposition.
Formal Logic
What is Formal Logic?
 Definition of Assertive/Declarative Sentence:
 Most of the sentences of English language are assertive sentences.
The sentence which declares or asserts a statement, feeling,
opinion, incident, event, history, or anything is called an assertive
sentence.
 An assertive sentence ends with a period (.). Assertive sentences can
be either affirmative or negative.
 Examples:
 Alex is a good baseball player.
 He plays for the Rockers club.
Formal Logic
 There are two Usable forms of Formal Logic
I] Proposition Logic
II]First Order Logic
Proposition Logic
I] Propositional Logic (PL)
 Propositional logic is an analytical statement which is either true or
false.
 It is basically a technique that represents the knowledge in logical &
mathematical form.
 There are two types of propositional logic; Atomic and Compound
Propositions.
 Propositional logic (PL) is the simplest form of logic where all the
statements are made by propositions.
 A proposition is a declarative statement which is either true or
false.
Proposition Logic
I] Propositional Logic (PL)
Following are some basic facts about propositional logic:
 Propositional logic is also called Boolean logic as it works on 0 and 1.
 In propositional logic, we use symbolic variables to represent the
logic, and we can use any symbol for a representing a proposition,
such A, B, C, P, Q, R, etc.
 Propositions can be either true or false, but it cannot be both.
 Propositional logic consists of an object, relations or function, and
logical connectives.
 These connectives are also called logical operators.
Proposition Logic
I] Propositional Logic (PL)
Facts about Propositional Logic
 The propositions and connectives are the basic elements of the
propositional logic.
 Connectives can be said as a logical operator which connects two
sentences.
 A proposition formula which is always true is called tautology, and
it is also called a valid sentence.
 A proposition formula which is always false is called Contradiction.
 Statements which are questions, commands, are not propositions
such as "Where is Sachin?", "How are you?", "What is your name?",
are not propositions.
Proposition Logic
I] Propositional Logic (PL)
The examples of propositions are-
 7 + 4 = 10
 Apples are black.
 Narendra Modi is president of India.
 Two and two makes 5.
 Delhi is in India.
Here,
All these statements are propositions.
This is because they are either true or false but not both.
Proposition Logic
I] Propositional Logic (PL)
Types of proposition Logic
1. Atomic propositions
2. Compound propositions
1. Atomic Propositions-
 Atomic propositions are the simple propositions. It consists of a
single proposition symbol. These are the sentences which must be
either true or false.
 Example:
 a) 2+2 is 4, it is an atomic proposition as it is a true fact.
 b) "The Sun is cold" is also a proposition as it is a false fact.
Proposition Logic
I] Propositional Logic (PL)
Syntax & Semantics In proposition Logic
2. Compound proposition:
 Compound propositions are constructed by combining simpler or
atomic propositions, using parenthesis and logical connectives.
Example:
a) "It is raining today and street is wet."
b) "Ankit is a doctor and his clinic is in Mumbai."
Proposition Logic
I] Propositional Logic (PL)
Syntax & Semantics In proposition Logic
The syntax of propositional logic defines the allowable sentences for
the knowledge representation.
 Propositional symbols are denoted with capital letters like :A, B,
C….Z
 PL constants have a truth values generally like 0(false) and 1(true)
 PL make use of wrapping parenthesis while writing atomic
sentences. As (…)
Proposition Logic
Syntax & Semantics In proposition Logic
Logical Connectives In PL
 PL makes use of relationship between propositions & it is denoted
by connectives. Following Connectives used in PL
Proposition Logic
Syntax & Semantics In proposition Logic
Truth Table In PL
 To define logical connectives truth table are used.
Proposition Logic
Syntax & Semantics In proposition Logic
Truth Table In PL
 To define logical connectives truth table are used.
 Example: Lets take example , where P^Q i.e. Find the value of P^Q
where P is true and Q is false
Proposition Logic
Semantics In proposition Logic
 World is set of facts which we want to represent to form PL.
 In order to represent this facts propositional symbol can be used
where each propositional symbol interpretation can be mapped to
real world feature.
 Semantics of sentence is meaning of sentence, semantics determine
the interpretation of a sentence.
 Example: You can define semantics of each propositional symbol in
following manner: Considered we tow sentence Like :It is hot &
hum
1. A means “It is True”
2. B means “It is humid”
This sentences are true when its interpretation in the real world is
true.
Ai lecture  07(unit03)
Ai lecture  07(unit03)

Ai lecture 07(unit03)

  • 1.
    Topic To BeCovered: Logic & Inferences Jagdamba Education Society's SND College of Engineering & Research Centre Department of Computer Engineering SUBJECT: Artificial Intelligence & Robotics Lecture No-07(UNIT-03) Logic & Reasoning Prof.Dhakane Vikas N
  • 2.
    Logic & Inferences Whatis Logic?  Logic can be defined as the proof or validation behind any reason provided.  It was important to include logic in Artificial Intelligence because we want our agent (system) to think and act humanly, and for doing so, it should be capable of taking any decision based on the current situation.  If we talk about normal human behavior, then a decision is made by choosing an option from the various available options. There are reasons behind selecting or rejecting an option. So, our artificial agent should also work in this manner.  Logic is the key behind any knowledge. It allows a person to filter the necessary information from the bulk and draw a conclusion. In artificial intelligence, the representation of knowledge is done via logics
  • 3.
    Logic & Inferences Whatis Inference?  In artificial intelligence, we need intelligent agent/computers which can create new logic from old logic or by evidence, so generating the conclusions from evidence and facts is termed as Inference.  Logic is the systematic study of valid rules of inference, i.e. the relations that lead to the acceptance of one proposition (the conclusion) on the basis of a set of other propositions (premises).  Example: Minor Premise: Every mammal has spine. Major Premise: Dog is mammal Conclusion: Dog has Spine
  • 4.
    Formal Logic What isFormal Logic?  In the logical level, the raw and discrete information which is present in the knowledge level is encoded into sentences.  This level uses some formal language to represent the knowledge the agent has.  Formal Logic is way of representation of logic :1)Proposition Logic 2) First order logic.  At the logical level, an encoding of knowledge into logical sentences occurs
  • 5.
    Formal Logic What isFormal Logic?  Formal logic is the abstract study of propositions, statements, or assertively used sentences .  Proposition is always a declarative/assertive statement which can be true or false but not both at the same time such as: Ex: Narendra modi is a prime minister of India. If He is -Then it is true, otherwise false.
  • 6.
    Formal Logic What isFormal Logic?  Sentence can be assertive, imperative and interrogative such as: Ex: Open the door.(Imperative) Ex: Do you know me? (Interrogative) These are not proposition but are sentence according to its function.  Conclusion: Every proposition can be a sentence but every sentence can never be a proposition.
  • 7.
    Formal Logic What isFormal Logic?  Definition of Assertive/Declarative Sentence:  Most of the sentences of English language are assertive sentences. The sentence which declares or asserts a statement, feeling, opinion, incident, event, history, or anything is called an assertive sentence.  An assertive sentence ends with a period (.). Assertive sentences can be either affirmative or negative.  Examples:  Alex is a good baseball player.  He plays for the Rockers club.
  • 8.
    Formal Logic  Thereare two Usable forms of Formal Logic I] Proposition Logic II]First Order Logic
  • 9.
    Proposition Logic I] PropositionalLogic (PL)  Propositional logic is an analytical statement which is either true or false.  It is basically a technique that represents the knowledge in logical & mathematical form.  There are two types of propositional logic; Atomic and Compound Propositions.  Propositional logic (PL) is the simplest form of logic where all the statements are made by propositions.  A proposition is a declarative statement which is either true or false.
  • 10.
    Proposition Logic I] PropositionalLogic (PL) Following are some basic facts about propositional logic:  Propositional logic is also called Boolean logic as it works on 0 and 1.  In propositional logic, we use symbolic variables to represent the logic, and we can use any symbol for a representing a proposition, such A, B, C, P, Q, R, etc.  Propositions can be either true or false, but it cannot be both.  Propositional logic consists of an object, relations or function, and logical connectives.  These connectives are also called logical operators.
  • 11.
    Proposition Logic I] PropositionalLogic (PL) Facts about Propositional Logic  The propositions and connectives are the basic elements of the propositional logic.  Connectives can be said as a logical operator which connects two sentences.  A proposition formula which is always true is called tautology, and it is also called a valid sentence.  A proposition formula which is always false is called Contradiction.  Statements which are questions, commands, are not propositions such as "Where is Sachin?", "How are you?", "What is your name?", are not propositions.
  • 12.
    Proposition Logic I] PropositionalLogic (PL) The examples of propositions are-  7 + 4 = 10  Apples are black.  Narendra Modi is president of India.  Two and two makes 5.  Delhi is in India. Here, All these statements are propositions. This is because they are either true or false but not both.
  • 13.
    Proposition Logic I] PropositionalLogic (PL) Types of proposition Logic 1. Atomic propositions 2. Compound propositions 1. Atomic Propositions-  Atomic propositions are the simple propositions. It consists of a single proposition symbol. These are the sentences which must be either true or false.  Example:  a) 2+2 is 4, it is an atomic proposition as it is a true fact.  b) "The Sun is cold" is also a proposition as it is a false fact.
  • 14.
    Proposition Logic I] PropositionalLogic (PL) Syntax & Semantics In proposition Logic 2. Compound proposition:  Compound propositions are constructed by combining simpler or atomic propositions, using parenthesis and logical connectives. Example: a) "It is raining today and street is wet." b) "Ankit is a doctor and his clinic is in Mumbai."
  • 15.
    Proposition Logic I] PropositionalLogic (PL) Syntax & Semantics In proposition Logic The syntax of propositional logic defines the allowable sentences for the knowledge representation.  Propositional symbols are denoted with capital letters like :A, B, C….Z  PL constants have a truth values generally like 0(false) and 1(true)  PL make use of wrapping parenthesis while writing atomic sentences. As (…)
  • 16.
    Proposition Logic Syntax &Semantics In proposition Logic Logical Connectives In PL  PL makes use of relationship between propositions & it is denoted by connectives. Following Connectives used in PL
  • 17.
    Proposition Logic Syntax &Semantics In proposition Logic Truth Table In PL  To define logical connectives truth table are used.
  • 18.
    Proposition Logic Syntax &Semantics In proposition Logic Truth Table In PL  To define logical connectives truth table are used.  Example: Lets take example , where P^Q i.e. Find the value of P^Q where P is true and Q is false
  • 19.
    Proposition Logic Semantics Inproposition Logic  World is set of facts which we want to represent to form PL.  In order to represent this facts propositional symbol can be used where each propositional symbol interpretation can be mapped to real world feature.  Semantics of sentence is meaning of sentence, semantics determine the interpretation of a sentence.  Example: You can define semantics of each propositional symbol in following manner: Considered we tow sentence Like :It is hot & hum 1. A means “It is True” 2. B means “It is humid” This sentences are true when its interpretation in the real world is true.