COMP4418 Knowledge Representation and Reasoning

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

Knowledge Representation and Reasoning Logics for Artificial Intelligence

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

Knowledge Representation and Reasoning Logics for Artificial Intelligence

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

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

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

Resolution in FO logic (Ch. 9)

Lecture 4: January 12, 2015

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

Logic and its Applications

Logic Programming and Resolution Lecture notes for INF3170/4171

The Logic Paradigm. Joseph Spring. 7COM1023 Programming Paradigms

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

PROPOSITIONAL LOGIC (2)

NP and computational intractability. Kleinberg and Tardos, chapter 8

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

NP-Completeness of 3SAT, 1-IN-3SAT and MAX 2SAT

Declarative Programming. 2: theoretical backgrounds

Logic: TD as search, Datalog (variables)

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

The Resolution Algorithm

INF5390 Kunstig intelligens. First-Order Logic. Roar Fjellheim

DATABASE THEORY. Lecture 11: Introduction to Datalog. TU Dresden, 12th June Markus Krötzsch Knowledge-Based Systems

CS221 / Autumn 2017 / Liang & Ermon. Lecture 17: Logic II

Computer-Aided Program Design

Declarative programming. Logic programming is a declarative style of programming.

Constraint Solving. Systems and Internet Infrastructure Security

LOGIC AND DISCRETE MATHEMATICS

Logic Programming Languages

Description Logics Reasoning Algorithms Concluding Remarks References. DL Reasoning. Stasinos Konstantopoulos. IIT, NCSR Demokritos

Inf2D 12: Resolution-Based Inference

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

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.

Week 4. COMP62342 Sean Bechhofer, Uli Sattler

Programming Systems in Artificial Intelligence Introduction

Linear Time Unit Propagation, Horn-SAT and 2-SAT

NP-Complete Reductions 2

8.1 Polynomial-Time Reductions

Mixed Integer Linear Programming

Chapter 8. NP and Computational Intractability. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Implementação de Linguagens 2016/2017

DATABASE THEORY. Lecture 18: Dependencies. TU Dresden, 3rd July Markus Krötzsch Knowledge-Based Systems

Propositional Logic. Part I

Chapter 16. Logic Programming Languages

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

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.

Section 3 Default Logic. Subsection 3.1 Introducing defaults and default logics

Normal Forms for Boolean Expressions

Logic Languages. Hwansoo Han

Chapter 16. Logic Programming Languages ISBN

2SAT Andreas Klappenecker

HANDBOOK OF LOGIC IN ARTIFICIAL INTELLIGENCE AND LOGIC PROGRAMMING

Warm-Up Problem. Let L be the language consisting of as constant symbols, as a function symbol and as a predicate symbol. Give an interpretation where

Artificial Intelligence. Chapters Reviews. Readings: Chapters 3-8 of Russell & Norvig.

Markov Logic: Representation

OWL 2 Profiles. An Introduction to Lightweight Ontology Languages. Markus Krötzsch University of Oxford. Reasoning Web 2012

Unification in Maude. Steven Eker

What's the difference between the entailment symbol with the equals vs the entailment symbol with one line? Single turnstile meaning

Logical reasoning systems

Lecture 14: Lower Bounds for Tree Resolution

Software Engineering Lecture Notes

Boolean Functions (Formulas) and Propositional Logic

COMP219: Artificial Intelligence. Lecture 14: Knowledge Representation

8 NP-complete problem Hard problems: demo

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT

8. Negation 8-1. Deductive Databases and Logic Programming. (Sommer 2017) Chapter 8: Negation

A Retrospective on Datalog 1.0

Fixed-Parameter Algorithm for 2-CNF Deletion Problem

SAT solver of Howe & King as a logic program

The Satisfiability Problem [HMU06,Chp.10b] Satisfiability (SAT) Problem Cook s Theorem: An NP-Complete Problem Restricted SAT: CSAT, k-sat, 3SAT

We ve studied the main models and concepts of the theory of computation:

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

Decision Procedures. An Algorithmic Point of View. Decision Procedures for Propositional Logic. D. Kroening O. Strichman.

6.034 Notes: Section 11.1

1 Inference for Boolean theories

CPS 506 Comparative Programming Languages. Programming Language Paradigm

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

Prolog. Logic Programming vs Prolog

Knowledge & Reasoning

6. Inference and resolution

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]

PdOd Kev Events I Re-world war I1 rwa

Reductions and Satisfiability

Deductive Methods, Bounded Model Checking

CS 512, Spring 2017: Take-Home End-of-Term Examination

Tabled Resolution. CSE 595 Semantic Web Instructor: Dr. Paul Fodor Stony Brook University

Where Can We Draw The Line?

LTCS Report. Concept Descriptions with Set Constraints and Cardinality Constraints. Franz Baader. LTCS-Report 17-02

Efficient Two-Phase Data Reasoning for Description Logics

CSE 473 Lecture 12 Chapter 8. First-Order Logic. CSE AI faculty

Reasoning With Characteristic Models

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements.

Model checking for nonmonotonic logics: algorithms and complexity

Assignment 3: Logical Agents: Solutions

Formally Certified Satisfiability Solving

Chapter 9: Constraint Logic Programming

Programming Languages Third Edition

Boolean Representations and Combinatorial Equivalence

SAT Solver. CS 680 Formal Methods Jeremy Johnson

Transcription:

COMP4418 Knowledge Representation and Reasoning Week 3 Practical Reasoning David Rajaratnam Click to edit Present s Name

Practical Reasoning - My Interests Cognitive Robotics. Connect high level cognition with low-level sensing/actuators. Logical reasoning to make robot behave intelligently. Baxter Blocksworld video...

Recap of Weeks 1 & 2 Week 1: Propositional logic Simple propositions: Socrates is bald Semantics: meaning decided using truth tables Syntax: provability decided using inference rules resolution for CNF But... limited expressivity Week 2: First-order logic Able to capture properties of objects and relationships between objects Semantics: meaning decided using interpretations Syntax: provability using inference rules - resolution + unification for CNF highly expressive but... undecidable.

A Brief Overview of KRR Formalisms

Many Formalisms in KRR First-order logic Expressivity Propositional logic

Many Formalisms in KRR First-order logic Satisfiability is undecidable *actually semi-decidable, but distinction is not important for this course. Expressivity Propositional logic Satisfiablity is NP-complete Computational Complexity

Many Formalisms in KRR First-order logic Satisfiability is undecidable Expressivity Computational Complexity Propositional logic Satisfiablity is NP-complete Many important problems: Scheduling Timetabling Vehicle routing

Many Formalisms in KRR First-order logic Satisfiability is undecidable Expressivity Propositional logic Satisfiablity is NP-complete Computational Complexity

Many Formalisms in KRR First-order logic Satisfiability is undecidable Expressivity Computational Complexity Propositional logic Satisfiablity is NP-complete Propositional fragments When speed is important: Databases

Many Formalisms in KRR Higher-order logics some interest First-order logic Satisfiability is undecidable Expressivity Computational Complexity Propositional logic Satisfiablity is NP-complete Propositional fragments When speed is important: Databases

Many Formalisms in KRR First-order logic Satisfiability is undecidable Expressivity Propositional logic Satisfiablity is NP-complete Computational Complexity

Many Formalisms in KRR First-order logic Satisfiability is undecidable Decidable Expressivity Propositional logic Satisfiablity is NP-complete Computational Complexity

Many Formalisms in KRR Decidable First-order logic Satisfiability is undecidable Description logics, modal logics, Answer Set Programming Many interesting problems: Planning Reasoning about knowledge Expressivity Computational Complexity Propositional logic Satisfiablity is NP-complete

Horn Clauses

Clause Recap From weeks 1 & 2: Every formula can be converted to Conjunctive Normal Form (CNF) Any CNF can be viewed as a set of clauses Entailment checking with resolution is complete (proof by refutation) So using sets of clauses provides: Intuitive language for expressing knowledge vs Simple proof procedure that can be implemented

Reading Clauses as Implication Clauses can be intuitively interpreted in two ways: As disjunction: As implication: for syntactic convenience: so can be read as: if child and male then boy To understand why this makes sense go back to the truth tables: Modified from: KR & R @ Brachman & Levesque 2005

Horn Clauses Horn clause is a clause with at most one positive literal A positive (or definite) clause has exactly one positive literal A negative clause (or constraint) has no positive literals Note, since Hence ( or ) Also know as a goal when performing refutation proof A fact is a definite clause with no negative literals (i.e., a single positive literal): Modified from: KR & R @ Brachman & Levesque 2005

Resolution with Horn Clauses 1 Two options: Neg Pos Pos Pos Neg Pos Examples: Modified from: KR & R @ Brachman & Levesque 2005

Resolution with Horn Clauses 2 It is possible to rearrange derivations (of negative clauses) so that all new derived clauses are negative clauses: Given clauses: Derived positive clause Only derive negative clauses Modified from: KR & R @ Brachman & Levesque 2005

SLD Resolution Can change derivations such that each derived clause is a resolvent of the previous derived (negative) one and some positive clause in the original set of clauses Since each derived clause is negative, one parent must be positive (and so from original set) and one negative. Continue working backwards until both parents of derived clause are from the original set of clauses Eliminate all other clauses not on direct path c 1 c 2 c 3 old new c n 1 c n Modified from: KR & R @ Brachman & Levesque 2005

SLD Example To show that derive a contradiction from Note: Horn clauses capture a very intuitive way that we express knowledge. Modified from: KR & R @ Brachman & Levesque 2005

SLD Resolution (formal) An SLD-derivation of a clause c from a set of clauses S is a sequence of clauses c 1, c 2,... c n such that c n = c, and 1. c 1 S 2. c i+1 is a resolvent of c i and a clause in S Written as: SLD mean S(elected) literals L(inear) form D(efinite) clauses Modified from: KR & R @ Brachman & Levesque 2005

In General SLD is incomplete SLD resolution is not complete for general clauses. An example: So S is unsatisfiable, that is:, but SLD cannot derive the contradition because it needs to eventually perform resolution on the intermediate clauses and (or and ) Modified from: KR & R @ Brachman & Levesque 2005

Completeness of SLD But SLD resolution IS complete for Horn clauses. Theorem: If H is a set of Horn clauses then iff This is a good result as searching for appropriate clauses to resolve on is simpler for SLD resolution. Satisfiability for propositional Horn clauses is P-complete. Nothing is for free: loss of expressivity. Cannot express simple (positive) disjunctions. n is polynomial in number of clauses c 1 c 2 c 3 c n 1 c n old new Modified from: KR & R @ Brachman & Levesque 2005

Back to the KRR Overview First-order logic Satisfiability is undecidable Expressivity Computational Complexity Propositional logic Satisfiablity is NP-complete Propositional fragments Horn clauses

Back to the KRR Overview First-order logic Satisfiability is undecidable Decidable Expressivity Computational Complexity Propositional logic Satisfiablity is NP-complete Propositional fragments Horn clauses Tractable

First-Order (FO) Clauses Week 2 recap: Conversion to FO CNF is same as propositional case except: Standardise variable names Skolemise (getting rid of existential quantifiers) Drop universal quantifiers FO resolution is same as propositional case except: Find substitutions to unify the two clauses Modified from: KR & R @ Brachman & Levesque 2005

First-Order (FO) Horn Clauses Same as propositional case except in a FO language SLD-resolution also same; with addition of unification Completeness of FO Horn also holds Theorem: If H is a set of Horn clauses then iff But... Modified from: KR & R @ Brachman & Levesque 2005

First-Order (FO) Horn Clauses FO Horn is undecidable. With Horn SLD resolution we can still generate an infinite sequence of resolvents. KB: Query: Should fail since Modified from: KR & R @ Brachman & Levesque 2005

Basis for Logic Programming Since FO Horn is undecidable it is also very expressive FO Horn and SLD resolution form the basis for Prolog A general purpose programming language based on logic Provides an intuitive language for expressing knowledge Prolog is Turing-complete Prolog is a form of declarative programming you specify what the program should do not how it should do it Modified from: KR & R @ Brachman & Levesque 2005

Prolog.go to Prolog slides Modified from: KR & R @ Brachman & Levesque 2005

Concluding Remarks Modified from: KR & R @ Brachman & Levesque 2005

Conclusion Scoped out the KRR landscape and relationship between formalisms Looked at propositional and first-order Horn clauses and SLD resolution Empasised distinction between Semantics vs Syntax Entailment (meaning) Inference (symbol manipulation) Looked at Prolog Turing complete: general purpose programming language Declarative programming allows for compact representations Modified from: KR & R @ Brachman & Levesque 2005

Coming Weeks Prolog's expressivity comes with a cost Efficiency issues and undecidability Operational behaviour violates logical semantics; cut (!) operator, ordering of clauses. In coming weeks will look at more specialised logics that take a different approach to balance expressibility-computability-efficiency Modified from: KR & R @ Brachman & Levesque 2005