SlideShare a Scribd company logo
Introduction to PROLOG
ARTIFICIAL
INTELLIGENCE
SACHIN
B.TECH
SEC.B
16204
Introduction
PROgramming in LOGic
Prolog focuses on describing facts and relationships about
problems rather then on creating a series of steps to solve that
problem.
 Emphasis on what rather than how
It is widely used in the field of AI
Basic Machine
Logic Machine
Problem in Declarative Form
FACTS
 Facts are statements about what is true about a
problem, instead of instructions how to
accomplish the solution.
 The Prolog system uses the facts to work out
how to accomplish the solution by searching
through the space of possible solutions.
 It is defined by an identifier followed by an n-
tuple of constants.
 A relation identifier is referred to as a predicate.
Syntax for fact declaration
 Names of relationship and objects must begin
with a lower-case letter.
 Relationship is written first (typically the
predicate of the sentence).
 Objects are written separated by commas and
are enclosed by a pair of round brackets.
 The full stop character ‘.’ must come at the end
of a fact.
facts
Predicate Interpretation
valuable(gold) Gold is valuable.
owns(john, gold) John owns gold.
father(john ,mary) John is the father of
Mary
gives (john, book , mary) John gives the book to
Mary
Examples
RULES
 Rules are used when you want to say that a
fact depends on a group of facts.
 Rule consist of a head and a body
connected by the symbol :- (IF)
eg. Likes(john, X) :- likes(X, wine).
[ Head is satisfied if body is satisfied ]
Here john likes every person who likes wine.
Syntax of rule
 <head> :- <body>
 Read ‘:-’ as ‘if’.
 likes(john,X) :- likes(X,cricket).
 “John likes X if X likes cricket”.
 i.e., “John likes anyone who likes cricket”.
 Rules always end with ‘.’
Variables
Always begin with a capital letter
 ?- likes (john, X).
 ?- likes (john, Something).
An instantiated variable is one that stands for an object. 
 A variable begins with an uppercase letter or _ and can
contain the same symbols as atoms. 
The same variable name used in 2 different questions
represents 2 completely different variables.
 An uninstantiated variable can be used to search for any
match.
Example
 Facts: ()
 likes(john,mary).
 likes(john,X). % Variables begin with capital
 Queries
 ?- likes(X,Y).
 X=john, Y=Mary. % hit “;” for more
 ?- likes(X,X).
 X=john.
Example
 Rules
 likes(john,X) :- likes(X,wine). % :- = if
 likes(john,X):- female(X), likes(X,john).
 Query: ? - likes(john,Y).
 Y = bill ;
 no
Conjunction & Disjunction
 Conjunction of predicates is represented as a
sequence of structures, separated by commas”,”.
 It is referred as “AND”
sister_of (X,Y):- female (X), parents (X, M, F),
 Disjunction of predicates is represented as a
sequence of structures, separated by semicolon”;”.
 It is referred as “OR”
friend(ram,shyam):-
friend(shyam,sita);friend(shyam,mohan).
THANK YOU

More Related Content

What's hot

Artificial intelligence Prolog Language
Artificial intelligence Prolog LanguageArtificial intelligence Prolog Language
Artificial intelligence Prolog Language
REHMAT ULLAH
 
Concept learning and candidate elimination algorithm
Concept learning and candidate elimination algorithmConcept learning and candidate elimination algorithm
Concept learning and candidate elimination algorithm
swapnac12
 
Introduction to Programming in LISP
Introduction to Programming in LISPIntroduction to Programming in LISP
Introduction to Programming in LISP
Knoldus Inc.
 
ProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) IntroductionProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) Introduction
wahab khan
 
Knowledge Engineering in FOL.
Knowledge Engineering in FOL.Knowledge Engineering in FOL.
Knowledge Engineering in FOL.
Megha Sharma
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
blaircomp2003
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AI
Megha Sharma
 
Inference in First-Order Logic
Inference in First-Order Logic Inference in First-Order Logic
Inference in First-Order Logic
Junya Tanaka
 
Predicates and quantifiers presentation topics
Predicates  and quantifiers  presentation topicsPredicates  and quantifiers  presentation topics
Predicates and quantifiers presentation topics
R.h. Himel
 
Introduction to Prolog
Introduction to PrologIntroduction to Prolog
Introduction to Prolog
Chamath Sajeewa
 
Introduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in LogicIntroduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in Logic
Vishal Tandel
 
Predicate Logic
Predicate LogicPredicate Logic
Predicate Logic
giki67
 
If else statement in c++
If else statement in c++If else statement in c++
If else statement in c++
Bishal Sharma
 
Parsing
ParsingParsing
Classical Planning
Classical PlanningClassical Planning
Classical Planning
ahmad bassiouny
 
Predicates and quantifiers
Predicates and quantifiersPredicates and quantifiers
Predicates and quantifiers
Istiak Ahmed
 
CMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of FunctionsCMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of Functions
allyn joy calcaben
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
DataminingTools Inc
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
Amar Jukuntla
 

What's hot (20)

Artificial intelligence Prolog Language
Artificial intelligence Prolog LanguageArtificial intelligence Prolog Language
Artificial intelligence Prolog Language
 
Concept learning and candidate elimination algorithm
Concept learning and candidate elimination algorithmConcept learning and candidate elimination algorithm
Concept learning and candidate elimination algorithm
 
Introduction to Programming in LISP
Introduction to Programming in LISPIntroduction to Programming in LISP
Introduction to Programming in LISP
 
ProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) IntroductionProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) Introduction
 
Knowledge Engineering in FOL.
Knowledge Engineering in FOL.Knowledge Engineering in FOL.
Knowledge Engineering in FOL.
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AI
 
Inference in First-Order Logic
Inference in First-Order Logic Inference in First-Order Logic
Inference in First-Order Logic
 
Predicates and quantifiers presentation topics
Predicates  and quantifiers  presentation topicsPredicates  and quantifiers  presentation topics
Predicates and quantifiers presentation topics
 
Introduction to Prolog
Introduction to PrologIntroduction to Prolog
Introduction to Prolog
 
First order logic
First order logicFirst order logic
First order logic
 
Introduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in LogicIntroduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in Logic
 
Predicate Logic
Predicate LogicPredicate Logic
Predicate Logic
 
If else statement in c++
If else statement in c++If else statement in c++
If else statement in c++
 
Parsing
ParsingParsing
Parsing
 
Classical Planning
Classical PlanningClassical Planning
Classical Planning
 
Predicates and quantifiers
Predicates and quantifiersPredicates and quantifiers
Predicates and quantifiers
 
CMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of FunctionsCMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of Functions
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
 

Viewers also liked

Web06 Semantic Web: Ontologii OWL
Web06 Semantic Web: Ontologii OWLWeb06 Semantic Web: Ontologii OWL
Web06 Semantic Web: Ontologii OWL
Sabin Buraga
 
Issues in knowledge representation
Issues in knowledge representationIssues in knowledge representation
Issues in knowledge representationSravanthi Emani
 
Introduction to grammar.ppt
Introduction to grammar.pptIntroduction to grammar.ppt
Introduction to grammar.ppt
wiziq
 
Facebook Timeline Tutorial by Leapdog
Facebook Timeline Tutorial by Leapdog Facebook Timeline Tutorial by Leapdog
Facebook Timeline Tutorial by Leapdog
Leapdog Marketing Inc
 
Facebook privacy setting
Facebook privacy settingFacebook privacy setting
Facebook privacy setting
Jia Wen
 
Facebook Privacy Setting Tutorial
Facebook Privacy Setting Tutorial Facebook Privacy Setting Tutorial
Facebook Privacy Setting Tutorial
KARMUN1295
 
PilotLabs IBS - Facebook analysis rankings
PilotLabs IBS - Facebook analysis rankingsPilotLabs IBS - Facebook analysis rankings
PilotLabs IBS - Facebook analysis rankingsBjorn M
 
Facebook tutorial
Facebook tutorialFacebook tutorial
Facebook tutorial
Alexis Wheat
 
Creating facebook page tutorial 2014
Creating facebook page tutorial 2014 Creating facebook page tutorial 2014
Creating facebook page tutorial 2014
Jaymar Villamor
 
Facebook tutorial
Facebook tutorialFacebook tutorial
Facebook tutorial
KFCPRB
 
Tutorial on twitter in the lmc
Tutorial on twitter in the lmcTutorial on twitter in the lmc
Tutorial on twitter in the lmcmicheleobrien
 
Facebook Tutorial
Facebook TutorialFacebook Tutorial
Facebook Tutorial
Queens Library
 
Facebook Usage Stats
Facebook Usage StatsFacebook Usage Stats
Facebook Usage Stats
Neiman Outlen
 
Facebook 101 personal usage
Facebook 101 personal usageFacebook 101 personal usage
Facebook 101 personal usage
Kristi Kirkland
 
Infographic: UK social media usage - Facebook
Infographic: UK social media usage - FacebookInfographic: UK social media usage - Facebook
Infographic: UK social media usage - Facebook
Harris Interactive UK
 
Facebook Tutorial Video
Facebook Tutorial VideoFacebook Tutorial Video
Facebook Tutorial VideoMaggie Ansell
 
Conversion Tracking Tutorial
Conversion Tracking TutorialConversion Tracking Tutorial
Conversion Tracking TutorialNick ONeill
 
Facebook Privacy Settings Tutorial (2015)
Facebook Privacy Settings Tutorial (2015)Facebook Privacy Settings Tutorial (2015)
Facebook Privacy Settings Tutorial (2015)
cwjun94
 

Viewers also liked (18)

Web06 Semantic Web: Ontologii OWL
Web06 Semantic Web: Ontologii OWLWeb06 Semantic Web: Ontologii OWL
Web06 Semantic Web: Ontologii OWL
 
Issues in knowledge representation
Issues in knowledge representationIssues in knowledge representation
Issues in knowledge representation
 
Introduction to grammar.ppt
Introduction to grammar.pptIntroduction to grammar.ppt
Introduction to grammar.ppt
 
Facebook Timeline Tutorial by Leapdog
Facebook Timeline Tutorial by Leapdog Facebook Timeline Tutorial by Leapdog
Facebook Timeline Tutorial by Leapdog
 
Facebook privacy setting
Facebook privacy settingFacebook privacy setting
Facebook privacy setting
 
Facebook Privacy Setting Tutorial
Facebook Privacy Setting Tutorial Facebook Privacy Setting Tutorial
Facebook Privacy Setting Tutorial
 
PilotLabs IBS - Facebook analysis rankings
PilotLabs IBS - Facebook analysis rankingsPilotLabs IBS - Facebook analysis rankings
PilotLabs IBS - Facebook analysis rankings
 
Facebook tutorial
Facebook tutorialFacebook tutorial
Facebook tutorial
 
Creating facebook page tutorial 2014
Creating facebook page tutorial 2014 Creating facebook page tutorial 2014
Creating facebook page tutorial 2014
 
Facebook tutorial
Facebook tutorialFacebook tutorial
Facebook tutorial
 
Tutorial on twitter in the lmc
Tutorial on twitter in the lmcTutorial on twitter in the lmc
Tutorial on twitter in the lmc
 
Facebook Tutorial
Facebook TutorialFacebook Tutorial
Facebook Tutorial
 
Facebook Usage Stats
Facebook Usage StatsFacebook Usage Stats
Facebook Usage Stats
 
Facebook 101 personal usage
Facebook 101 personal usageFacebook 101 personal usage
Facebook 101 personal usage
 
Infographic: UK social media usage - Facebook
Infographic: UK social media usage - FacebookInfographic: UK social media usage - Facebook
Infographic: UK social media usage - Facebook
 
Facebook Tutorial Video
Facebook Tutorial VideoFacebook Tutorial Video
Facebook Tutorial Video
 
Conversion Tracking Tutorial
Conversion Tracking TutorialConversion Tracking Tutorial
Conversion Tracking Tutorial
 
Facebook Privacy Settings Tutorial (2015)
Facebook Privacy Settings Tutorial (2015)Facebook Privacy Settings Tutorial (2015)
Facebook Privacy Settings Tutorial (2015)
 

Similar to prolog ppt

Prolog fundamentals for beeginers in windows.ppt
Prolog  fundamentals for beeginers in windows.pptProlog  fundamentals for beeginers in windows.ppt
Prolog fundamentals for beeginers in windows.ppt
DrBhagirathPrajapati
 
AI Lab Manual.docx
AI Lab Manual.docxAI Lab Manual.docx
AI Lab Manual.docx
KPRevathiAsstprofITD
 
Prolog
PrologProlog
Prolog
Ajay Singh
 
Prolog PPT_merged.pdf
Prolog PPT_merged.pdfProlog PPT_merged.pdf
Prolog PPT_merged.pdf
20CE112YASHPATEL
 
First order logic in artificial Intelligence.pptx
First order logic in artificial Intelligence.pptxFirst order logic in artificial Intelligence.pptx
First order logic in artificial Intelligence.pptx
Y21IT051
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)Nitesh Singh
 
lect14-semantics.ppt
lect14-semantics.pptlect14-semantics.ppt
lect14-semantics.ppt
RichardBobisSanAnton
 
Chaps 1-3-ai-prolog
Chaps 1-3-ai-prologChaps 1-3-ai-prolog
Chaps 1-3-ai-prolog
saru40
 
Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.
James Curran
 
Theory of first order logic
Theory of first order logicTheory of first order logic
Theory of first order logic
Devaddd
 
UOS-BSIT-3811-Artificial-Intelligence-Introduction-to-prolog-PDF.pptx
UOS-BSIT-3811-Artificial-Intelligence-Introduction-to-prolog-PDF.pptxUOS-BSIT-3811-Artificial-Intelligence-Introduction-to-prolog-PDF.pptx
UOS-BSIT-3811-Artificial-Intelligence-Introduction-to-prolog-PDF.pptx
qasim ali
 
Trie Data Structure
Trie Data Structure Trie Data Structure
Trie Data Structure
Hitesh Mohapatra
 
Majorfinal
MajorfinalMajorfinal
Majorfinal
Ankit Agarwal
 
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
AnkitaVerma776806
 
Lec 3.pdf
Lec 3.pdfLec 3.pdf
Lec 3.pdf
ZainabShahzad9
 
Erlang Concurrency
Erlang ConcurrencyErlang Concurrency
Erlang Concurrency
Barry Ezell
 

Similar to prolog ppt (20)

Prolog fundamentals for beeginers in windows.ppt
Prolog  fundamentals for beeginers in windows.pptProlog  fundamentals for beeginers in windows.ppt
Prolog fundamentals for beeginers in windows.ppt
 
01bkb04p.ppt
01bkb04p.ppt01bkb04p.ppt
01bkb04p.ppt
 
AI Lab Manual.docx
AI Lab Manual.docxAI Lab Manual.docx
AI Lab Manual.docx
 
Prolog
PrologProlog
Prolog
 
Prolog PPT_merged.pdf
Prolog PPT_merged.pdfProlog PPT_merged.pdf
Prolog PPT_merged.pdf
 
First order logic in artificial Intelligence.pptx
First order logic in artificial Intelligence.pptxFirst order logic in artificial Intelligence.pptx
First order logic in artificial Intelligence.pptx
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)
 
lect14-semantics.ppt
lect14-semantics.pptlect14-semantics.ppt
lect14-semantics.ppt
 
Chaps 1-3-ai-prolog
Chaps 1-3-ai-prologChaps 1-3-ai-prolog
Chaps 1-3-ai-prolog
 
Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.
 
Hak ontoforum
Hak ontoforumHak ontoforum
Hak ontoforum
 
Fol
FolFol
Fol
 
Theory of first order logic
Theory of first order logicTheory of first order logic
Theory of first order logic
 
UOS-BSIT-3811-Artificial-Intelligence-Introduction-to-prolog-PDF.pptx
UOS-BSIT-3811-Artificial-Intelligence-Introduction-to-prolog-PDF.pptxUOS-BSIT-3811-Artificial-Intelligence-Introduction-to-prolog-PDF.pptx
UOS-BSIT-3811-Artificial-Intelligence-Introduction-to-prolog-PDF.pptx
 
Semantics
SemanticsSemantics
Semantics
 
Trie Data Structure
Trie Data Structure Trie Data Structure
Trie Data Structure
 
Majorfinal
MajorfinalMajorfinal
Majorfinal
 
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
 
Lec 3.pdf
Lec 3.pdfLec 3.pdf
Lec 3.pdf
 
Erlang Concurrency
Erlang ConcurrencyErlang Concurrency
Erlang Concurrency
 

Recently uploaded

road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 

Recently uploaded (20)

road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 

prolog ppt

  • 2. Introduction PROgramming in LOGic Prolog focuses on describing facts and relationships about problems rather then on creating a series of steps to solve that problem.  Emphasis on what rather than how It is widely used in the field of AI Basic Machine Logic Machine Problem in Declarative Form
  • 3. FACTS  Facts are statements about what is true about a problem, instead of instructions how to accomplish the solution.  The Prolog system uses the facts to work out how to accomplish the solution by searching through the space of possible solutions.  It is defined by an identifier followed by an n- tuple of constants.  A relation identifier is referred to as a predicate.
  • 4. Syntax for fact declaration  Names of relationship and objects must begin with a lower-case letter.  Relationship is written first (typically the predicate of the sentence).  Objects are written separated by commas and are enclosed by a pair of round brackets.  The full stop character ‘.’ must come at the end of a fact.
  • 5. facts Predicate Interpretation valuable(gold) Gold is valuable. owns(john, gold) John owns gold. father(john ,mary) John is the father of Mary gives (john, book , mary) John gives the book to Mary Examples
  • 6. RULES  Rules are used when you want to say that a fact depends on a group of facts.  Rule consist of a head and a body connected by the symbol :- (IF) eg. Likes(john, X) :- likes(X, wine). [ Head is satisfied if body is satisfied ] Here john likes every person who likes wine.
  • 7. Syntax of rule  <head> :- <body>  Read ‘:-’ as ‘if’.  likes(john,X) :- likes(X,cricket).  “John likes X if X likes cricket”.  i.e., “John likes anyone who likes cricket”.  Rules always end with ‘.’
  • 8. Variables Always begin with a capital letter  ?- likes (john, X).  ?- likes (john, Something). An instantiated variable is one that stands for an object.   A variable begins with an uppercase letter or _ and can contain the same symbols as atoms.  The same variable name used in 2 different questions represents 2 completely different variables.  An uninstantiated variable can be used to search for any match.
  • 9. Example  Facts: ()  likes(john,mary).  likes(john,X). % Variables begin with capital  Queries  ?- likes(X,Y).  X=john, Y=Mary. % hit “;” for more  ?- likes(X,X).  X=john.
  • 10. Example  Rules  likes(john,X) :- likes(X,wine). % :- = if  likes(john,X):- female(X), likes(X,john).  Query: ? - likes(john,Y).  Y = bill ;  no
  • 11. Conjunction & Disjunction  Conjunction of predicates is represented as a sequence of structures, separated by commas”,”.  It is referred as “AND” sister_of (X,Y):- female (X), parents (X, M, F),  Disjunction of predicates is represented as a sequence of structures, separated by semicolon”;”.  It is referred as “OR” friend(ram,shyam):- friend(shyam,sita);friend(shyam,mohan).