CSC384: Intro to Artificial Intelligence Knowledge Representation IV

Similar documents
Peirce's Remarkable Rules of Inference

Part I: Graph Coloring

The Language of First-Order Predicate Logic

CSC 373: Algorithm Design and Analysis Lecture 17

8. Numerations The existential quantifier Exemplification Overview

Emergence of Cooperation Through Mutual Preference Revision

8. Numerations The existential quantifier Overview

Chapter 4. Predicate logic allows us to represent the internal properties of the statement. Example:

COMP Intro to Logic for Computer Scientists. Lecture 2

AN EXAMPLE FOR NATURAL LANGUAGE UNDERSTANDING AND THE AI PROBLEMS IT RAISES

Handling Data Quality in Entity Resolution

Elements of Style. Anders O.F. Hendrickson

Consistency and Completeness of OMEGA, a Logic for Knowledge Representation

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 151) Pass Marks: 24

Vagueness & Pragmatics

6.034 Notes: Section 4.1

For every sentences A and B, there is a sentence: A B,

Using minterms, m-notation / decimal notation Sum = Cout = Using maxterms, M-notation Sum = Cout =

Where Are We Now? e.g., ADD $S0 $S1 $S2?? Computed by digital circuit. CSCI 402: Computer Architectures. Some basics of Logic Design (Appendix B)

First Order Logic. Xiaojin Zhu Computer Sciences Department University of Wisconsin, Madison. [Based on slides from Burr Settles]

Final Exam review: chapter 4 and 5. Supplement 3 and 4

CS302 Digital Logic Design Solved Objective Midterm Papers For Preparation of Midterm Exam

MODEL QUESTIONS WITH ANSWERS THIRD SEMESTER B.TECH DEGREE EXAMINATION DECEMBER CS 203: Switching Theory and Logic Design. Time: 3 Hrs Marks: 100

Reply to Stalnaker. Timothy Williamson. In Models and Reality, Robert Stalnaker responds to the tensions discerned in Modal Logic

Artificial Intelligence

0 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 1 1 Stop bits. 11-bit Serial Data format

Formalizing Irony with Doxastic Logic

L5 Sequential Circuit Design

Kant s Logic Revisited

cse371/mat371 LOGIC Professor Anita Wasilewska

A Functional Representation of Fuzzy Preferences

Knowledge Representation

8.5 --Intro to RAA Proofs Practice with Proofs. Today s Lecture 4/20/10

NTE1416 Integrated Circuit Chrominance and Luminance Processor for NTSC Color TV

Outline. flip-flops registers. sorting words values of numbers given in words. using Python lists towers of Hanoi

Topics in Linguistic Theory: Propositional Attitudes

Institute of Southern Punjab, Multan

Sentence Elements Cengage Learning. All Rights Reserved. Business English, 11e, by Mary Ellen Guffey and Carolyn Seefer 2-2

Computational Modelling of Harmony

Department of CSIT. Class: B.SC Semester: II Year: 2013 Paper Title: Introduction to logics of Computer Max Marks: 30

Appendix B. Elements of Style for Proofs

Content. Learning Outcomes. In this lesson you will learn all about antonyms.

Code No: A R09 Set No. 2

Articulating Medieval Logic, by Terence Parsons. Oxford: Oxford University Press,

NKPZ.E Motor Controllers, Float- and Pressure-operated. Motor Controllers, Float- and Pressure-operated

Introduction Section 1: Logic. The basic purpose is to learn some elementary logic.

CS 1674: Intro to Computer Vision. Face Detection. Prof. Adriana Kovashka University of Pittsburgh November 7, 2016

Introduction to Digital Electronics

Concepts of Programming Languages, Spring 2014 Practice Assignment1 Discussion:

Introduction p. 1 The Elements of an Argument p. 1 Deduction and Induction p. 5 Deductive Argument Forms p. 7 Truth and Validity p. 8 Soundness p.

Doctor of Philosophy

MA 15910, Lesson 5, Algebra part of text, Sections 2.3, 2.4, and 7.5 Solving Applied Problems

EECS 270 Midterm Exam Spring 2011

Analogue Versus Digital [5 M]

Specifications: CWR Light

EndNote Menus Reference Guide. EndNote Training

Introduction to Computers and Programming

Non-Fiction Self-Help Book Template

Is Hegel s Logic Logical?

Bridges and Arches. Authors: André Holleman (Bonhoeffer college, teacher in research at the AMSTEL Institute) André Heck (AMSTEL Institute)

Selected Phrases for Preambulary Clauses


Half-Adders. Ch.5 Summary. Chapter 5. Thomas L. Floyd

Pushing the Communication Barrier in 2PC using Lookup Tables

6 th Grade ELA Post-Test Study Guide Semester One

ONLINE SUBMISSION PROCESS - DIGITIAL LINKS

Table of content. Table of content Introduction Concepts Hardware setup...4

What is Character? David Braun. University of Rochester. In "Demonstratives", David Kaplan argues that indexicals and other expressions have a

My XDS Receiver- Affiliate Scheduler

Figure 1: segment of an unprogrammed and programmed PAL.

Frequently Asked Questions

Grade 3 ELA Unit 2 Pretest (Teacher Edition) Assessment ID: dna ib Root Beer

Module 11. Reasoning with uncertainty-fuzzy Reasoning. Version 2 CSE IIT, Kharagpur

SDS PODCAST EPISODE 96 FIVE MINUTE FRIDAY: THE BAYES THEOREM

Self-reference. Sereny's presentation in "Godel, Tarski, Church, and the Liar,"' although the main idea is

CSE 140 Exam #3 Tajana Simunic Rosing

SCE Training Curriculums

Extracting Significant Patterns from Musical Strings: Some Interesting Problems.

PURBANCHAL UNIVERSITY

Logik für Informatiker Logic for computer scientists

graphics files How to prepare FOR BOOK PRINTING

Getting Graphical PART II. Chapter 5. Chapter 6. Chapter 7. Chapter 8. Chapter 9. Beginning Graphics Page Flipping and Pixel Plotting...

THE SUBSTITUTIONAL ANALYSIS OF LOGICAL CONSEQUENCE

CSc 372. Comparative Programming Languages. 17 : Prolog Introduction. Department of Computer Science University of Arizona

CSc 372 Comparative Programming Languages

CSc 372 Comparative Programming Languages. Objects & Relationships. 9: Prolog Introduction

The unifying one box platform for all your RVI inspection needs

TV Synchronism Generation with PIC Microcontroller

Pulling together your thesis DR CHRISTINA EKEGREN, NHMRC EARLY CAREER RESEARCH FELLOW MONASH UNIVERSITY

1.1 The Language of Mathematics Expressions versus Sentences

New Year! Intermediate. New Year s. classroom. activity pack for the

AP Language and Composition Summer Assignment, 2018

LabView Exercises: Part II

TOMSK POLYTECHNIC UNIVERSITY. F.A. Gubarev, M.E. Nakonechnaya DIGITAL DEVICES. Practical Course

The PeRIPLO Propositional Interpolator

UNIT-3: SEQUENTIAL LOGIC CIRCUITS

SSTV Transmission Methodology

Argument and argument forms

HOW TO POINT A DISH ANTENNA

Laboratory Objectives and outcomes for Digital Design Lab

Transcription:

CSC384: Intro to Artificial Intelligence Knowledge Representation IV Answer Extraction Factoring (optional, not on Test 2) Prolog (not on Test 2) Review: One more example (do it yourself) 1

Answer Extraction. The previous example shows how we can answer true-false questions. With a bit more effort we can also answer fill-in-the-blanks questions (e.g., what is wrong with the car?). As in Prolog we use free variables in the query where we want the fill in the blanks. We simply need to keep track of the binding that these variables received in proving the query. parent(art, jon) is art one of jon s parents? parent(x, jon) -who is one of jon s parents? 2

Answer Extraction. A simple bookkeeping device is to use an predicate symbol answer(x,y, ) to keep track of the bindings automatically. To answer the query parent(x,jon), we construct the clause ( parent(x,jon), answer(x)) Now we perform resolution until we obtain a clause consisting of only answer literals (previously we stopped at empty clauses). 3

Answer Extraction: Example 1 1. father(art, jon) 2. father(bob,kim) 3. ( father(y,z), parent(y,z)) i.e. all fathers are parents 4. ( parent(x,jon), answer(x)) i.e. the query is: who is parent of jon? Here is a resolution proof: 5. R[4,3b]{Y=X,Z=jon} ( father(x,jon), answer(x)) 6. R[5,1]{X=art} answer(art) so art is parent of jon 4

Answer Extraction: Example 2 1. (father(art, jon), father(bob,jon) //either bob or art is parent of jon 2. father(bob,kim) 3. ( father(y,z), parent(y,z)) //i.e. all fathers are parents 4. ( parent(x,jon), answer(x)) //i.e. query is parent(x,jon) Here is a resolution proof: 5. R[4,3b]{Y=X,Z=jon} ( father(x,jon), answer(x)) 6. R[5,1a]{X=art} (father(bob,jon), answer(art)) 7. R[6,3b] {Y=bob,Z=jon} (parent(bob,jon), answer(art)) 8. R[7,4] {X=bob} (answer(bob), answer(art)) A disjunctive answer: either bob or art is parent of jon. 5

Factoring (optional) 1. (p(x), p(y)) // X. Y. p(x) p(y) 2. ( p(v), p(w)) // V. W. p(v) p(w) These clauses are intuitively contradictory, but following the strict rules of resolution only we obtain: 3. R[1a,2a](X=V) (p(y), p(w)) Renaming variables: (p(q), p(z)) 4. R[3b,1a](X=Z) (p(y), p(q)) No way of generating empty clause! Factoring is needed to make resolution complete, without it resolution is incomplete! 6

Factoring (optional). If two or more literals of a clause C have an mgu θ, then Cθ with all duplicate literals removed is called a factor of C. C = (p(x), p(f(y)), q(x)) θ = {X=f(Y)} Cθ = (p(f(y)), p(f(y)), q(f(y))) (p(f(y)), q(f(y)) is a factor Adding a factor of a clause can be a step of proof: 1. (p(x), p(y)) 2. ( p(v), p(w)) 3. f[1ab]{x=y} p(y) 4. f[2ab]{v=w} p(w) 5. R[3,4]{Y=W} (). 7

Prolog Prolog search mechanism (without not and cut) is simply an instance of resolution, except 1. Clauses are Horn (only one positive literal) 2. Prolog uses a specific depth first strategy when searching for a proof. (Rules are used first mentioned first used, literals are resolved away left to right). 8

Prolog Append: 1. append([], Z, Z) 2. append([e1 R1], Y, [E1 Rest]) :- append(r1, Y, Rest) Note: The second is actually the clause (append([e1 R1], Y, [E1 Rest]), append(r1,y,rest)) [ ] is a constant (the empty list) [X Y] is cons(x,y). So [a,b,c] is short hand for cons(a,cons(b,cons(c,[]))) 9

Prolog: Example of proof Try to prove : append([a,b], [c,d], [a,b,c,d]): 1. append([], Z, Z) 2. (append([e1 R1], Y, [E1 Rest]), append(r1,y,rest)) 3. append([a,b], [c,d], [a,b,c,d]) 4. R[3,2a]{E1=a, R1=[b], Y=[c,d], Rest=[b,c,d]} append([b], [c,d], [b,c,d]) 5. R[4,2a]{E1=b, R1=[], Y=[c,d], Rest=[c,d]} append([], [c,d], [c,d]) 6. R[5,1]{Z=[c,d]} () 10

Review: One Last Example! Consider the following English description Whoever can read is literate. Dolphins are not literate. Flipper is an intelligent dolphin. Who is intelligent but cannot read. 11

Example: pick symbols & convert to first-order formula Whoever can read is literate. X. read(x) lit(x) Dolphins are not literate. X. dolp(x) lit(x) Flipper is an intelligent dolphin dolp(flipper) intell(flipper) Who is intelligent but cannot read? X. intell(x) read(x). 12

Example: convert to clausal form X. read(x) lit(x) ( read(x), lit(x)) Dolphins are not literate. X. dolp(x) lit(x) ( dolp(x), lit(x)) Flipper is an intelligent dolphin. dolp(flipper) intell(flipper) who are intelligent but cannot read? X. intell(x) read(x). X. intell(x) read(x) ( intell(x), read(x), answer(x)) 13

Example: do the resolution proof 1. ( read(x), lit(x)) 2. ( dolp(x), lit(x)) 3. dolp(flip) 4. intell(flip) 5. ( intell(x), read(x),answer(x)) 6. R[5a,4] X=flip. (read(flip), answer(flip)) 7. R[6,1a] X=flip. (lit(flip), answer(flip)) 8. R[7,2b] X=flip. ( dolp(flip), answer(flip)) 9. R[8,3] answer(flip) so flip is intelligent but cannot read! 14