SlideShare uma empresa Scribd logo
1 de 20
ARTIFICIAL INTELLIGENCE
PANKAJ DEBBARMA
Deptt. of CSE, TIT, Narsingarh
Logic in AI
CONTENTS
Logic
• Logic
• Propositional Logic
• Predicate Logic
• Well-Formed Formula
Logic
Environment
Inference
Engine
Knowledge Base
Learning
(Updating KB)
Output
Input from
Environment
Operations performed by KBA
1. TELL the KB what it perceives from the environment.
2. ASK the KB what action it should perform.
3. PERFORM the selected action.
Logic
We consider three modern roles
for logic in AI:
1) logic as a basis for
computation,
2) logic for learning from a
combination of data and
knowledge, and
3) reasoning about the
behavior of machine learning
systems.
Propositional Logic
• In propositional logic, the most fundamental
propositions are called primitive propositions.
• Primitive propositions cannot be decomposed.
• Propositions that can be decomposed are compound
propositions.
• Primitive propositions can be denoted by some
symbols, and these symbols are called atomic
formulas.
• From atomic formulas we can construct various logic
formulas corresponding to various compound
propositions.
Propositional Logic
• In propositional logic, atomic formulas are propositions,
i.e., assertions such as
A := “Aryabhata is dead.”
B := “Nagpur is on the banks of Nag river.”
C := “Sudoku is fun.”
• Atomic formulas are denoted by capital letters A, B, C, etc.
• Each atomic formula is assigned a truth value: true (1) or
false (0).
• “Propositional logic is not the study of truth, but of the
relationship between the truth of one statement and that
of another.” (Hedman 2004)
Propositional Logic: Symbols
Word Symbol Example Meaning of Example Terminus Technicus
not ¬ ¬A not A negation
and ∧ A ∧ B A and B conjunction
or ∨ A ∨ B A or B disjunction
implies → A → B A implies B implication
if and only if ↔ A ↔ B A if and only if B biconditional
Relationships between propositions
Propositional Logic
The natural language words may have slightly different
meanings.
Example:
A ∧ B and B ∧ A should always have the same meaning.
But the sentences
She became sick and she went to the doctor.
and
She went to the doctor and she became sick.
have totally different meanings.
Propositional Logic: Syntax
formula := atomicFormula | complexFormula
atomicFormula := True | False | symbol
symbol := P | Q | R | . . .
complexFormula := ( ¬ formula ) [negation]
( formula ∧ formula ) [conjunction]
[positive literal] the same as atomicFormula.
[negative literal] ¬ P where P is an atomic formula.
Formulas are also called sentences or propositions.
Propositional Logic: Syntax
formula := atomicFormula | complexFormula
atomicFormula := True | False | symbol
symbol := P | Q | R | . . .
complexFormula := ( ¬ formula ) [negation]
( formula ∧ formula ) [conjunction]
[positive literal] the same as atomicFormula.
[negative literal] ¬ P where P is an atomic formula.
Formulas are also called sentences or propositions.
Propositional Logic: Laws
Implication PQ=¬P∨Q
Equivalence P↔Q=(PQ)∧(QP)
Absorption laws P∧T=P, P∧F=F, P∨T=T, P∨F=P
Involution law ¬(¬P)=P
Idempotent laws P∧P=P, P∨P=P
Complement laws P∧¬P=F , P∨¬P=T
Commutative laws P∧Q=Q∧P, P∨Q=Q∨P
Associative laws (P∧Q)∧R= P∧(Q∧R), (P∨Q)∨R= P ∨(Q ∨ R)
Distributive laws P∧(Q∨R)=(P∧Q)∨(P∧R), P∨(Q∧R)=(P∨Q)∧(P∨R)
De Morgan’s laws ¬(P∧Q)=¬P∨¬Q, ¬(P∨Q)=¬P∧¬Q
Propositional Logic: Disadvantages
Example:
• All students are present in the class.
• Some students are absent in the class.
All ( ∀ ) and Some ( ∃ ) can be represented only
by quantifiers.
Predicate Logic | First Order Logic
Think about expressing these phrases in propositional logic:
A := “Socrates is human.”
B := “All humans are mortal.”
C := “Thus, Socrates is mortal.”
How can we see that A, B, C are related?
First-order logic is richer than propositional logic:
H(a)
∀x H(x)  M(x)
M(a)
where A stands for “Socrates”, H for “is human”, and M for “is mortal”.
Predicate Logic | First Order Logic
H(a)
∀x H(x)  M(x)
M(a)
So what do we have here?
– x is a variable. Variables denote arbitrary elements (objects) of an underlying
set.
– a is a constant. Constants denote specific elements of an underlying set.
– H and M are unary relations.
– ∀ is the all quantifier. It is read “for all”.
– We can also use the connectives we already know from propositional logic.
In first-order logic, there are also relations with other arities, as well as n-ary
functions. In addition to the all quantifier, there is the existential quantifier, read
“there exists”.
Predicate Logic: Symbols
• – Let {f, g, h, . . . , f1, f2, . . .} be the set of function
symbols. Every function symbol has a given arity.
Sometimes we write fn to denote that f has arity n.
• – Let {a, b, c, . . . , a1, a2, . . .} be the set of constant
symbols. Constant symbols can be seen as 0-ary function
symbols.
• – {P, R, S, . . . , P1, P2, . . .} be the set of relation symbols.
Every relation symbol (predicate) has a given arity.
Sometimes we write Pn to denote that P has arity n.
• – {x, y, z, x1, x2, . . .} be the set of variable symbols.
Well-Formed Formula (WFF)
• Propositional logic uses symbolic language
(rules) to represent logical structure
(syntactic).
• A well-formed formula (WFF) is a string of
symbols that is grammatically (syntactically)
correct by virtue of belonging to some
language of interest.
• Which symbolic representations are WFF ?
Well-Formed Formula (WFF)
RULES
1. A any capital letter
2. ~ can be prefixed with NOT (e.g. ~A)
3. A V B letters with connectors between two WFF
Not WFF
1. A~ NOT cannot be suffix
2. ( A ) parenthesis can be used only to connect two
WFF, single is not valid
3. (A · ) connector cannot be suffix
Well-Formed Formula (WFF)
• The capital of India is Naypyitaw.
• Orange is gray.
• x is blue. blue(x)
• x is round. round(x)
∀x blue(x) round(x) Is it WFF ?
• taller(A,B)
• taller(A,B) ∧ taller(B,C)
WFF ?
WFF ?
Well-Formed Formula (WFF)
• If x is a variable representing people in the
world, then
taller(x, Ravi)
∀x taller(x, Ravi)
∃x taller(x, Ravi)
• taller(∃x, Ravi)
• taller(A ∧ B, C)
Is it WFF ?
Is it WFF ?
AI-09 Logic in AI

Mais conteúdo relacionado

Mais procurados

Natural language processing
Natural language processingNatural language processing
Natural language processingYogendra Tamang
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & ReasoningSajid Marwat
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceRamla Sheikh
 
Artificial Intelligence Notes Unit 3
Artificial Intelligence Notes Unit 3Artificial Intelligence Notes Unit 3
Artificial Intelligence Notes Unit 3DigiGurukul
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translationAkshaya Arunan
 
Turing Machine
Turing MachineTuring Machine
Turing MachineRajendran
 
Introduction to Natural Language Processing
Introduction to Natural Language ProcessingIntroduction to Natural Language Processing
Introduction to Natural Language ProcessingPranav Gupta
 
Back propagation
Back propagationBack propagation
Back propagationNagarajan
 
Introduction to Artificial Intelligence
Introduction to Artificial IntelligenceIntroduction to Artificial Intelligence
Introduction to Artificial Intelligenceananth
 
State Space Search in ai
State Space Search in aiState Space Search in ai
State Space Search in aivikas dhakane
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMvikas dhakane
 
Lexical analysis - Compiler Design
Lexical analysis - Compiler DesignLexical analysis - Compiler Design
Lexical analysis - Compiler DesignKuppusamy P
 

Mais procurados (20)

Natural language processing
Natural language processingNatural language processing
Natural language processing
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & Reasoning
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial Intelligence
 
Artificial Intelligence Notes Unit 3
Artificial Intelligence Notes Unit 3Artificial Intelligence Notes Unit 3
Artificial Intelligence Notes Unit 3
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translation
 
5 csp
5 csp5 csp
5 csp
 
Introduction to Compiler design
Introduction to Compiler design Introduction to Compiler design
Introduction to Compiler design
 
NLP
NLPNLP
NLP
 
Structured Knowledge Representation
Structured Knowledge RepresentationStructured Knowledge Representation
Structured Knowledge Representation
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Introduction to Natural Language Processing
Introduction to Natural Language ProcessingIntroduction to Natural Language Processing
Introduction to Natural Language Processing
 
Back propagation
Back propagationBack propagation
Back propagation
 
Eliza
ElizaEliza
Eliza
 
Introduction to Artificial Intelligence
Introduction to Artificial IntelligenceIntroduction to Artificial Intelligence
Introduction to Artificial Intelligence
 
State Space Search in ai
State Space Search in aiState Space Search in ai
State Space Search in ai
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Lexical analysis - Compiler Design
Lexical analysis - Compiler DesignLexical analysis - Compiler Design
Lexical analysis - Compiler Design
 
Uncertainty in AI
Uncertainty in AIUncertainty in AI
Uncertainty in AI
 
Rule Based System
Rule Based SystemRule Based System
Rule Based System
 
supervised learning
supervised learningsupervised learning
supervised learning
 

Semelhante a AI-09 Logic in AI

I am kind of confused about quantifiers. I am not sure how to transl.pdf
I am kind of confused about quantifiers. I am not sure how to transl.pdfI am kind of confused about quantifiers. I am not sure how to transl.pdf
I am kind of confused about quantifiers. I am not sure how to transl.pdfAMITPANCHAL154
 
Ch2 (8).pptx
Ch2 (8).pptxCh2 (8).pptx
Ch2 (8).pptxDeyaHani
 
Introduction of predicate logics
Introduction of predicate  logicsIntroduction of predicate  logics
Introduction of predicate logicschauhankapil
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture NotesFellowBuddy.com
 
First Order Logic
First Order LogicFirst Order Logic
First Order LogicMianMubeen3
 
First order predicate logic(fopl)
First order predicate logic(fopl)First order predicate logic(fopl)
First order predicate logic(fopl)surbhi jha
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)Nitesh Singh
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)SHUBHAM KUMAR GUPTA
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)SURBHI SAROHA
 
Knowledege Representation.pptx
Knowledege Representation.pptxKnowledege Representation.pptx
Knowledege Representation.pptxArslanAliArslanAli
 
predicateLogic.ppt
predicateLogic.pptpredicateLogic.ppt
predicateLogic.pptMUZAMILALI48
 
Artificial intelligence and first order logic
Artificial intelligence and first order logicArtificial intelligence and first order logic
Artificial intelligence and first order logicparsa rafiq
 
Ai lecture 09(unit03)
Ai lecture  09(unit03)Ai lecture  09(unit03)
Ai lecture 09(unit03)vikas dhakane
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAsst.prof M.Gokilavani
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxPriyalMayurManvar
 
INFO-2950-Languages-and-Grammars.ppt
INFO-2950-Languages-and-Grammars.pptINFO-2950-Languages-and-Grammars.ppt
INFO-2950-Languages-and-Grammars.pptLamhotNaibaho3
 

Semelhante a AI-09 Logic in AI (20)

I am kind of confused about quantifiers. I am not sure how to transl.pdf
I am kind of confused about quantifiers. I am not sure how to transl.pdfI am kind of confused about quantifiers. I am not sure how to transl.pdf
I am kind of confused about quantifiers. I am not sure how to transl.pdf
 
Ch2 (8).pptx
Ch2 (8).pptxCh2 (8).pptx
Ch2 (8).pptx
 
Introduction of predicate logics
Introduction of predicate  logicsIntroduction of predicate  logics
Introduction of predicate logics
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture Notes
 
lec3 AI.pptx
lec3  AI.pptxlec3  AI.pptx
lec3 AI.pptx
 
First Order Logic
First Order LogicFirst Order Logic
First Order Logic
 
Knowledge Extraction
Knowledge ExtractionKnowledge Extraction
Knowledge Extraction
 
First order predicate logic(fopl)
First order predicate logic(fopl)First order predicate logic(fopl)
First order predicate logic(fopl)
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 
Propositional logic(part 2)
Propositional logic(part 2)Propositional logic(part 2)
Propositional logic(part 2)
 
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
 
Knowledege Representation.pptx
Knowledege Representation.pptxKnowledege Representation.pptx
Knowledege Representation.pptx
 
predicateLogic.ppt
predicateLogic.pptpredicateLogic.ppt
predicateLogic.ppt
 
Artificial intelligence and first order logic
Artificial intelligence and first order logicArtificial intelligence and first order logic
Artificial intelligence and first order logic
 
Ai lecture 09(unit03)
Ai lecture  09(unit03)Ai lecture  09(unit03)
Ai lecture 09(unit03)
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
 
English for Math Pertemuan ke 11
English for Math Pertemuan ke 11English for Math Pertemuan ke 11
English for Math Pertemuan ke 11
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptx
 
INFO-2950-Languages-and-Grammars.ppt
INFO-2950-Languages-and-Grammars.pptINFO-2950-Languages-and-Grammars.ppt
INFO-2950-Languages-and-Grammars.ppt
 

Mais de Pankaj Debbarma

OS-01 Virtual Memory.pptx
OS-01 Virtual Memory.pptxOS-01 Virtual Memory.pptx
OS-01 Virtual Memory.pptxPankaj Debbarma
 
AI-06 Search Techniques - Informed.pptx
AI-06 Search Techniques - Informed.pptxAI-06 Search Techniques - Informed.pptx
AI-06 Search Techniques - Informed.pptxPankaj Debbarma
 
AI-05 Search Algorithms.pptx
AI-05 Search Algorithms.pptxAI-05 Search Algorithms.pptx
AI-05 Search Algorithms.pptxPankaj Debbarma
 
CP03-Data Structures.pptx
CP03-Data Structures.pptxCP03-Data Structures.pptx
CP03-Data Structures.pptxPankaj Debbarma
 
AI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxAI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxPankaj Debbarma
 
AI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxAI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxPankaj Debbarma
 
CP02-Structure and Union.pptx
CP02-Structure and Union.pptxCP02-Structure and Union.pptx
CP02-Structure and Union.pptxPankaj Debbarma
 
Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Pankaj Debbarma
 
NETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical AddressingNETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical AddressingPankaj Debbarma
 
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTP
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTPTRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTP
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTPPankaj Debbarma
 

Mais de Pankaj Debbarma (17)

OS-02 Segmentation.pptx
OS-02 Segmentation.pptxOS-02 Segmentation.pptx
OS-02 Segmentation.pptx
 
AI-08 Game Playing.pptx
AI-08 Game Playing.pptxAI-08 Game Playing.pptx
AI-08 Game Playing.pptx
 
OS-01 Virtual Memory.pptx
OS-01 Virtual Memory.pptxOS-01 Virtual Memory.pptx
OS-01 Virtual Memory.pptx
 
AI-06 Search Techniques - Informed.pptx
AI-06 Search Techniques - Informed.pptxAI-06 Search Techniques - Informed.pptx
AI-06 Search Techniques - Informed.pptx
 
AI-05 Search Algorithms.pptx
AI-05 Search Algorithms.pptxAI-05 Search Algorithms.pptx
AI-05 Search Algorithms.pptx
 
CP03-Data Structures.pptx
CP03-Data Structures.pptxCP03-Data Structures.pptx
CP03-Data Structures.pptx
 
AI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxAI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptx
 
AI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxAI-03 Problems State Space.pptx
AI-03 Problems State Space.pptx
 
CP02-Structure and Union.pptx
CP02-Structure and Union.pptxCP02-Structure and Union.pptx
CP02-Structure and Union.pptx
 
Intelligent Agents
Intelligent AgentsIntelligent Agents
Intelligent Agents
 
CP01.pptx
CP01.pptxCP01.pptx
CP01.pptx
 
Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06Computer Graphics & Visualization - 06
Computer Graphics & Visualization - 06
 
HTTP and Email
HTTP and EmailHTTP and Email
HTTP and Email
 
Ppt World Wide Web
Ppt World Wide WebPpt World Wide Web
Ppt World Wide Web
 
Ppt congestion control
Ppt congestion controlPpt congestion control
Ppt congestion control
 
NETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical AddressingNETWORK LAYER - Logical Addressing
NETWORK LAYER - Logical Addressing
 
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTP
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTPTRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTP
TRANSPORT LAYER - Process-to-Process Delivery: UDP, TCP and SCTP
 

Último

HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Último (20)

HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 

AI-09 Logic in AI

  • 1. ARTIFICIAL INTELLIGENCE PANKAJ DEBBARMA Deptt. of CSE, TIT, Narsingarh Logic in AI
  • 2. CONTENTS Logic • Logic • Propositional Logic • Predicate Logic • Well-Formed Formula
  • 3. Logic Environment Inference Engine Knowledge Base Learning (Updating KB) Output Input from Environment Operations performed by KBA 1. TELL the KB what it perceives from the environment. 2. ASK the KB what action it should perform. 3. PERFORM the selected action.
  • 4. Logic We consider three modern roles for logic in AI: 1) logic as a basis for computation, 2) logic for learning from a combination of data and knowledge, and 3) reasoning about the behavior of machine learning systems.
  • 5. Propositional Logic • In propositional logic, the most fundamental propositions are called primitive propositions. • Primitive propositions cannot be decomposed. • Propositions that can be decomposed are compound propositions. • Primitive propositions can be denoted by some symbols, and these symbols are called atomic formulas. • From atomic formulas we can construct various logic formulas corresponding to various compound propositions.
  • 6. Propositional Logic • In propositional logic, atomic formulas are propositions, i.e., assertions such as A := “Aryabhata is dead.” B := “Nagpur is on the banks of Nag river.” C := “Sudoku is fun.” • Atomic formulas are denoted by capital letters A, B, C, etc. • Each atomic formula is assigned a truth value: true (1) or false (0). • “Propositional logic is not the study of truth, but of the relationship between the truth of one statement and that of another.” (Hedman 2004)
  • 7. Propositional Logic: Symbols Word Symbol Example Meaning of Example Terminus Technicus not ¬ ¬A not A negation and ∧ A ∧ B A and B conjunction or ∨ A ∨ B A or B disjunction implies → A → B A implies B implication if and only if ↔ A ↔ B A if and only if B biconditional Relationships between propositions
  • 8. Propositional Logic The natural language words may have slightly different meanings. Example: A ∧ B and B ∧ A should always have the same meaning. But the sentences She became sick and she went to the doctor. and She went to the doctor and she became sick. have totally different meanings.
  • 9. Propositional Logic: Syntax formula := atomicFormula | complexFormula atomicFormula := True | False | symbol symbol := P | Q | R | . . . complexFormula := ( ¬ formula ) [negation] ( formula ∧ formula ) [conjunction] [positive literal] the same as atomicFormula. [negative literal] ¬ P where P is an atomic formula. Formulas are also called sentences or propositions.
  • 10. Propositional Logic: Syntax formula := atomicFormula | complexFormula atomicFormula := True | False | symbol symbol := P | Q | R | . . . complexFormula := ( ¬ formula ) [negation] ( formula ∧ formula ) [conjunction] [positive literal] the same as atomicFormula. [negative literal] ¬ P where P is an atomic formula. Formulas are also called sentences or propositions.
  • 11. Propositional Logic: Laws Implication PQ=¬P∨Q Equivalence P↔Q=(PQ)∧(QP) Absorption laws P∧T=P, P∧F=F, P∨T=T, P∨F=P Involution law ¬(¬P)=P Idempotent laws P∧P=P, P∨P=P Complement laws P∧¬P=F , P∨¬P=T Commutative laws P∧Q=Q∧P, P∨Q=Q∨P Associative laws (P∧Q)∧R= P∧(Q∧R), (P∨Q)∨R= P ∨(Q ∨ R) Distributive laws P∧(Q∨R)=(P∧Q)∨(P∧R), P∨(Q∧R)=(P∨Q)∧(P∨R) De Morgan’s laws ¬(P∧Q)=¬P∨¬Q, ¬(P∨Q)=¬P∧¬Q
  • 12. Propositional Logic: Disadvantages Example: • All students are present in the class. • Some students are absent in the class. All ( ∀ ) and Some ( ∃ ) can be represented only by quantifiers.
  • 13. Predicate Logic | First Order Logic Think about expressing these phrases in propositional logic: A := “Socrates is human.” B := “All humans are mortal.” C := “Thus, Socrates is mortal.” How can we see that A, B, C are related? First-order logic is richer than propositional logic: H(a) ∀x H(x)  M(x) M(a) where A stands for “Socrates”, H for “is human”, and M for “is mortal”.
  • 14. Predicate Logic | First Order Logic H(a) ∀x H(x)  M(x) M(a) So what do we have here? – x is a variable. Variables denote arbitrary elements (objects) of an underlying set. – a is a constant. Constants denote specific elements of an underlying set. – H and M are unary relations. – ∀ is the all quantifier. It is read “for all”. – We can also use the connectives we already know from propositional logic. In first-order logic, there are also relations with other arities, as well as n-ary functions. In addition to the all quantifier, there is the existential quantifier, read “there exists”.
  • 15. Predicate Logic: Symbols • – Let {f, g, h, . . . , f1, f2, . . .} be the set of function symbols. Every function symbol has a given arity. Sometimes we write fn to denote that f has arity n. • – Let {a, b, c, . . . , a1, a2, . . .} be the set of constant symbols. Constant symbols can be seen as 0-ary function symbols. • – {P, R, S, . . . , P1, P2, . . .} be the set of relation symbols. Every relation symbol (predicate) has a given arity. Sometimes we write Pn to denote that P has arity n. • – {x, y, z, x1, x2, . . .} be the set of variable symbols.
  • 16. Well-Formed Formula (WFF) • Propositional logic uses symbolic language (rules) to represent logical structure (syntactic). • A well-formed formula (WFF) is a string of symbols that is grammatically (syntactically) correct by virtue of belonging to some language of interest. • Which symbolic representations are WFF ?
  • 17. Well-Formed Formula (WFF) RULES 1. A any capital letter 2. ~ can be prefixed with NOT (e.g. ~A) 3. A V B letters with connectors between two WFF Not WFF 1. A~ NOT cannot be suffix 2. ( A ) parenthesis can be used only to connect two WFF, single is not valid 3. (A · ) connector cannot be suffix
  • 18. Well-Formed Formula (WFF) • The capital of India is Naypyitaw. • Orange is gray. • x is blue. blue(x) • x is round. round(x) ∀x blue(x) round(x) Is it WFF ? • taller(A,B) • taller(A,B) ∧ taller(B,C) WFF ? WFF ?
  • 19. Well-Formed Formula (WFF) • If x is a variable representing people in the world, then taller(x, Ravi) ∀x taller(x, Ravi) ∃x taller(x, Ravi) • taller(∃x, Ravi) • taller(A ∧ B, C) Is it WFF ? Is it WFF ?