SlideShare a Scribd company logo
1 of 12
Matching and Proof search in Prolog
OVERVIEW Matching Occurs check Programming with matching Proof search Examples
MATCHING The basic idea for a Two terms match is: The two terms are equal or if they contain variables that can be instantiated in such a way that the resulting terms are equal. If term1 and term2 are constants, then term1 and term2 match if and only if they are the same atom, or the same number.
MATCHING If term1 is a variable and term2 is any type of term, then term1 and term2 match and term1 is instantiated to term2.  Similarly, if term2 is a variable and term1 is any type of term, then term1 and term2 match, and term2 is instantiated to term1. If term1 and term2 are complex terms, then they match if and only if: ,[object Object]
b. All their corresponding arguments match
c. and the variable instantiations are compatible.Two terms match if and only if it follows from the previous three clauses that they match.
The occurs check Consider the following query: father(X) = X. ,[object Object],Pick any term and instantiate X to the term you picked.  For ex: if you instantiate X to father(father(butch)), the left hand side becomes father(father(father(butch))), and the right hand side becomes father(father(butch)). Obviously these don't match. SICStus Prolog or SWI returns the answer like: X = father(father(father(father(father(father(...)))))))))) The dots are indicating that there is an infinite nesting of father functors.
Programming with matching Matching plays a key role in Prolog proof search  and this alone makes it vital. Matching can then be used to pull out the information you want. Ex: The following two line knowledge base defines two predicates, namely vertical/2 and horizontal/2, which specify what it means for a line to be vertical or horizontal respectively. vertical(line(point(X,Y),point(X,Z))). horizontal(line(point(X,Y),point(Z,Y))).
The definition of vertical/1 simply says that a line that goes between two points that have the same x-coordinate is vertical. The definition of vertical/1 simply says that a line that goes between two points that have the same x-coordinate is vertical. Ex:  vertical(line(point(1,1),point(1,3))). yes vertical(line(point(1,1),point(3,2))). no
Proof search Consider the following Knowledge Base: f(a). f(b). g(a). g(b). h(b). k(X) :- f(X),g(X),h(X). On posing the query k(X).  Prolog returns k(b)
Proof search Prolog reads the knowledge base, and tries to match k(X) with either a fact, or the head of a rule. It searches the knowledge base top to bottom, and carries out the matching, if it can, at the first place possible.  Here there is only one possibility,  it must match k(X) to the head of the rule: k(X) :- f(X),g(X),h(X).
Examples: the original query now reads k(_G348) and Prolog knows that is: k(_G348) :- f(_G348),g(_G348),h(_G348). The query says: `I want to find an individual that has property k'. The rule says,`an individual has property k if it has properties f, g, and h'. So if Prolog can find an individual with properties f, g, and h, it will have satisfied the original query. So Prolog replaces the original query with the following list of goals: f(_G348),g(_G348),h(_G348).

More Related Content

What's hot

Proof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systemsProof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systemsMarco Benini
 
Discrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicDiscrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicUniversity of Potsdam
 
First order predicate logic(fopl)
First order predicate logic(fopl)First order predicate logic(fopl)
First order predicate logic(fopl)surbhi jha
 
Logic (slides)
Logic (slides)Logic (slides)
Logic (slides)IIUM
 
Discrete mathematics by sadat sumon
Discrete mathematics by sadat sumonDiscrete mathematics by sadat sumon
Discrete mathematics by sadat sumonsadatsumon
 
Boyre Moore Algorithm | Computer Science
Boyre Moore Algorithm | Computer ScienceBoyre Moore Algorithm | Computer Science
Boyre Moore Algorithm | Computer ScienceTransweb Global Inc
 
Boyer moore algorithm
Boyer moore algorithmBoyer moore algorithm
Boyer moore algorithmAYESHA JAVED
 
Discrete Structure
Discrete Structure Discrete Structure
Discrete Structure Syed Umair
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Omnia A. Abdullah
 
Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logicJanet Stemwedel
 
7.6 solving logarithmic equations
7.6 solving logarithmic equations7.6 solving logarithmic equations
7.6 solving logarithmic equationsswartzje
 
Module 6 Mastery
Module 6 MasteryModule 6 Mastery
Module 6 Masterybigerblue
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2Ali Usman
 
Math 150 fall 2020 homework 1 due date friday, october 15,
Math 150 fall 2020 homework 1 due date friday, october 15,Math 150 fall 2020 homework 1 due date friday, october 15,
Math 150 fall 2020 homework 1 due date friday, october 15,MARRY7
 
Logic (PROPOSITIONS)
Logic (PROPOSITIONS)Logic (PROPOSITIONS)
Logic (PROPOSITIONS)D Nayanathara
 

What's hot (20)

Proof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systemsProof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systems
 
Discrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicDiscrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional Logic
 
First order predicate logic(fopl)
First order predicate logic(fopl)First order predicate logic(fopl)
First order predicate logic(fopl)
 
Logic (slides)
Logic (slides)Logic (slides)
Logic (slides)
 
Discrete mathematics by sadat sumon
Discrete mathematics by sadat sumonDiscrete mathematics by sadat sumon
Discrete mathematics by sadat sumon
 
Presentation Of Analysis
Presentation Of Analysis  Presentation Of Analysis
Presentation Of Analysis
 
Boyre Moore Algorithm | Computer Science
Boyre Moore Algorithm | Computer ScienceBoyre Moore Algorithm | Computer Science
Boyre Moore Algorithm | Computer Science
 
Boyer moore algorithm
Boyer moore algorithmBoyer moore algorithm
Boyer moore algorithm
 
Discrete Structure
Discrete Structure Discrete Structure
Discrete Structure
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters
 
Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logic
 
English for Math Pertemuan ke 11
English for Math Pertemuan ke 11English for Math Pertemuan ke 11
English for Math Pertemuan ke 11
 
Propositional Logic and Pridicate logic
Propositional Logic and Pridicate logicPropositional Logic and Pridicate logic
Propositional Logic and Pridicate logic
 
7.6 solving logarithmic equations
7.6 solving logarithmic equations7.6 solving logarithmic equations
7.6 solving logarithmic equations
 
Mathematical Logic
Mathematical LogicMathematical Logic
Mathematical Logic
 
Module 6 Mastery
Module 6 MasteryModule 6 Mastery
Module 6 Mastery
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2
 
MarkDrachMeinelThesisFinal
MarkDrachMeinelThesisFinalMarkDrachMeinelThesisFinal
MarkDrachMeinelThesisFinal
 
Math 150 fall 2020 homework 1 due date friday, october 15,
Math 150 fall 2020 homework 1 due date friday, october 15,Math 150 fall 2020 homework 1 due date friday, october 15,
Math 150 fall 2020 homework 1 due date friday, october 15,
 
Logic (PROPOSITIONS)
Logic (PROPOSITIONS)Logic (PROPOSITIONS)
Logic (PROPOSITIONS)
 

Similar to PROLOG: Matching And Proof Search In Prolog

Knowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and ReasoningKnowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and ReasoningSagacious IT Solution
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicPalGov
 
Propositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logicPropositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logicpendragon6626
 
Novel analysis of transition probabilities in randomized k sat algorithm
Novel analysis of transition probabilities in randomized k sat algorithmNovel analysis of transition probabilities in randomized k sat algorithm
Novel analysis of transition probabilities in randomized k sat algorithmijfcstjournal
 
AI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptxAI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptxAsst.prof M.Gokilavani
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdfsmarwaneid
 
The h-Integrability and the Weak Laws of Large Numbers for Arrays
The h-Integrability and the Weak Laws of Large Numbers for ArraysThe h-Integrability and the Weak Laws of Large Numbers for Arrays
The h-Integrability and the Weak Laws of Large Numbers for ArraysCrescent University Abeokuta
 
The law of non-contradiction in the combined calculus of sentences, situation...
The law of non-contradiction in the combined calculus of sentences, situation...The law of non-contradiction in the combined calculus of sentences, situation...
The law of non-contradiction in the combined calculus of sentences, situation...Victor Gorbatov
 
Using Mathematical Foundations To Study The Equivalence Between Mass And Ener...
Using Mathematical Foundations To Study The Equivalence Between Mass And Ener...Using Mathematical Foundations To Study The Equivalence Between Mass And Ener...
Using Mathematical Foundations To Study The Equivalence Between Mass And Ener...QUESTJOURNAL
 
Some Operation Equation and Applications
Some Operation Equation and ApplicationsSome Operation Equation and Applications
Some Operation Equation and ApplicationsIJMER
 
1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.pptTejasAditya2
 
Discreate structure presentation introduction
Discreate structure presentation introductionDiscreate structure presentation introduction
Discreate structure presentation introductionyashirraza123
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)SHUBHAM KUMAR GUPTA
 

Similar to PROLOG: Matching And Proof Search In Prolog (20)

Knowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and ReasoningKnowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and Reasoning
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
 
Propositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logicPropositional logic is a good vehicle to introduce basic properties of logic
Propositional logic is a good vehicle to introduce basic properties of logic
 
Novel analysis of transition probabilities in randomized k sat algorithm
Novel analysis of transition probabilities in randomized k sat algorithmNovel analysis of transition probabilities in randomized k sat algorithm
Novel analysis of transition probabilities in randomized k sat algorithm
 
AI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptxAI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptx
 
eatonmuirheadsoaita
eatonmuirheadsoaitaeatonmuirheadsoaita
eatonmuirheadsoaita
 
DM(1).pptx
DM(1).pptxDM(1).pptx
DM(1).pptx
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
 
AI Lab Manual.docx
AI Lab Manual.docxAI Lab Manual.docx
AI Lab Manual.docx
 
The h-Integrability and the Weak Laws of Large Numbers for Arrays
The h-Integrability and the Weak Laws of Large Numbers for ArraysThe h-Integrability and the Weak Laws of Large Numbers for Arrays
The h-Integrability and the Weak Laws of Large Numbers for Arrays
 
01bkb04p.ppt
01bkb04p.ppt01bkb04p.ppt
01bkb04p.ppt
 
The law of non-contradiction in the combined calculus of sentences, situation...
The law of non-contradiction in the combined calculus of sentences, situation...The law of non-contradiction in the combined calculus of sentences, situation...
The law of non-contradiction in the combined calculus of sentences, situation...
 
Using Mathematical Foundations To Study The Equivalence Between Mass And Ener...
Using Mathematical Foundations To Study The Equivalence Between Mass And Ener...Using Mathematical Foundations To Study The Equivalence Between Mass And Ener...
Using Mathematical Foundations To Study The Equivalence Between Mass And Ener...
 
Some Operation Equation and Applications
Some Operation Equation and ApplicationsSome Operation Equation and Applications
Some Operation Equation and Applications
 
Canonical correlation
Canonical correlationCanonical correlation
Canonical correlation
 
Predicates
PredicatesPredicates
Predicates
 
1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt
 
Discreate structure presentation introduction
Discreate structure presentation introductionDiscreate structure presentation introduction
Discreate structure presentation introduction
 
Logic
LogicLogic
Logic
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 

More from PROLOG CONTENT

PROLOG: Fact Roles And Queries In Prolog
PROLOG: Fact Roles And Queries In PrologPROLOG: Fact Roles And Queries In Prolog
PROLOG: Fact Roles And Queries In PrologPROLOG CONTENT
 
PROLOG: Database Manipulation In Prolog
PROLOG: Database Manipulation In PrologPROLOG: Database Manipulation In Prolog
PROLOG: Database Manipulation In PrologPROLOG CONTENT
 
Prolog: Cuts And Negation In Prolog
Prolog: Cuts And Negation In PrologProlog: Cuts And Negation In Prolog
Prolog: Cuts And Negation In PrologPROLOG CONTENT
 
PROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In PrologPROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In PrologPROLOG CONTENT
 
Prolog: Arithmetic Operations In Prolog
Prolog: Arithmetic Operations In PrologProlog: Arithmetic Operations In Prolog
Prolog: Arithmetic Operations In PrologPROLOG CONTENT
 
PROLOG: Recursion And Lists In Prolog
PROLOG: Recursion And Lists In PrologPROLOG: Recursion And Lists In Prolog
PROLOG: Recursion And Lists In PrologPROLOG CONTENT
 

More from PROLOG CONTENT (6)

PROLOG: Fact Roles And Queries In Prolog
PROLOG: Fact Roles And Queries In PrologPROLOG: Fact Roles And Queries In Prolog
PROLOG: Fact Roles And Queries In Prolog
 
PROLOG: Database Manipulation In Prolog
PROLOG: Database Manipulation In PrologPROLOG: Database Manipulation In Prolog
PROLOG: Database Manipulation In Prolog
 
Prolog: Cuts And Negation In Prolog
Prolog: Cuts And Negation In PrologProlog: Cuts And Negation In Prolog
Prolog: Cuts And Negation In Prolog
 
PROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In PrologPROLOG: Clauses Grammer In Prolog
PROLOG: Clauses Grammer In Prolog
 
Prolog: Arithmetic Operations In Prolog
Prolog: Arithmetic Operations In PrologProlog: Arithmetic Operations In Prolog
Prolog: Arithmetic Operations In Prolog
 
PROLOG: Recursion And Lists In Prolog
PROLOG: Recursion And Lists In PrologPROLOG: Recursion And Lists In Prolog
PROLOG: Recursion And Lists In Prolog
 

Recently uploaded

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Recently uploaded (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

PROLOG: Matching And Proof Search In Prolog

  • 1. Matching and Proof search in Prolog
  • 2. OVERVIEW Matching Occurs check Programming with matching Proof search Examples
  • 3. MATCHING The basic idea for a Two terms match is: The two terms are equal or if they contain variables that can be instantiated in such a way that the resulting terms are equal. If term1 and term2 are constants, then term1 and term2 match if and only if they are the same atom, or the same number.
  • 4.
  • 5. b. All their corresponding arguments match
  • 6. c. and the variable instantiations are compatible.Two terms match if and only if it follows from the previous three clauses that they match.
  • 7.
  • 8. Programming with matching Matching plays a key role in Prolog proof search and this alone makes it vital. Matching can then be used to pull out the information you want. Ex: The following two line knowledge base defines two predicates, namely vertical/2 and horizontal/2, which specify what it means for a line to be vertical or horizontal respectively. vertical(line(point(X,Y),point(X,Z))). horizontal(line(point(X,Y),point(Z,Y))).
  • 9. The definition of vertical/1 simply says that a line that goes between two points that have the same x-coordinate is vertical. The definition of vertical/1 simply says that a line that goes between two points that have the same x-coordinate is vertical. Ex: vertical(line(point(1,1),point(1,3))). yes vertical(line(point(1,1),point(3,2))). no
  • 10. Proof search Consider the following Knowledge Base: f(a). f(b). g(a). g(b). h(b). k(X) :- f(X),g(X),h(X). On posing the query k(X).  Prolog returns k(b)
  • 11. Proof search Prolog reads the knowledge base, and tries to match k(X) with either a fact, or the head of a rule. It searches the knowledge base top to bottom, and carries out the matching, if it can, at the first place possible. Here there is only one possibility, it must match k(X) to the head of the rule: k(X) :- f(X),g(X),h(X).
  • 12. Examples: the original query now reads k(_G348) and Prolog knows that is: k(_G348) :- f(_G348),g(_G348),h(_G348). The query says: `I want to find an individual that has property k'. The rule says,`an individual has property k if it has properties f, g, and h'. So if Prolog can find an individual with properties f, g, and h, it will have satisfied the original query. So Prolog replaces the original query with the following list of goals: f(_G348),g(_G348),h(_G348).
  • 13. Graphical representation X= _G348 K(x) f(_G348), g(_G348), h(_G348)
  • 14. Visit more self help tutorials Pick a tutorial of your choice and browse through it at your own pace. The tutorials section is free, self-guiding and will not involve any additional support. Visit us at www.dataminingtools.net