Knowledge, Reasoning, and Planning
Knowledge, Reasoning, and Planning
planning
Artificial Intelligence
Knowledge-Based Agent
• Knowledge-Based Agent in Artificial intelligence
• An intelligent agent needs knowledge about the real world for taking
decisions and reasoning to act efficiently.
• Those agents who have the capability of maintaining an internal state of
knowledge, reason over that knowledge, update their knowledge after
observations and take actions.
Methods of Knowledge representation
• Propositional Logic.
• 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. E.g.
• 4+4=8.
• Sun is very hot.
• It is a technique of knowledge representation in logical and mathematical
form.
• First Order Logic.
Propositional logic
• Boolean logic
• it works on 0 and 1
• Propositions can be either true or false, but it cannot be both.
• Symbolic variables
• We can use any symbol for a representing a proposition, such A, B, C, P, Q, R,
etc.
• logical connectives
• AND, OR, NOT etc.
Syntax of Propositional Logic
• Types of Propositions
• 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.
• 2+2 is 4, it is an atomic proposition as it is a true fact.
• "The Sun is cold" is also a proposition as it is a false fact.
• Compound Proposition
• Compound propositions are constructed by combining simpler or atomic propositions,
using parenthesis and logical connectives.
• "It is raining today, and street is wet."
• "Ankit is a doctor, and his clinic is in Mumbai."
Logical Connectives
Connection Symbol Word Technical term Example
¬ Not Negation ¬A
∧ AND Conjunction A∧B
∨ OR Disjunction A∨B
→ Implies Implication A→B
⇔ If and only if Biconditional A⇔B
Logical Connectives
• Negation: “¬” ¬P
“P” is a vaiable
P ¬P
True False
False True
Logical Connectives
• Conjunction: “∧”
• Example: Rohan is intelligent and hardworking. It can be written as,
• P= Rohan is intelligent,
• Q= Rohan is hardworking.
• so we can write it as “P∧ Q”.
P Q P∧Q
True True True
True False False
False True False
False False False
Logical Connectives
• Disjunction: “∨”
• Example: "Ritika is a doctor or Engineer",
• Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P ∨ Q.
P Q P∨Q
True True True
True False True
False True True
False False False
Logical Connectives cont..
• Implication: “→”
• If it is raining, then the street is wet.
• Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
• p → q and ∼p ∨ q are logically equivalent
P Q P→Q ∼p ∨ q
True True True True
True False False False
False True True True
False False True True
Logical Connectives cont..
• Biconditional: “⇔”
• If I am breathing, then I am alive
• P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.
• You can always replace p ↔ q with (p ∧ q) ∨ (∼p ∧ ∼q).
P Q P⇔Q
True True True
True False False
False True False
False False True
Truth table with three propositions
• P ∨ Q → ¬R
Truth table with three propositions
• P ∨ Q → ¬R
Precedence of connectives
Precedence Operators