SlideShare a Scribd company logo
Introduction to Genifer – deduction source code:  deduction.lisp
 
 
 
In my Lisp code variables are denoted by  ?1 ,  ?2 , … etc
First order logic has the following  connectives  and  operators : /(AND)  (OR) ┐ (NOT) -> (IMPLY) ↔ (EQUIVALENCE) For example A -> B is equivalent to (┐A  B) and its truth table is: A B A->B T T   T T F   F F T   T F F   T ( I assume you still remember this stuff... )
Horn form If a bunch of formulae can be written as: A ← B /C /D /… B ← E /F /G /... and if  A  is the  goal  we want to solve: A then we can cross out A and replace it with A, B, C, D, … as the  new   sub-goals  and repeat the process: B, C, D, ..., E, F, G, … This makes solving the goals very efficient (similar to  production systems  in the old days). Formulae written in this form is called the  Horn form and is the basis of the language  Prolog . Genifer's logic is also based on Horn.
* Optional: Some first-order formulae  cannot  be expressed in Horn form. If we want to prove theorems in  full  first-order logic, we need to use a more general algorithm such as  resolution . The general procedure is: 1.  convert all the formulae into  CNF  (conjunctive normal form) 2.  eliminate all  existential quantifiers      by a process called Skolemization  (see next slide) 3.  repeatedly apply the resolution rule to formulae in the KB, until nothing more changes If we restrict resolution to Horn formulae we get  SLD-resolution which is very fast and is the search procedure in Prolog. I think Horn is expressive enough for making a first AGI prototype.
First order logic has 2  quantifiers : Universal : " X  liar(X)    for all X, X is a liar    “Everyone is a liar”. Existential :  X  brother(john, X)    exists X such that X is John's brother The existential quantifier can be eliminated by  Skolemization :  X  brother(john, X) “Exists X such that X is John's bro”   brother(john, f(john)) where f() is called a  Skolem function .  Its purpose is to map X to X's brother. With existential quantifiers eliminated, we can assume all variables are implicitly universally quantified, and omit the  " 's.
When we have a goal to prove... goal G KB knowledge base We try to  fetch  facts and rules from the KB to  satisfy  the goal. eg:  bachelor(john)  ? (defined in  memory.lisp )
[object Object]
This is known as  backward chaining . ,[object Object]
The black links represent “OR” (ie, the goal G can be solved by applying
either  rule1, rule2, rule3, ... etc.
[object Object]
I think  best-first  search may be better, which uses a  priority queue  to  rank  the nodes. Each element in the priority queue points to a tree node.  priority queue
A goal / sub-goal can be satisfied by either  facts   or   rules . example of a fact: bachelor(john) example of a rule: bachelor(?1) ←  male(?1) /single(?1) this is a variable A B
To satisfy a goal, some  variable substitutions  occur. We need to make these 2 terms identical;  this is done by a n algorithm known as  unification . The result of unification is a  set of substitutions , for example: {?1/john, ...}
[object Object]
new  set of substitutions .
Over time, a goal node can acquire

More Related Content

What's hot

Theory of Computation Unit 5
Theory of Computation Unit 5Theory of Computation Unit 5
Theory of Computation Unit 5
Jena Catherine Bel D
 
Admissions in India 2015
Admissions in India 2015Admissions in India 2015
Admissions in India 2015
Edhole.com
 
Theory of Computation Unit 3
Theory of Computation Unit 3Theory of Computation Unit 3
Theory of Computation Unit 3
Jena Catherine Bel D
 
Truth table a.r
Truth table a.rTruth table a.r
Truth table a.r
Syed Umair
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
Sakshi Jaiswal
 
Truth table
Truth tableTruth table
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping LemmaTheory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Rushabh2428
 
Otter 2014-12-15-01-slideshare
Otter 2014-12-15-01-slideshareOtter 2014-12-15-01-slideshare
Otter 2014-12-15-01-slideshareRuo Ando
 
Regular expression
Regular expressionRegular expression
Regular expression
Rajon
 
Processing Regex Python
Processing Regex PythonProcessing Regex Python
Processing Regex Python
primeteacher32
 
Translating English to Propositional Logic
Translating English to Propositional LogicTranslating English to Propositional Logic
Translating English to Propositional LogicJanet Stemwedel
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
Bipul Roy Bpl
 
Per4 function2
Per4 function2Per4 function2
Per4 function2
Evert Sandye Taasiringan
 
Systems of congruence
Systems of congruenceSystems of congruence
Systems of congruence
SreejaRamesh2
 
Adv math[unit 2]
Adv math[unit 2]Adv math[unit 2]
Adv math[unit 2]
Nald Torres
 

What's hot (20)

Theory of Computation Unit 5
Theory of Computation Unit 5Theory of Computation Unit 5
Theory of Computation Unit 5
 
Admissions in India 2015
Admissions in India 2015Admissions in India 2015
Admissions in India 2015
 
Theory of Computation Unit 3
Theory of Computation Unit 3Theory of Computation Unit 3
Theory of Computation Unit 3
 
AI Lesson 16
AI Lesson 16AI Lesson 16
AI Lesson 16
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Truth table a.r
Truth table a.rTruth table a.r
Truth table a.r
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Truth table
Truth tableTruth table
Truth table
 
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping LemmaTheory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
 
Otter 2014-12-15-01-slideshare
Otter 2014-12-15-01-slideshareOtter 2014-12-15-01-slideshare
Otter 2014-12-15-01-slideshare
 
Matlab
MatlabMatlab
Matlab
 
Regular expression
Regular expressionRegular expression
Regular expression
 
Processing Regex Python
Processing Regex PythonProcessing Regex Python
Processing Regex Python
 
Translating English to Propositional Logic
Translating English to Propositional LogicTranslating English to Propositional Logic
Translating English to Propositional Logic
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
 
Per4 function2
Per4 function2Per4 function2
Per4 function2
 
Systems of congruence
Systems of congruenceSystems of congruence
Systems of congruence
 
Logic
LogicLogic
Logic
 
AI Lesson 17
AI Lesson 17AI Lesson 17
AI Lesson 17
 
Adv math[unit 2]
Adv math[unit 2]Adv math[unit 2]
Adv math[unit 2]
 

Similar to introduction to Genifer -- Deduction

Knowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and ReasoningKnowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and Reasoning
Sagacious 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
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
Jay Nagar
 
lect14-semantics.ppt
lect14-semantics.pptlect14-semantics.ppt
lect14-semantics.ppt
RichardBobisSanAnton
 
Algorithm Assignment Help
Algorithm Assignment HelpAlgorithm Assignment Help
Algorithm Assignment Help
Programming Homework Help
 
6.c-CMPS 403-F19-Session 6-Resolution.pdf
6.c-CMPS 403-F19-Session 6-Resolution.pdf6.c-CMPS 403-F19-Session 6-Resolution.pdf
6.c-CMPS 403-F19-Session 6-Resolution.pdf
AmirMohamedNabilSale
 
1004_theorem_proving_2018.pptx on the to
1004_theorem_proving_2018.pptx on the to1004_theorem_proving_2018.pptx on the to
1004_theorem_proving_2018.pptx on the to
fariyaPatel
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
S.Shayan Daneshvar
 
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
pendragon6626
 
constructing_generic_algorithms__ben_deane__cppcon_2020.pdf
constructing_generic_algorithms__ben_deane__cppcon_2020.pdfconstructing_generic_algorithms__ben_deane__cppcon_2020.pdf
constructing_generic_algorithms__ben_deane__cppcon_2020.pdf
SayanSamanta39
 
C2.0 propositional logic
C2.0 propositional logicC2.0 propositional logic
C2.0 propositional logic
Melaku Bayih Demessie
 
Master of Computer Application (MCA) – Semester 4 MC0080
Master of Computer Application (MCA) – Semester 4  MC0080Master of Computer Application (MCA) – Semester 4  MC0080
Master of Computer Application (MCA) – Semester 4 MC0080
Aravind NC
 
Chapter 4 ds
Chapter 4 dsChapter 4 ds
Chapter 4 ds
Hanif Durad
 
MetiTarski: An Automatic Prover for Real-Valued Special Functions
MetiTarski: An Automatic Prover for Real-Valued Special FunctionsMetiTarski: An Automatic Prover for Real-Valued Special Functions
MetiTarski: An Automatic Prover for Real-Valued Special FunctionsLawrence Paulson
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logic
Manjula V
 
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiouvafopoulos
 
Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introductionJarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introductionPalGov
 
Mathematical Statistics Homework Help
Mathematical Statistics Homework HelpMathematical Statistics Homework Help
Mathematical Statistics Homework Help
Statistics Homework Helper
 
Knowledge extraction from support vector machines
Knowledge extraction from support vector machinesKnowledge extraction from support vector machines
Knowledge extraction from support vector machines
Eyad Alshami
 

Similar to introduction to Genifer -- Deduction (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
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
lect14-semantics.ppt
lect14-semantics.pptlect14-semantics.ppt
lect14-semantics.ppt
 
Algorithm Assignment Help
Algorithm Assignment HelpAlgorithm Assignment Help
Algorithm Assignment Help
 
Pnp
PnpPnp
Pnp
 
6.c-CMPS 403-F19-Session 6-Resolution.pdf
6.c-CMPS 403-F19-Session 6-Resolution.pdf6.c-CMPS 403-F19-Session 6-Resolution.pdf
6.c-CMPS 403-F19-Session 6-Resolution.pdf
 
1004_theorem_proving_2018.pptx on the to
1004_theorem_proving_2018.pptx on the to1004_theorem_proving_2018.pptx on the to
1004_theorem_proving_2018.pptx on the to
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
 
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
 
constructing_generic_algorithms__ben_deane__cppcon_2020.pdf
constructing_generic_algorithms__ben_deane__cppcon_2020.pdfconstructing_generic_algorithms__ben_deane__cppcon_2020.pdf
constructing_generic_algorithms__ben_deane__cppcon_2020.pdf
 
C2.0 propositional logic
C2.0 propositional logicC2.0 propositional logic
C2.0 propositional logic
 
Master of Computer Application (MCA) – Semester 4 MC0080
Master of Computer Application (MCA) – Semester 4  MC0080Master of Computer Application (MCA) – Semester 4  MC0080
Master of Computer Application (MCA) – Semester 4 MC0080
 
Chapter 4 ds
Chapter 4 dsChapter 4 ds
Chapter 4 ds
 
MetiTarski: An Automatic Prover for Real-Valued Special Functions
MetiTarski: An Automatic Prover for Real-Valued Special FunctionsMetiTarski: An Automatic Prover for Real-Valued Special Functions
MetiTarski: An Automatic Prover for Real-Valued Special Functions
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logic
 
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou
 
Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introductionJarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
 
Mathematical Statistics Homework Help
Mathematical Statistics Homework HelpMathematical Statistics Homework Help
Mathematical Statistics Homework Help
 
Knowledge extraction from support vector machines
Knowledge extraction from support vector machinesKnowledge extraction from support vector machines
Knowledge extraction from support vector machines
 

Recently uploaded

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

introduction to Genifer -- Deduction

  • 1. Introduction to Genifer – deduction source code: deduction.lisp
  • 2.  
  • 3.  
  • 4.  
  • 5. In my Lisp code variables are denoted by ?1 , ?2 , … etc
  • 6. First order logic has the following connectives and operators : /(AND) (OR) ┐ (NOT) -> (IMPLY) ↔ (EQUIVALENCE) For example A -> B is equivalent to (┐A B) and its truth table is: A B A->B T T T T F F F T T F F T ( I assume you still remember this stuff... )
  • 7. Horn form If a bunch of formulae can be written as: A ← B /C /D /… B ← E /F /G /... and if A is the goal we want to solve: A then we can cross out A and replace it with A, B, C, D, … as the new sub-goals and repeat the process: B, C, D, ..., E, F, G, … This makes solving the goals very efficient (similar to production systems in the old days). Formulae written in this form is called the Horn form and is the basis of the language Prolog . Genifer's logic is also based on Horn.
  • 8. * Optional: Some first-order formulae cannot be expressed in Horn form. If we want to prove theorems in full first-order logic, we need to use a more general algorithm such as resolution . The general procedure is: 1. convert all the formulae into CNF (conjunctive normal form) 2. eliminate all existential quantifiers  by a process called Skolemization (see next slide) 3. repeatedly apply the resolution rule to formulae in the KB, until nothing more changes If we restrict resolution to Horn formulae we get SLD-resolution which is very fast and is the search procedure in Prolog. I think Horn is expressive enough for making a first AGI prototype.
  • 9. First order logic has 2 quantifiers : Universal : " X liar(X)  for all X, X is a liar  “Everyone is a liar”. Existential :  X brother(john, X)  exists X such that X is John's brother The existential quantifier can be eliminated by Skolemization :  X brother(john, X) “Exists X such that X is John's bro”  brother(john, f(john)) where f() is called a Skolem function . Its purpose is to map X to X's brother. With existential quantifiers eliminated, we can assume all variables are implicitly universally quantified, and omit the " 's.
  • 10. When we have a goal to prove... goal G KB knowledge base We try to fetch facts and rules from the KB to satisfy the goal. eg: bachelor(john) ? (defined in memory.lisp )
  • 11.
  • 12.
  • 13. The black links represent “OR” (ie, the goal G can be solved by applying
  • 14. either rule1, rule2, rule3, ... etc.
  • 15.
  • 16. I think best-first search may be better, which uses a priority queue to rank the nodes. Each element in the priority queue points to a tree node. priority queue
  • 17. A goal / sub-goal can be satisfied by either facts or rules . example of a fact: bachelor(john) example of a rule: bachelor(?1) ← male(?1) /single(?1) this is a variable A B
  • 18. To satisfy a goal, some variable substitutions occur. We need to make these 2 terms identical; this is done by a n algorithm known as unification . The result of unification is a set of substitutions , for example: {?1/john, ...}
  • 19.
  • 20. new set of substitutions .
  • 21. Over time, a goal node can acquire
  • 22. multiple sets of substitutions. {?1/john} {?1/pete} {?1/paul} … etc these are 3 substitution sets stored in the node Managing these set of substitutions can be a great source of complexity, as the next few slides illustrate...
  • 23. Each substitution set is associated with a truth value (TV). {?1/john} {?1/pete} {?1/paul} … etc TV1 TV2 TV3 ...
  • 24. {?1/john} {?1/pete} {?1/paul} … etc {?1/mary} {?1/paul} {?1/john} … etc male(john), male(pete), male(paul), … etc single(mary), single(paul), single(john), … etc male(?1) single(?1) bachelor(?1) ← male(?1) /single(?1) facts from KB that matches the sub-goals These 2 blocks of substitution-sets must be merged to give the result to the parent node. When handling substitution sets of a conjunction /...
  • 25. {?1/john} {?1/pete} {?1/paul} … etc {?1/mary} {?1/paul} {?1/john} … etc Each set on the left block has to be matched with each set of the right block. for example: {?1 / john} {?1 / mary} fail {?1 / john} {?1 / john} match Because the variable ?1 can only take on one value on each instance.
  • 26.
  • 27. we try to do the matching when a new substitution-set arrives.
  • 28. When we get a new set, say {?1 / john}, we try to merge it with each set in the other existing blocks: {?1 / mary } {?1 / sam } {?1 / paul } {?1 / john } .... etc new result from unification
  • 29. {?1/john} {?1/pete} {?1/paul} … etc {?1/mary} {?1/paul} {?1/john} … etc Substitution-sets propagate upwards along the proof tree. parent's block of substitution sets This part of the Lisp code may still need developing.
  • 30. The Lisp code contains these functions: backward-chain main function, manages the priority queue process-subgoal process-fact builds up the proof tree during search process-rule retract deletes a dead proof tree node propagate propagates TVs up the proof tree TO-DO: * some comments are excessive