CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.

Slides:



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

Russell and Norvig Chapter 7
Inference Rules Universal Instantiation Existential Generalization
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
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.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
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.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Resolution Theorem Proving
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
Resolution in Propositional and First-Order Logic.
Logic Concepts Lecture Module 11.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Discussion #18 1/13 Discussion #18 Resolution with Propositional Calculus; Prenex Normal Form.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
CSE (c) S. Tanimoto, 2008 Propositional Logic
Logic in Computer Science Transparency No Chapter 3 Propositional Logic 3.6. Propositional Resolution.
Inference and Resolution for Problem Solving
Logic in Computer Science Transparency No Chapter 3 Propositional Logic 3.6. Propositional Resolution 3.7. Natural Deduction.
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Chapter 3 Propositional Logic
Prop logic First order predicate logic (FOPC) Prob. Prop. logic Objects, relations Degree of belief First order Prob. logic Objects, relations.
Rutgers CS440, Fall 2003 Propositional Logic Reading: Ch. 7, AIMA 2 nd Ed. (skip )
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Propositional Resolution Computational LogicLecture 4 Michael Genesereth Spring 2005.
February 20, 2006AI: Chapter 7: Logical Agents1 Artificial Intelligence Chapter 7: Logical Agents Michael Scherger Department of Computer Science Kent.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 19, 2012.
CS1502 Formal Methods in Computer Science
1 Chapter 8 Inference and Resolution for Problem Solving.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
Automated Theorem Proving: Resolution and Davis-Putnam Intermediate Logic.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
LECTURE LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
EA C461 Artificial Intelligence
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
First-Order Logic and Inductive Logic Programming
Logical Inference: Through Proof to Truth
Propositional Calculus: Boolean Algebra and Simplification
Elementary Metamathematics
Propositional Resolution
Logic Use mathematical deduction to derive new knowledge.
Biointelligence Lab School of Computer Sci. & Eng.
Artificial Intelligence: Agents and Propositional Logic.
CS 416 Artificial Intelligence
Back to “Serious” Topics…
Biointelligence Lab School of Computer Sci. & Eng.
CS2136: Paradigms of Computation
Methods of Proof Chapter 7, second half.
Presentation transcript:

CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences

Resolution Theorem Proving Method for searching for proofs automatically Sentences are translated into CNF, and then to sets of clauses At each step, a new clause is derived from two clauses you already have Proof steps all use the same rule If reach  (_|_), sentences were not satisfiable Start: premises + negation of goal End: if reach , premises |= goal

Resolution Theorem Proving Method for searching for proofs automatically Sentences are translated into CNF, and then to sets of clauses At each step, a new clause is derived from two clauses you already have Proof steps all use the same rule If reach  (_|_), sentences were not satisfiable Start: premises + negation of goal End: if reach , premises |= goal

Conversion to Clausal Form Use P  Q equiv ~P v Q to remove  Use P  Q equiv ((~P v Q) ^ (~Q v P)) to remove  Use P  Q equiv ((~P v Q) ^ (~Q v P)) to remove  New 1st Step! We hadn’t done conditionals yet Use DeMorgan’s laws and ~Elim to move ~ as far inward as possible (gives NNF) Use the distributive laws until the sentence is in CNF

Clausal Form Given a sentence S written in CNF S = ( )  ( ) ...  ( ) Convert each ( ) into a clause - a set consisting of each of the literals in ( ). Example: S= (A)  (  B  C  D)  (  A  D) Clauses are: {A}, {  B, C, D}, {  A, D}

Resolution Theorem Proving Method for searching for proofs automatically Sentences are translated into CNF, and then to sets of clauses At each step, a new clause is derived from two clauses you already have Proof steps all use the same rule If reach  (_|_), sentences were not satisfiable Start: premises + negation of goal End: if reach , premises |= goal

Satisfying a Set of Clauses Assigning truth-values to the atomic sentences so the CNF sentence the set corresponds to is true. {{A,  C, D}, {C},{  A},{A, D}} is satisfied by {{A,  C, D}, {C},{  A},{A, D}} is satisfied by A = False C = True D = True A = False C = True D = True

Empty Clause {} denoted by . The empty clause is not satisfiable We want {{A}, {  A}} to lead to {} (  ) The basic resolution step involves “canceling” pos and neg matching literals from two clauses So, we derive {} (  ) from {{A}, {  A}}

Example: not satisfiable  P  Q P  Q {  P, Q} {P} {  Q} {  P, Q} {P} {  Q}

Resolution Theorem Proving Method for searching for proofs automatically Sentences are translated into CNF, and then to sets of clauses At each step, a new clause is derived from two clauses you already have Proof steps all use the same rule If reach  (_|_), sentences were not satisfiable Start: premises + negation of goal End: if reach , premises |= goal

Resolution Step

Res. Step with Larger Clauses

Resolvent Clause R is a resolvent of clauses C 1 and C 2 if there is a literal in C 1 whose negation is in C 2 and R consists of all the remaining literals in either clause. Example: {A, C,  D} and {B,  C} have resolvent { A, B,  D }

Resolution Theorem Proving Method for searching for proofs automatically Sentences are translated into CNF, and then to sets of clauses At each step, a new clause is derived from two clauses you already have Proof steps all use the same rule If reach  (_|_), sentences were not satisfiable Start: premises + negation of goal End: if reach , premises |= goal

Resolution Theorem For any set of clauses that are not satisfiable, it is possible to arrive at the empty clause by using successive resolutions.

Resolution Theorem Proving Method for searching for proofs automatically Sentences are translated into CNF, and then to sets of clauses At each step, a new clause is derived from two clauses you already have Proof steps all use the same rule If reach  (_|_), sentences were not satisfiable Start: premises + negation of goal End: if reach , premises |= goal

Using Resolution to Determine Validity of Arguments Q is a logical consequence of P1, P2, …, Pn iff P1 ^ P2 ^ … ^ Pn ^ ~Q is not satisfiable For sentences in clausal form: Q is a logical consequence of a set of clauses S iff S  {  Q} is not satisfiable. So, convert premises + negation of goal to clausal form, and do resolution steps, trying to reach {} ( )

Is this Argument Valid? B v C ~C v ~D A v D ~B v ~D A

Example Show  A  (B  C)  (  C   D)  (A  D)  (  B   D) is not satisfiable. Clauses: {  A}, {B, C}, {  C,  D}, {A, D}, {  B,  D}. {  A} {A,D} {B,C} {  C,  D} {D} {B,  D} {  B,  D} {  D} 

Example Modus Pones P  Q  P  Q or {  P,Q} P {P} Q negate to get {  Q} Apply resolution: {  P,Q} {P} {Q} {  Q} 

What is a Horn sentence? A positive literal is any literal that is not preceded with a . For example, Cube(b) and P are positive literals. A sentence S is a Horn sentence if and only if it is in CNF and every conjunct has at most one positive literal.

Examples (A   B   C)  (  A   B) (A   B  C)  (D) (A  B)  (  C   D) Horn sentence Not Horn sentence (A   C)  (B   C)  (A   D)  (B   D) Horn sentence

Alternate Form of Horn Conjunct  A 1   A 2 ...   A n  B  (A 1  A 2 ...  A n )  B (A 1  A 2 ...  A n )  B Conditional Form of Horn sentence B :- A 1, A 2, …, A n. In Prolog: Rule B if A 1, A 2, …, A n

Special Cases No positive literal  A 1   A 2 ...   A n No negative literals B (A 1  A 2 ...  A n )  False True  B In Prolog, this is a fact! In Prolog, this is a query!

Why are Horn sentences important? Very efficient algorithms exist for determining if a set of Horn sentences is satisfiable

CNF to PROLOG  A  B   C is  (A  C)  B is (A  C)  B B :- A, C. A. C. Query: :- B. Answer: Yes.

Example Prolog Program grandfather(X,Y) :- father(X,Z), father(Z,Y). grandfather(X,Y) :- father(X,Z), mother(Z,Y). mother(ann,bill). father(carl,ed). father(nick,ann). father(ed,sam).