Knowledge Based Systems

Slides:



Advertisements
Similar presentations
CS4026 Formal Models of Computation Part II The Logic Model Lecture 1 – Programming in Logic.
Advertisements

Simply Logical – Chapter 2© Peter Flach, 2000 Clausal logic Propositional clausal logic Propositional clausal logic expressions that can be true or false.
Some important properties Lectures of Prof. Doron Peled, Bar Ilan University.
1 A formula in predicate logic An atom is a formula. If F is a formula then (~F) is a formula. If F and G are Formulae then (F /\ G), (F \/ G), (F → G),
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.
First Order Logic Resolution
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Logic Use mathematical deduction to derive new knowledge.
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
Logic Concepts Lecture Module 11.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
CS5371 Theory of Computation
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Knoweldge Representation & Reasoning
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Introduction to Logic for Artificial Intelligence Lecture 1 Erik Sandewall 2010.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
EE1J2 – Discrete Maths Lecture 5 Analysis of arguments (continued) More example proofs Formalisation of arguments in natural language Proof by contradiction.
I NTRO TO L OGIC Dr Shlomo Hershkop March
CPS 170: Artificial Intelligence Propositional Logic Instructor: Vincent Conitzer.
CSNB234 ARTIFICIAL INTELLIGENCE
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
Marriage Problem Your the sovereign in a small kingdom. One of your jobs is to marry off the people in kingdom. There are three rules that apply.
Pattern-directed inference systems
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
The AI War LISP and Prolog Basic Concepts of Logic Programming
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
6/11/2016 Linear Resolution and Introduction to First Order Logic Michael Leuschel Softwaretechnik und Programmiersprachen Lecture 5.
Notions & Notations - 1ICOM 4075 (Fall 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Fall 2010 ICOM.
Chapter 1 Logic and Proof.
Chapter 1 Logic and Proof.
Chapter 7. Propositional and Predicate Logic
Logic and Reasoning.
Introduction to Computing Science and Programming I
Copyright © Cengage Learning. All rights reserved.
Introduction to Logic for Artificial Intelligence Lecture 2
Instructor: Vincent Conitzer
Knowledge Representation and Reasoning
ARTIFICIAL INTELLIGENCE
Proposition & Predicates
Chapter 3 The Real Numbers.
Introduction to Logic for Artificial Intelligence Lecture 1
Great Theoretical Ideas in Computer Science
CMU Graduate Complexity Lecture 20
Truth Tables Hurley
Truth Trees.
Logic Use mathematical deduction to derive new knowledge.
Propositional Logic.
CS 416 Artificial Intelligence
Resolution Proofs for Combinational Equivalence
Back to “Serious” Topics…
CPS 570: Artificial Intelligence Logic
Logical Entailment Computational Logic Lecture 3
Artificial Intelligence
CSNB234 ARTIFICIAL INTELLIGENCE
Bottom Up: Soundness and Completeness
Bottom Up: Soundness and Completeness
CS621 : Artificial Intelligence
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Artificial Intelligence Propositional Logic
CSNB234 ARTIFICIAL INTELLIGENCE
CPS 570: Artificial Intelligence Logic
Algorithms CSCI 235, Spring 2019 Lecture 37 The Halting Problem
Bottom Up: Soundness and Completeness
Presentation transcript:

Knowledge Based Systems (CM0377) Lecture 5 (Last modified 8th February 2001)

Resolution (again!) Suppose we have two clauses: A; A1,1; ...; A1,i:-B1,1, ..., B1,j A2,1; ...; A2,k:-B2,1, ..., B2,m, A We select a literal to resolve on, which appears in the head of one clause and body of the other - in this case, w.l.o.g., A The resolvent is A1,1; ...; A1,i; A2,1; ...; A2,k :- B1,1, ..., B1,j, B2,1, ..., B2,m except that if a literal occurs in the head of both clauses, it occurs only once in the resolvent; similarly if it occurs in the body

Simple example Resolve: on umbrella to get: get_wet; umbrella:-rain :-umbrella on umbrella to get: get_wet:-rain (In other words, if it rains either you have an umbrella or you get wet; you don’t have an umbrella, so the consequence is that if it rains you get wet!)

Another simple example Resolve: get_wet:-rain rain:-get_wet on rain to get: get_wet:-get_wet (If it rains you get wet; if you get wet it rains. The resolvent is a tautology, in that it is true in every interpretation) Could also resolve on get_wet to obtain: rain:-rain

Resolution - another example We saw that resolvent of: happy:-boy, has_football. has_football; impoverished:-boy, good_footballer. Is: happy; impoverished:-boy, good_footballer. We write P ├ C. But is it true that P╞ C ? } P } C

Is it a logical consequence? It’s a logical consequence if all models of P are also models of C. Models of P are: {happy, has_football} {happy, impoverished} {boy} We need to draw a kind of truth table ...

happy. boy. has_football. impoverished. good_footballer. model of P happy boy has_football impoverished good_footballer model of P model of C f f f f f t t f f f f t t t f f f t f t t f f f t t t t f f t f f t t f f t f t t t f f t t f t t f f t t t t t f t f f f t t f t f f t f f f t f t f t t f t f t t t t f t t f f f t f t t f t f f f t t t f f t f t t t t f t t f f f f t t t f f f t t t t f f t f t t t f f t t t t t f t f f t t t f t f t t t t f t t f t t t f t t t t t t t f f f t t t t f f t f t t t f t f t t t t f t t t t t t t f f t t t t t f t t t t t t t f t t t t t t t t t

happy. boy. has_football. impoverished. good_footballer. model of P happy boy has_football impoverished good_footballer model of P model of C f t f f t f f f t t f f f t f t t f t f f f t t t f f t f t t t t f t t t f f t f t

Our conclusions so far In this particular case, it happens to be true that P╞ C Thus far we have a technique that derives new clauses that we would then have to check to see if they were logical consequences. Wouldn’t it be nice if P╞ C if, and only if, P ├ C ? (Note that some models of C are not models of P. C is a logical consequence of P if it is true whenever P is true. It might be true at other times too.)

The two questions ... Is resolution sound? (Does it produce only clauses that are logical consequences?) Is resolution complete? (Does it produce all clauses that are logical consequences, given sufficient time?)

Soundness Consider the following two clauses taken from a program P, to which we’re going to apply resolution: A; A1,1; ...; A1,i:-B1,1, ..., B1,j A2,1; ...; A2,k:-B2,1, ..., B2,m, A If an interpretation is a model for the program to which they belong, then it must be a model for both these clauses

Soundness (ctd.) has resolvent (ignoring elimination of duplicates): A; A1,1; ...; A1,i:-B1,1, ..., B1,j (i) A2,1; ...; A2,k:-B2,1, ..., B2,m, A (ii) has resolvent (ignoring elimination of duplicates): A1,1; ...; A1,i; A2,1; ...; A2,k :-B1,1, ..., B1,j, B2,1, ..., B2,m If, in a model M of the program, A is true, then at least one of B2,1,...,B2,m must be false, or at least one of A2,1,...A2,k must be true, else it’s not a model of clause (ii). So M is a model of the resolvent. Similarly if, in model M of the program, A is false, at least one of A1,1,...A1,i must be true, or at least one of B1,1,...,B1,j must be false, so M is a model of the resolvent.

Soundness (ctd.) In other words, we have shown that ... ... Every model of the clauses being resolved is also a model of the resolvent Therefore if P ├ C it is also true that P╞ C Also, as each individual resolution step is sound, it follows that a sequence of them is too. So we can have a proof of more than one step.

Completeness Proving completeness will tend to be more difficult than proving soundness, and will prove particularly difficult for resolution because ... ... resolution isn’t complete! It’s easy to prove it isn’t, by a counter-example.

Counter-example Consider the program: and the tautology a:-a clearly you can’t derive this clause from the above program.

But ... Resolution is refutation complete, i.e. we can use it to show that some particular clause C is a logical consequence of a program P, if it is. The idea is proof-by-refutation. Informally, we assume the opposite of what we are trying to prove, then show that this leads to a contradiction.

Refutation So suppose we want to prove that C is a consequence of P, and C is of the form: A1; ...; An :- B1, ..., Bm then M is a model of C if and only if it is not a model of: B1 :- ... Bm :- :- A1 :- An (Because any model of C assigns at least one of the A’s to true or one of the B’s to false; similarly any model of the new set of clauses must assign all the B’s to true and all the A’s to false, so not a model of the old clause)

Proof by refutation To prove C is a logical consequence of a program P, ‘negate’ C and prove that P and the negated form of C are mutually inconsistent, i.e. have no common model. Note that the empty clause is a logical consequence of an inconsistent set of clauses (‘every model’ means none at all!) Conversely if is a logical consequence of a set of clauses, they must be inconsistent

Resolution is refutation complete If a set of clauses is inconsistent, it is always possible to derive the empty clause by resolution. (Proof outside scope of this course: basic idea is to define a measure ‘excess literals’, equal to the number of clauses subtracted from the number of literal occurrences; prove the assertion is true for no excess literals and prove that if it’s true for n excess literals then it’s true for n+1, i.e. inductively.)

Resolution example Suppose we have: and want to prove: dolphin:- read:-intelligent intelligent:-dolphin and want to prove: read:- negate the hypothesis: :-read

Resolution example (ctd.) And resolve: dolphin:- (i) read:-intelligent (ii) intelligent:-dolphin (iii) :-read (iv) Resolve (iv) and (ii): :-intelligent (v) Resolve (v) and (iii): :-dolphin (vi) Resolve (vi) and (i):

Resolution can’t always prove consistency If you try to prove that a program is inconsistent when it is, in fact, consistent, resolution can go on for ever. e.g. resolving :-a a:-a gives ad nauseum Semi-decidable: derives proof tree in finite time if one exists, but there is no way to ensure that an attempt to derive a non-existent tree will halt and return ‘no’. So we can write infinite Prolog loops!