Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.

Slides:



Advertisements
Similar presentations
CS4026 Formal Models of Computation Part II The Logic Model Lecture 1 – Programming in Logic.
Advertisements

Some Prolog Prolog is a logic programming language
Russell and Norvig Chapter 7
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 10– Club and Circuit Examples.
Standard Logical Equivalences
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Logic Use mathematical deduction to derive new knowledge.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
CS 330 Programming Languages 12 / 02 / 2008 Instructor: Michael Eckmann.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Chapter 12: Expert Systems Design Examples
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
CSE (c) S. Tanimoto, 2008 Propositional Logic
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Inference and Resolution for Problem Solving
1 Chapter 9 Rules and Expert Systems. 2 Chapter 9 Contents (1) l Rules for Knowledge Representation l Rule Based Production Systems l Forward Chaining.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Artificial Intelligence
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
ISBN Chapter 16 Logic Programming Languages.
February 20, 2006AI: Chapter 7: Logical Agents1 Artificial Intelligence Chapter 7: Logical Agents Michael Scherger Department of Computer Science Kent.
1-1 Introduction Logic programming languages, sometimes called declarative programming languages Express programs in a form of symbolic logic Use a logical.
1 COSC3306: Programming Paradigms Lecture 8: Declarative Programming Specifications Haibin Zhu, Ph.D. Computer Science Nipissing University (C) 2003.
‘In which we introduce a logic that is sufficent for building knowledge- based agents!’
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
ARTIFICIAL INTELLIGENCE DR. ABRAHAM AI a field of computer science that is concerned with mechanizing things people do that require intelligent.
CHAPTER 15 & 16 Functional & Logic Programming Languages.
1 Prolog and Logic Languages Aaron Bloomfield CS 415 Fall 2005.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
The AI War LISP and Prolog Basic Concepts of Logic Programming
Dr. Muhammed Al-Mulhem ICS An Introduction to Logical Programming.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
Logic Programming Languages Session 13 Course : T Programming Language Concept Year : February 2011.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
Ch. 13 Ch. 131 jcmt CSE 3302 Programming Languages CSE3302 Programming Languages (notes?) Dr. Carter Tiernan.
Introduction to Prolog. Outline What is Prolog? Prolog basics Prolog Demo Syntax: –Atoms and Variables –Complex Terms –Facts & Queries –Rules Examples.
© Kenneth C. Louden, Chapter 12 - Logic Programming Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
1-1 An Introduction to Logical Programming Sept
In The Name Of Allah Lab 03 1Tahani Aldweesh. objectives Searching for the solution’s. Declaration. Query. Comments. Prolog Concepts. Unification. Disjunction.
Introduction to Prolog Asst. Prof. Dr. Senem Kumova Metin Revised lecture notes of “Concepts of Programmig Languages, Robert W. Sebesta, Ch. 16”
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Answer Extraction To use resolution to answer questions, for example a query of the form  X C(X), we must keep track of the substitutions made during.
Some Thoughts to Consider 5 Take a look at some of the sophisticated toys being offered in stores, in catalogs, or in Sunday newspaper ads. Which ones.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Copyright 1999Paul F. Reynolds, Jr. Foundations of Logic Programming.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
EA C461 Artificial Intelligence
CS621: Artificial Intelligence
By P. S. Suryateja Asst. Professor, CSE Vishnu Institute of Technology
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
Logic Use mathematical deduction to derive new knowledge.
CS 416 Artificial Intelligence
Horn Clauses and Unification
Back to “Serious” Topics…
Horn Clauses and Unification
Biointelligence Lab School of Computer Sci. & Eng.
Horn Clauses and Unification
CS2136: Paradigms of Computation
Presentation transcript:

Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions

The AI War How machines should learn: inductive or deductive? 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 Decision Tree, Artificial NN, Genetic Algorithm; starting from 1980’s.

Logic Programming: Motivation Logic is used to represent program Deductions are used as computation A higher level language does more automatically – we can concentrate more on what is to be done and less on how to do it Ideal: Algorithm = logic (what) + Control (how) – only specify logic and let system take care of control

Logic Programming: Theoretical foundation predicate calculus, Horn Clauses – knowledge representations Refutation system, unification, instantiation – auto deduction methods resolution principle – inference engine behind Prolog

Differences between Procedural P. and Logic P. Architecture:Von Neumann machine (sequential steps) Syntax: Sequence of statements (a, s, I) Computation: Sequential statements execution Control: Logic and control are mixed together Abstract model (dealing with objects and their relationships) Logic formulas (Horn Clauses) Deduction of the clauses Logic and control can be separated

Basic Concepts A clause is a formula consisting of a dis junction of literals Any formula can be converted into a set of clauses, for example: P  Q  ~P V Q Empty clause denoted by [], always false.

Resolution An important rule of inference that can applied to – clauses (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

Resolution as A refutation 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

Resolution in a nutshell –Represent knowledge and questions in terms of Horn 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 – finding answers to questions)

Programming in Prolog Asserting some facts about objects and their relationships Representing general knowledge in terms of rules Asking questions about objects and their relations.

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

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

Prolog: sequence control Given a query, Prolog uses unification with backtracking. All rules have local context A query such as: q1, q2, …, qn Unification implementation: first evaluates q1, then q2, and so on (from left to right); database search (top down)

Deficiencies of Prolog Resolution order control Ordering of pattern matching during resolution Cut operator Closed world assumption It has only the knowledge of its database A true/fail system rather than a true/false The negation Problem Prolog not operator is not equivalent to logical NOT operator

More on the negation problem The fundamental reason why logical NOT cannot be an integral part of Prolog is the form of the Horn clause. If all the B propositions are true => A is true. But it cannot be concluded that is false otherwise.

Negation as failure Example of page 565 –parent(amy, bob). –?- not(mother(amy, bob)). –The answer is yes, since the system does not know that amy is female and the female parents are mothers. –If we are to add these facts to our program, not(mother(amy, bob)) would no longer be true.

Concept Questions (1) What is backward chaining inference method? What is forward chaining inference method? Which inference method does each of the following languages use : Prolog, Clips?

Concept questions (2) What are the motivations for logic programming? What are the differences between procedural programming and logic programming? Execution of a Prolog program: knowledge representation and computation

Concept questions (3) What is deductive analysis? Illustrate with an example. What is inductive analysis? Illustrate with an example. What is an expert system/rule based system? How does it work?

Concept Questions (4) Use set notation to describe resolution as a refutation system. Construction of deduction tree of resolution. Programming in Prolog: – asserting facts, –representing knowledge in rules, – asking questions about objects and relations