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

Similar documents
The Logic Paradigm. Joseph Spring. 7COM1023 Programming Paradigms

Introduction to predicate calculus

Knowledge Representation and Reasoning Logics for Artificial Intelligence

Logic Programming Languages

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Logic and its Applications

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

Resolution (14A) Young W. Lim 6/14/14

Chapter 16. Logic Programming Languages

Chapter 16. Logic Programming Languages ISBN

HANDBOOK OF LOGIC IN ARTIFICIAL INTELLIGENCE AND LOGIC PROGRAMMING

Propositional Resolution Part 3. Short Review Professor Anita Wasilewska CSE 352 Artificial Intelligence

Logic Languages. Hwansoo Han

LOGIC AND DISCRETE MATHEMATICS

Logic Programming. Let us have airline flight information of the form: 1. Application Domains: 2. Definitions

COMP4418 Knowledge Representation and Reasoning

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Knowledge Representation and Reasoning Logics for Artificial Intelligence

Prolog. Logic Programming vs Prolog

Logic as a Programming Language

Logic Programming and Resolution Lecture notes for INF3170/4171

INF5390 Kunstig intelligens. First-Order Logic. Roar Fjellheim

Chapter 16. Logic Programming. Topics. Predicate Calculus and Proving Theorems. Resolution. Resolution: example. Unification and Instantiation

Lecture 4: January 12, 2015

Knowledge Representation. CS 486/686: Introduction to Artificial Intelligence

Lecture 17 of 41. Clausal (Conjunctive Normal) Form and Resolution Techniques

Lecture 14: Lower Bounds for Tree Resolution

Implementação de Linguagens 2016/2017

Chapter 16. Logic Programming. Topics. Unification. Resolution. Prolog s Search Strategy. Prolog s Search Strategy

Chapter 16. Logic Programming Languages ISBN

CSE 452: Programming Languages. Prolog Statements. Loading the Knowledge Base. Logical Programming Languages Part 2

Integrity Constraints (Chapter 7.3) Overview. Bottom-Up. Top-Down. Integrity Constraint. Disjunctive & Negative Knowledge. Proof by Refutation

References. Topic #16: Logic Programming. Motivation. What is a program? Prolog Program Structure

CPS 506 Comparative Programming Languages. Programming Language Paradigm

Logic: TD as search, Datalog (variables)

Lecture 7: January 15, 2014

6.034 Notes: Section 11.1

Week 7 Prolog overview

Logic (or Declarative) Programming Foundations: Prolog. Overview [1]

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

The Resolution Algorithm

Fundamentals of Prolog

First-Order Logic (FOL)

Automated Reasoning PROLOG and Automated Reasoning 13.4 Further Issues in Automated Reasoning 13.5 Epilogue and References 13.

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Dipartimento di Elettronica Informazione e Bioingegneria. Cognitive Robotics. SATplan. Act1. Pre1. Fact. G. Gini Act2

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Constraint Solving. Systems and Internet Infrastructure Security

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 37 Resolution Rules

Advanced Logic and Functional Programming

CSC 501 Semantics of Programming Languages

Principles of Programming Languages Topic: Logic Programming Professor Lou Steinberg

Functional Logic Programming. Kristjan Vedel

Prolog. Intro to Logic Programming

PROPOSITIONAL LOGIC (2)

Lecture 6: Inductive Logic Programming

Deductive Methods, Bounded Model Checking

Q1:a. Best first search algorithm:

The Resolution Principle

MATHEMATICAL STRUCTURES FOR COMPUTER SCIENCE

THE DEVELOPMENT OF PARALLEL RESOLUTION ALGORITHMS USING THE GRAPH REPRESENTATION. Andrey Averin, Vadim Vagin

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

Programming Systems in Artificial Intelligence Introduction

proof through refutation

Com S 541. Programming Languages I

Markov Logic: Representation

Solutions to In-Class Problems Week 1, Fri

6. Inference and resolution

15 Unification and Embedded Languages in Lisp

Resolution in FOPC. Deepak Kumar November Knowledge Engineering in FOPC

== is a decent equivalence

Logical reasoning systems

STABILITY AND PARADOX IN ALGORITHMIC LOGIC

An introduction to logic programming with Prolog

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

Propositional Logic. Part I

What is all the Fuzz about?

Introduction to dependent types in Coq

7COM1023 Programming Paradigms

CS 321 Programming Languages and Compilers. Prolog

Contents. Chapter 1 SPECIFYING SYNTAX 1

Prolog. Artificial Intelligence. Lecture 2 Karim Bouzoubaa

(QiuXin Hui) 7.2 Given the following, can you prove that the unicorn is mythical? How about magical? Horned? Decide what you think the right answer

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

What is the study of logic?

Derived from PROgramming in LOGic (1972) Prolog and LISP - two most popular AI languages. Prolog programs based on predicate logic using Horn clauses

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Propositional Logic. Andreas Klappenecker

Chapter 24. Active Database Concepts and Triggers. Outline. Trigger Example. Event-Condition-Action (ECA) Model

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214

Sets. Sets. Subset, universe. Specifying sets, membership. Examples: Specifying a set using a predicate. Examples

A Pearl on SAT Solving in Prolog (extended abstract)

Introduction to Logic Programming

Set 7: Predicate logic Chapter 8 R&N. ICS 271 Fall 2015

More Non-logical Features of Prolog

UNIT 2 A. I. LANGUAGES-2: PROLOG

6.034 Notes: Section 10.1

Propositional Calculus. Math Foundations of Computer Science

Operational Semantics

Transcription:

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