SlideShare ist ein Scribd-Unternehmen logo
1 von 21
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

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (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]
 

Ähnlich wie introduction to Genifer -- Deduction

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
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programmingJay Nagar
 
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.pdfAmirMohamedNabilSale
 
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 tofariyaPatel
 
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 V2S.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 logicpendragon6626
 
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.pdfSayanSamanta39
 
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 MC0080Aravind NC
 
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 logicManjula 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
 
Knowledge extraction from support vector machines
Knowledge extraction from support vector machinesKnowledge extraction from support vector machines
Knowledge extraction from support vector machinesEyad Alshami
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Kürzlich hochgeladen (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
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...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

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