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

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

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

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

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

COMP4418 Knowledge Representation and Reasoning

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

PROPOSITIONAL LOGIC (2)

Constraint Solving. Systems and Internet Infrastructure Security

Logic: TD as search, Datalog (variables)

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

Logic Programming and Resolution Lecture notes for INF3170/4171

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

Declarative Programming. 2: theoretical backgrounds

Conjunctive queries. Many computational problems are much easier for conjunctive queries than for general first-order queries.

Diagnosis through constrain propagation and dependency recording. 2 ATMS for dependency recording

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

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

8 NP-complete problem Hard problems: demo

Automatic Reasoning (Section 8.3)

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

NP and computational intractability. Kleinberg and Tardos, chapter 8

Full Clausal Logic - Syntax: clauses

2SAT Andreas Klappenecker

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

Finite Model Generation for Isabelle/HOL Using a SAT Solver

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

Logical reasoning systems

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

Chapter 2 & 3: Representations & Reasoning Systems (2.2)

Inconsistency-tolerant logics

Rewriting Queries with Negated Atoms Appendixes

More Non-logical Features of Prolog

Computer-Aided Program Design

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

Simply Logical Chapter 2 Peter Flach, clausal logic. clausal logic. expressions that can be true or false. clausal logic

Knowledge Representation and Reasoning Logics for Artificial Intelligence

More NP-Complete Problems [HMU06,Chp.10b] Node Cover Independent Set Knapsack Real Games

Computational Logic. SLD resolution. Damiano Zanardini

Where Can We Draw The Line?

The Resolution Principle

Lecture 4: January 12, 2015

PCP and Hardness of Approximation

Lecture 14: Lower Bounds for Tree Resolution

Introduction to Logic Programming

Propositional Logic. Part I

Online Appendix: A Stackelberg Game Model for Botnet Data Exfiltration

(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

Data Integration: Logic Query Languages

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Knowledge Representation and Reasoning Logics for Artificial Intelligence

What is a Logic Program. Introduction to Logic Programming. Introductory Examples. Introductory Examples. Foundations, First-Order Language

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010

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

Discrete Mathematics Lecture 4. Harper Langston New York University

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

Range Restriction for General Formulas

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

The Resolution Algorithm

1.4 Normal Forms. We define conjunctions of formulas as follows: and analogously disjunctions: Literals and Clauses

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

Symbolic Methods. The finite-state case. Martin Fränzle. Carl von Ossietzky Universität FK II, Dpt. Informatik Abt.

Answer Key #1 Phil 414 JL Shaheen Fall 2010

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

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

6. Inference and resolution

Boolean Functions (Formulas) and Propositional Logic

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

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

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

W4231: Analysis of Algorithms

Recap Datalog Datalog Syntax Datalog Semantics. Logic: Datalog. CPSC 322 Logic 6. Textbook Logic: Datalog CPSC 322 Logic 6, Slide 1

Exercises Computational Complexity

Constraint Propagation for Efficient Inference in Markov Logic

Choice Logic Programs and Nash Equilibria in Strategic Games

Knowledge & Reasoning

SAT-CNF Is N P-complete

Deductive Methods, Bounded Model Checking

CSE 20 DISCRETE MATH. Fall

CS 395T Computational Learning Theory. Scribe: Wei Tang

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

LOGIC-BASED TRUTH MAINTENANCE SYSTEMS. EECS 344 Winter, 2008

Logic Programming Languages

Part I Logic programming paradigm

6c Lecture 3 & 4: April 8 & 10, 2014

Complexity Classes and Polynomial-time Reductions

Combinatorial Optimization

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

Signed Formulas and Annotated Logics

Semantic Forcing in Disjunctive Logic Programs

SERGEI OBIEDKOV LEARNING HORN FORMULAS WITH QUERIES

Extending Prolog with Incomplete Fuzzy Information

Elementary Recursive Function Theory

1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time:

CS 561: Artificial Intelligence

8.1 Polynomial-Time Reductions

Constraint Acquisition

Transcription:

CSE560 Class 10: 1 c P. Heeman, 2010 Integrity Constraints Overview Disjunctive & Negative Knowledge Resolution Rule Bottom-Up Proof by Refutation Top-Down CSE560 Class 10: 2 c P. Heeman, 2010 Integrity Constraints (Chapter 7.3) Integrity Constraint - false a 1... a n - Means that a 1... a n cannot be true + A model of KB must make each clause true If it makes the body true, than false must be true Which is a contradiction, so body can t be true - Allows us to specify things that should not be true - false a means that a has to be false in all models Horne Clause - Is either a clause or an integrity constraint - Have either an atom or a false on left hand side

CSE560 Class 10: 3 c P. Heeman, 2010 Example KB false a b a c b c - Can conclude that c is false in all models of KB - If interpretation makes c true, it would also makes a and b, hence would make a b true and hence would need to be make false true - So KB = c CSE560 Class 10: 4 c P. Heeman, 2010 Syntax and Semantics of Not Add to syntax Semantics - If interpretation I and variable assignment U make a true, than it makes a false, and vice versa KB = c - If c is true in all models (and with all variable assignments) - If c is false in all models For any d - KB = d if d is true in all models of KB - KB = d if d is false in all models of KB - otherwise

CSE560 Class 10: 5 c P. Heeman, 2010 Variations on Integrity Constraints false a - Can be written as a - Or as a true false a 1... a n - Can be written as a 1 a 2... a n - Can be written as a 1... a n h a 1... a n - Can be written as h a 1... a n : conjuctive normal form - Negative signs just on atoms + Call atom with optional negation a literal Horne clause - When written in conjunctive normal form, at most one positive literal CSE560 Class 10: 6 c P. Heeman, 2010 Syntax and Semantics of Or Add to syntax Semantics - If interpretation I and variable assignment U make a or b true, than it makes a b true

CSE560 Class 10: 7 c P. Heeman, 2010 Unsatisfiable Integrity constraints means there might not be a model of a KB - KB is unsatisfiable - Proof procedure should be able to derive false - Proof procedure should derive false iff KB is unsatisfiable Example KB a false a - Unsatisfiable CSE560 Class 10: 8 c P. Heeman, 2010 Horne Clauses Integrity constraints can be used for diagnostics - See textbook Also allows us a way to state some negative information - From home control: don t want something to be on and off - Should be able to prove negative facts as well Our top-down and bottom-up proof procedures not powerful enough

CSE560 Class 10: 9 c P. Heeman, 2010 Overview Integrity Constraints Disjunctive & Negative Knowledge Resolution Rule Bottom-Up Proof by Refutation Top-Down CSE560 Class 10: 10 c P. Heeman, 2010 Disjunctive Knowledge In Conjunctive Normal Form Positive literals Negative literals Datalog Exactly 1 any number Horne At most 1 any number Disjustive & Negative any number any number Remove restriction of Horne clauses - Allow disjunction in head - c b a - Allow atoms to be negated - Can be converted into conjunctive normal form + No restrictions on how many positive literals In fact allow any combination with,,, and

CSE560 Class 10: 11 c P. Heeman, 2010 Conversion to Conjunctive Normal Form Any expression with,,, and can be converted into a set of clauses in conjunctive normal form - no literals on right hand side of Step 1: Eliminate - (φ ψ) replace with (φ ψ) Step 2: Distribute negatation so only applies to atoms - φ replaced with φ - (φ ψ) replaced with φ ψ - (φ ψ) replaced with φ ψ Step 3: Distribute s over s - (φ (ψ χ)) replaced by ((φ ψ) (φ χ)) CSE560 Class 10: 12 c P. Heeman, 2010 Example a (b c (d e)) a (b c (d e)) a (b c ( d e)) a (b c ( d e)) a (b (c ( d e))) a (b (c ( d e))) a (b ((c d) (c e))) a ((b (c d)) (b (c e))) a (b c d) (b c e)

CSE560 Class 10: 13 c P. Heeman, 2010 Conjunctive Normal Form Convert all clause into conjunctive normal form - Can view the literals as a set + Duplicates are removed + a b c c + a b c c + {a, b, c} Our KB is now a set of clauses, where each clause is a set of literals CSE560 Class 10: 14 c P. Heeman, 2010 Overview Integrity Constraints Disjunctive & Negative Knowledge Resolution Rule Bottom-Up Proof by Refutation Top-Down

CSE560 Class 10: 15 c P. Heeman, 2010 Resolution Rule Resolution Rule - Resolvent A includes a - Resolvent B includes b - a and b can be unified - σ is the MGU of a and b - Let A be A with a removed, and σ applied - Let B be B with b removed, and σ applied - Resolvent is A B CSE560 Class 10: 16 c P. Heeman, 2010 Examples {a, b, c} with {d, c,b} {a(x),b(x,y ), c(y )} with { b(z,z),c(a)}

CSE560 Class 10: 17 c P. Heeman, 2010 Integrity Constraints Overview Disjunctive & Negative Knowledge Resolution Rule Bottom-Up Proof by Refutation Top-Down CSE560 Class 10: 18 c P. Heeman, 2010 Bottom Up Proof Procedure (Section 7.5) Find set of minimal truths Set C to KB Repeat: + Pull two clauses from C + Apply resolution rule if you can, giving R + If R contains A and A, skip R, since trivally true + If there is an R C such that R R, skip R, since already implied + If there are any R C such that R R, remove R since now implied by R Consequent set no longer just has atoms in it, but can have any arbitrary clause in disjunctive normal form - But still just has minimal truths in it

CSE560 Class 10: 19 c P. Heeman, 2010 Queries to Bottom-Up Proof Procedure Query can be disjunction of positive or negative literals - For previous bottom-up procedure, was just a single positive literal Write query as a set of literals - If query contains A and A obviously true + Since one of them is true in any model, so disjunction true in all models - If there is a member e of C and a substitution σ such that eσ is a subset of the query, then the query is true Is it sound and complete? CSE560 Class 10: 20 c P. Heeman, 2010 Example I false a b a c b c? c

CSE560 Class 10: 21 c P. Heeman, 2010 (a b) c e c b d (a b) d e a Example II a c CSE560 Class 10: 22 c P. Heeman, 2010 Overview Integrity Constraints Disjunctive & Negative Knowledge Resolution Rule Bottom-Up Proof by Refutation Top-Down

CSE560 Class 10: 23 c P. Heeman, 2010 Horne Clauses and Resolution (not in textbook) What is so special about Horne clauses? - More powerful than Datalog - And an efficient search solution for false If KB = {} - Where {} represents the empty clause, which is the same as false - Means KB has no model, which means it is inconsistent So if we want to prove q (where q is a literal) - Same as proving KB = q - If this is the case, what would happen if we add q into KB? CSE560 Class 10: 24 c P. Heeman, 2010 Inconsistencies KB = q is true if KB { q} = false Given a KB, there is an efficient way to see if it is inconsistent

CSE560 Class 10: 25 c P. Heeman, 2010 Unit Resolution Pick two resolvents where one of them is a unit clause - This is a restricted bottom-up proof procedure Unit Resolution always halts - For Horne Clauses & no functions - Proof + Let the largest clause in KB have k literals + Results always have fewer than k literals + Finite number legal literals + Finite number of results that Unit resolution can find We say it is refutation complete CSE560 Class 10: 26 c P. Heeman, 2010 Overview Integrity Constraints Disjunctive & Negative Knowledge Resolution Rule Bottom-Up Proof by Refutation Top-Down

CSE560 Class 10: 27 c P. Heeman, 2010 Top Down Proof Procedure Start with query, which is a conjunction of literals - yes p 1... p i p i+1... p n - For previous top-down procedure, it was conjunction of positive literals Turn into disjunctive normal form - {yes, p 1,..., p i,p i+1,...,p n } Use resolution rule to derive new answer clauses - Attack first non-yes literal in answer clause - Stop when just yes in answer clause CSE560 Class 10: 28 c P. Heeman, 2010 A problem Consider KB a b c a into disjunctive normal form c b Proof?c yes c Use c a yes a Use a b yes b Use c b yes c - Now what? a b c a c b

CSE560 Class 10: 29 c P. Heeman, 2010 Negative Ancester Rule Can view proof as + adding original answer clause KB + and trying to prove yes by itself So, should be sound to resolve answer clause with a previous answer clause + Didn t need to do this for Datalog as it did not need this to make proof procedure complete + But we do need this ability here Proof?c yes c Use c a from KB yes a Use a b from KB yes b yes c yes Use c b from KB Use yes c from prior answer clause in proof CSE560 Class 10: 30 c P. Heeman, 2010 Disjunctive Answers KB p(x) q(x) q(a) q(b) p(x) q(x) q(a) q(b) Query p(x) - yes, with either X = a or X = b, but you don t know which - Very different from answer that it has two solutions, one with X = a and another with X = b + Which you would have gotten if q(a) and q(b) was replaced with q(a) q(b) We would like proof procedure to find yes(a) yes(b)

CSE560 Class 10: 31 c P. Heeman, 2010 Solution Top-down proof procedure - Add answer clause to KB + We might need to use it several times - Start with answer clause as usual + (Slightly different from textbook) - Use a delaying reasoning procedure, that delays literals of form yes(x) CSE560 Class 10: 32 c P. Heeman, 2010 Example KB p(x) q(x) p(x) q(x) q(a) q(b) q(c) into disjunctive normal form q(a) q(b) q(c) yes(x) p(x) yes(x) p(x) Proof Answer Clause How yes(x) p(x) yes(x) p(x) yes(x) q(x) p(x) q(x) yes(a) q(b) q(c) q(a) q(b) q(c) yes(a) p(b) q(c) p(x) q(x) yes(a) yes(b) q(c) yes(x) p(x) yes(a) yes(b) p(c) p(x) q(x) yes(a) yes(b) yes(c) yes(x) p(x)