Chapter 7: Beyond Definite Knowledge

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Introduction to Proofs
Biointelligence Lab School of Computer Sci. & Eng.
Logic Programming Automated Reasoning in practice.
AR for Horn clause logic Introducing: Unification.
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Standard Logical Equivalences
Resolution.
Automated Reasoning Systems For first order Predicate Logic.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
Logic Use mathematical deduction to derive new knowledge.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
RESOLUTION: A COMPLETE INFERENCE PROCEDURE. I Then we certainly want to be able to conclude S(A); S(A) is true if S(A) or R(A) is true, and one of those.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.5 [P]: Propositions and Inference Sections.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
CPSC 322 Introduction to Artificial Intelligence September 20, 2004.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Axiomatic Semantics ICS 535.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.12 [P]: Individuals and Relations Datalog.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
Introduction to Proofs
Ming Fang 6/12/2009. Outlines  Classical logics  Introduction to DL  Syntax of DL  Semantics of DL  KR in DL  Reasoning in DL  Applications.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Systems For first order Predicate Logic.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
LDK R Logics for Data and Knowledge Representation ClassL (Propositional Description Logic with Individuals) 1.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Logic: Proof procedures, soundness and correctness CPSC 322 – Logic 2 Textbook §5.2 March 7, 2011.
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.
Copyright 1999Paul F. Reynolds, Jr. Foundations of Logic Programming.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Knowledge Based Systems
Indirect Argument: Contradiction and Contraposition
Chapter 7. Propositional and Predicate Logic
CS589 Principles of DB Systems Spring 2014 Unit 2: Recursive Query Processing Lecture 2-1 – Naïve algorithm for recursive queries Lois Delcambre (slides.
Introduction to Logic for Artificial Intelligence Lecture 2
Chapter 4 (Part 1): Induction & Recursion
Computer Science cpsc322, Lecture 20
Chapter 10: Using Uncertain Knowledge
Propositional Definite Clause Logic: Syntax, Semantics, R&R and Proofs
The Propositional Calculus
Proposition & Predicates
Methods of Proof CS 202 Epp, chapter 3.
The Foundations: Logic and Proofs
Logic Use mathematical deduction to derive new knowledge.
Logic: Top-down proof procedure and Datalog
Assignment-2 due now Enterprise Architecture Conference Sat. Oct 27
CS 416 Artificial Intelligence
MA/CSSE 474 More Math Review Theory of Computation
Computer Security: Art and Science, 2nd Edition
Computational Logic Lecture 13
Logic: Domain Modeling /Proofs + Computer Science cpsc322, Lecture 22
Logical Entailment Computational Logic Lecture 3
Computer Science cpsc322, Lecture 20
Bottom Up: Soundness and Completeness
Foundations of Discrete Mathematics
Copyright © Cengage Learning. All rights reserved.
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Chapter 2: Prolog (Introduction and Basic Concepts)
Representations & Reasoning Systems (RRS) (2.2)
Proofs (2.7) (How to compute logical consequences of a KB rather that
CS589 Principles of DB Systems Fall 2008 Lecture 4e: Logic (Model-theoretic view of a DB) Lois Delcambre
Bottom Up: Soundness and Completeness
Presentation transcript:

Chapter 7: Beyond Definite Knowledge Equality Complete Knowledge Assumption Integrity Constraints D. Poole, A. Mackworth, and R. Goebel, Computational Intelligence: A Logical Approach, Oxford University Press, January 1998

Extending Definite Clause Representation: Adding Equality Sometimes it is useful to use more than one term to name a single individual. Example: Clark Kent & Superman. 4 * 4 & 11+5. The projector we used last week & this projector. We may want a separate name for different courses. Ground term t1 equals ground term t2, written t1 = t2, is true in interpretation I if t1 and t2 denote the same individual in interpretation I. Equality allows us to represent whether or not two terms denote the same individual. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Equality doesn’t mean similarity WORLD of 2 chairs chair 1  chair 2 (because of position) chair_on_right = chair 2 chair_on_right is not similar to chair2, it is chair 2. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Allowing Equality Assertions Without equality assertions, the only thing that is equal to a ground term is itself. This can be captured as though you had the assertion X = X. Explicit equality never needs to be used. If you allow equality assertions, you need to derive what follows from them. Either: axiomatize equality like any other predicate build special-purpose inference machinery for equality Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Axiomatizing Equality 1. X = X. (reflexive) X = Y  Y = X. (symmetry) X = Z  X = Y ^ Y = Z. (transitivity) 2. For each n-ary function symbol f there is a rule of the form f (X1, . . . ,Xn) = f (Y1, . . . ,Yn) (X1 = Y1) ^ … ^ (Xn = Yn). For each n-ary predicate symbol p, there is a rule of the form p(X1, . . . ,Xn) p(Y1, . . . ,Yn) ^ (X1 = Y1) ^ ... ^ (Xn = Yn). Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Special-Purpose Equality Reasoning paramodulation: if you have t1 = t2, then you can replace any occurrence of t1 by t2. Treat equality as a rewrite rule , substituting equals for equals. To do so, you can select a canonical representation (such as student number) for each individual and rewrite all other representations (occurrences) into that representation. Example: There are many terms that represent the same number, 4x4, 13+3, 273-257, 24, 42, 16 but treat the sequence of digits as the canonical representation of the number Example: use the student number as the canonical representation for students (different students with the same name can be distinguished, and different names for the same individual can be mapped to the same individual. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Unique Names Assumption (UNA) Instead of axiomatizing the equality, we better use the UNA Unique Names Assumption (UNA) The convention that different ground terms denote different individuals is the unique names assumption (UNA: false in RRS). For every pair of distinct ground terms t1 and t2, assume t1  t2, where “” means “not equal to.” Example: For each pair of courses, you don’t want to have to state, math302  psyc303, … Example: Sometimes the unique names assumption is inappropriate, for example 3 + 7  2 * 5 is wrong !!!!. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Axiomatizing Inequality for the UNA c  c’ for any distinct constants c and c’. f (X1, . . . ,Xn)  g(Y1, . . . ,Ym) for any distinct function symbols f and g. f (X1, . . . ,Xn)  f (Y1, . . . ,Yn) Xi  Yi, for any function symbol f . There are n instances of this schema for every n-ary function symbol f (one for each i such that 1  i  n). f (X1, . . . ,Xn)  c for any function symbol f and constant c. t  X for any term t in which X appears (where t is not the term X). Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Complete Knowledge Assumption (CKA) The agent’s knowledge of the world is complete Sometimes you want to assume that a database of facts is complete. Any fact not listed is false. Example: Assume that a database of enrolled relations is complete. Then you can define empty_course. The definite clause RRS is monotonic: adding clauses doesn’t invalidate a previous conclusion. With the complete knowledge assumption and the UNA, the system is nonmonotonic: a conclusion can be invalidated by adding more clauses (shown example *). Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

CKA: propositional case Suppose the rules for atom a are a  b1. . a bn. Under the CKA, if a is true in some interpretation, at least one of the bi must be true in that interpretation (if all bi’s are false then a cannot be infered which means a=false), thus: a  b1 V …V bn. Since the clauses defining a are equivalent to: a  b1 V …V bn. Under the CKA, we have: a  b1 V … V bn (if and only if) This form is the ground form of Clark’s completion of the clauses for a: Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

CKA: Ground Database if the UNA clause is added + CKA  non-monotonic Example (*): Consider the relation defined by: student(mary). student(john). student(ying). ?student(alan) “cannot conclude in RRS” The CKA specifies these three are the only students: student(X)  X = mary V X = john V X = ying. To conclude : student(alan), you have to be able to prove alan  mary ^ alan  john ^ alan  ying This needs the unique names assumption, which concludes that student(alan) = true. if the UNA clause is added + CKA  non-monotonic (monotonic means anything that could be concluded before a fact or a rule can still be concluded after it’s added) Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Clark Normal Form The Clark normal form of the clause: p(t1, … , tk)  B is the clause p(V1, … ,Vk)  W1 …  Wm V1 = t1 ^ …^ Vk = tk ^ B, where V1, … ,Vk are k different variables that did not appear in the original clause. W1, … ,Wm are the original variables in the clause. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Clark’s Completion of a Predicate Put all of the clauses for p into Clark normal form, with the same set of introduced variables: p(V1, … ,Vk)  B1 … p(V1, … ,Vk)  Bn This is the same as: p(V1, … ,Vk)  B1 V … V Bn. Clark’s completion of p is the equivalence p(V1, … ,Vk)  B1 V …V Bn, That is, p(V1, … ,Vk) is true if and only if one Bi is true. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Example For the clauses: student(mary). student(john). student(ying). The Clark normal form is: student(V) V = mary. student(V)  V = john. student(V)  V = ying. which is the same as: Student(V)  V= mary  V=john  V=ying. The completion of the “student” predicate is: student(V)  V=mary  V=john  V=ying. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Clark’s Completion of a KB Clark’s completion of a knowledge base consists of the completion of every predicate symbol, along with the axioms for equality and inequality. If you have a predicate p defined by no clauses in the knowledge base, the completion is p  false. That is,  p. You can interpret negations in the bodies of clauses. ~p means that p is false under the Complete Knowledge Assumption (p= false in all models of the completion). This is called negation as failure. (The negation  p is true in an interpretation if p is false in the interpretation.) Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Negation as failure example p  q ^ ~ r. p  s. q  ~ s. r  ~ t. t. s  w. The completion (or equivalence) of this KB is: p (q ^ r)  s. q  s. r  t t  true. s  w. w  false (negate when we fail to derive: w not in the head !). Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Using negation as failure Previously in initial RRS we couldn’t define empty_course(C) from a database of enrolled(S, C). This can be defined using negation as failure: empty_course(C)  course(C) ^ ~has_Enrollment(C). has_Enrollment(C)  enrolled(S, C). Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Other Negation Failure The following definition is incorrect: empty_course(C)  course(C) ^ ~enrolled(S,C). Proof: course(cs422). course(cs486). enrolled(mary, cs422). enrolled(sally, cs486). The clause: empty_course(cs422) course(cs422) ^ ~enrolled(sally, cs422) is an instance of this clause which leads to a contradiction! (body = true, head = false) Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Bottom-up NAF (Negation As Failure) proof procedure repeat either select “h  b1 ^ . . . ^ bm”  KB such that bi  C for all i, and h  C; C := C  {h} or select h such that for every rule “h  b1 ^ . . . ^ bm”  KB either for some bi , ~ bi  C or some bi = ~ g and g  C until no more selections are possible Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

The following is a sequence of atoms added to C: t %(fact) ~ r Consider the clauses p  q  ~ r. p  s. q  ~ s. r  ~ t. t. s  w. The following is a sequence of atoms added to C: t %(fact) ~ r ~ w %(no clauses for w under CKA) ~ s q p. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Top-Down NAF Procedure If the proof for a fails, you can conclude ~ a. Failure can be defined recursively. Suppose you have rules for atom a: a  b1 … a  bn If each body bi fails, a fails. A body fails if one of the conjuncts in the body fails. Note that you require finite failure. Example: p  p. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Example Consider the clauses p  q  ~ r. p  s. q  ~ s. r  ~ t. t. s  w. Query: ?p your first try to prove q and to fail to prove r (try to prove r, and the proof must fail before you can conclude ~ r) To prove q you try to fail to prove s To prove s you try to prove w (there are no clauses for w: so w fails), and so s fails etc. until you conclude p. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Integrity Constraints In the electrical domain, what if we predict that a light should be on, but observe that it isn’t? What can we conclude? We will expand the definite clause language to include integrity constraints which are rules that imply false, where false is an atom that is false in all interpretations. This will allow us to make conclusions from a contradiction. A definite clause knowledge base is always consistent. This won’t be true with the rules that imply false. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Horn clauses An integrity constraint is a clause of the form false  a1 ^ … ^ ak where the ai are atoms and false is a special atom that is false in all interpretations. A Horn clause is either a definite clause or an integrity constraint. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge

Integrity Constraints in Databases Database designers can use integrity constraints to specify constraints that should never be violated. Example: A student can’t have two different grades for the same course. false  Grade(St, Course, Gr1) ^ Grade(St, Course, Gr2) ^ Gr1  Gr2. When false is derived, it can be used to debug the KB. Dr. Djamel Bouchaffra CS 426 Artificial Intelligence, Ch 7: Beyond Definite Knowledge