notes for week 12 the ai war lisp and prolog basic concepts of logic programming
TRANSCRIPT
![Page 1: Notes for Week 12 The AI War LISP and Prolog Basic Concepts of Logic Programming](https://reader035.vdocuments.net/reader035/viewer/2022072006/56649f435503460f94c63e0c/html5/thumbnails/1.jpg)
Notes for Week 12
• The AI War • LISP and Prolog • Basic Concepts of Logic Programming
![Page 2: Notes for Week 12 The AI War LISP and Prolog Basic Concepts of Logic Programming](https://reader035.vdocuments.net/reader035/viewer/2022072006/56649f435503460f94c63e0c/html5/thumbnails/2.jpg)
The AI War
• Two main schools of thought on how machines should learn: inductive and deductive analysis.
• Deductive: Expert => rules => knowledge, top-down approach, expert systems used LISP, Prolog, and shell languages CLIPS and JESS; programs suffered from: brittle and expensive to maintain
• Inductive: knowledge <= rules <= Data, bottom-up, machine learning and data mining – extracts patterns from data and learns from examples, such as DT, ANN, GA; starting from 1980’s
![Page 3: Notes for Week 12 The AI War LISP and Prolog Basic Concepts of Logic Programming](https://reader035.vdocuments.net/reader035/viewer/2022072006/56649f435503460f94c63e0c/html5/thumbnails/3.jpg)
Logic Programming
• Logic is used to represent program • Deductions are used as computation• Historical notes: predicate calculus,
unification, resolution principle, Prolog• Differences between procedural
programming and logic programming
![Page 4: Notes for Week 12 The AI War LISP and Prolog Basic Concepts of Logic Programming](https://reader035.vdocuments.net/reader035/viewer/2022072006/56649f435503460f94c63e0c/html5/thumbnails/4.jpg)
Resolution
• An important rule of inference that can applied to– clauses (wff consisting of disjunction of
literals)– a refutation system: prove by contradiction
• Idea: given two clauses, we can infer a new clause by taking the disjunction of the two clause & eliminating the complementary pair of literals
![Page 5: Notes for Week 12 The AI War LISP and Prolog Basic Concepts of Logic Programming](https://reader035.vdocuments.net/reader035/viewer/2022072006/56649f435503460f94c63e0c/html5/thumbnails/5.jpg)
A refutaion system
Given a set of clauses S & and goal G,* negate the goal G
*{S} U {¬G}* existence of contradiction => derivation of empty clause
Based on {S} U {¬G} is inconsistent if {S} U {G} is consistent
![Page 6: Notes for Week 12 The AI War LISP and Prolog Basic Concepts of Logic Programming](https://reader035.vdocuments.net/reader035/viewer/2022072006/56649f435503460f94c63e0c/html5/thumbnails/6.jpg)
Resolution in a nutshell
• Based on – Clause form of predicate logic– Inconsistence checking (refutation)– The heart of the rule is the
unification algorithm (the process of finding substitutions for variables to make arguments match )
![Page 7: Notes for Week 12 The AI War LISP and Prolog Basic Concepts of Logic Programming](https://reader035.vdocuments.net/reader035/viewer/2022072006/56649f435503460f94c63e0c/html5/thumbnails/7.jpg)
Forward/backward chaining
• A group of multiple inferences that connect a problem with its solution is called a chain
• Forward chaining: inference starts from facts/rules
• Backward chaining: inference starts from given problems
![Page 8: Notes for Week 12 The AI War LISP and Prolog Basic Concepts of Logic Programming](https://reader035.vdocuments.net/reader035/viewer/2022072006/56649f435503460f94c63e0c/html5/thumbnails/8.jpg)
Backtracking technique
• Inference backtracks to a previous step when a failure occurs.
• Naïve backtracking: backtracks mechanically to the most recent step when a failure occurs
• Intelligent backtracking: analyze the cause of a failure & backtracks to the source of values causing the failure
![Page 9: Notes for Week 12 The AI War LISP and Prolog Basic Concepts of Logic Programming](https://reader035.vdocuments.net/reader035/viewer/2022072006/56649f435503460f94c63e0c/html5/thumbnails/9.jpg)
Concept questions
• What are the motivations for logic programming?
• What are the differences between procedural programming and logic programming?
• What is deductive analysis? Illustrate with an example.
• What is inductive analysis? Illustrate with an example.
• Execution of a Prolog program: knowledge representation and computation
![Page 10: Notes for Week 12 The AI War LISP and Prolog Basic Concepts of Logic Programming](https://reader035.vdocuments.net/reader035/viewer/2022072006/56649f435503460f94c63e0c/html5/thumbnails/10.jpg)
Concept Questions
• What are resolution, unification, instantiation?
• Is Prolog forward chaining?• What is the deduction trees of resolution?• Programming in Prolog:
– asserting facts,– representing knowledge in rules,– asking questions about objects and relations