Resolution (14A) Young W. Lim 8/15/14

Similar documents
Logic Background (1A) Young W. Lim 5/14/18

Logic Background (1A) Young W. Lim 12/14/15

First Order Logic (1A) Young W. Lim 11/5/13

Logic (3A) Young W. Lim 11/2/13

Logic (3A) Young W. Lim 10/31/13

Logic (3A) Young W. Lim 10/29/13

First Order Logic (1A) Young W. Lim 11/18/13

Propositional Logic Resolution (6A) Young W. Lim 12/12/16

Propositional Logic Arguments (5A) Young W. Lim 11/30/16

Propositional Logic Resolution (6A) Young W. Lim 12/31/16

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

Propositional Logic Logical Implication (4A) Young W. Lim 4/21/17

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

First Order Logic Implication (4A) Young W. Lim 4/6/17

Propositional Logic (2A) Young W. Lim 11/8/15

First Order Logic Arguments (5A) Young W. Lim 2/24/17

Propositional Logic Logical Implication (4A) Young W. Lim 4/11/17

Propositional Logic Arguments (5A) Young W. Lim 2/23/17

First Order Logic Arguments (5A) Young W. Lim 3/10/17

Propositional Logic Arguments (5B) Young W. Lim 11/30/16

Propositional Logic Arguments (5A) Young W. Lim 11/29/16

Advanced Topics in LP and FP

Propositional Logic Not Enough

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

First Order Logic Semantics (3A) Young W. Lim 8/9/17

Logic (3A) Young W. Lim 12/5/13

It rains now. (true) The followings are not propositions.

First Order Logic Semantics (3A) Young W. Lim 9/17/17

THE LOGIC OF COMPOUND STATEMENTS

Resolution (7A) Young Won Lim 4/21/18

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

The Logic of Compound Statements cont.

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Manual of Logical Style

(Refer Slide Time: 02:20)

03 Propositional Logic II

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference)

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

Propositional Logic: Methods of Proof (Part II)

Deductive Systems. Lecture - 3

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

Language of Propositional Logic

Manual of Logical Style (fresh version 2018)

Artificial Intelligence Chapter 7: Logical Agents

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Logical Agent & Propositional Logic

Propositional Logic Part 1

Rules Build Arguments Rules Building Arguments

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Propositional Logic: Review

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference

Learning Goals of CS245 Logic and Computation

Propositional Logic Review

8. Reductio ad absurdum

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

8. Reductio ad absurdum

Inference in Propositional Logic

Logic - recap. So far, we have seen that: Logic is a language which can be used to describe:

Logical Agents (I) Instructor: Tsung-Che Chiang

Chapter 1 Elementary Logic

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

Proof strategies, or, a manual of logical style

HANDOUT AND SET THEORY. Ariyadi Wijaya

Inference in first-order logic

Supplementary Logic Notes CSE 321 Winter 2009

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Knowledge based Agents

15414/614 Optional Lecture 1: Propositional Logic

Logical agents. Chapter 7. Chapter 7 1

Introduction to Metalogic

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

7 LOGICAL AGENTS. OHJ-2556 Artificial Intelligence, Spring OHJ-2556 Artificial Intelligence, Spring

A Quick Lesson on Negation

Logical Agent & Propositional Logic

Propositional Logic. Fall () Propositional Logic Fall / 30

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

AI Programming CS S-09 Knowledge Representation

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/33

Proseminar on Semantic Theory Fall 2013 Ling 720 Propositional Logic: Syntax and Natural Deduction 1

Announcements CompSci 102 Discrete Math for Computer Science

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

Logic. Propositional Logic: Syntax

CS 380: ARTIFICIAL INTELLIGENCE

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

Formal Logic. Critical Thinking

Logic. (Propositional Logic)

Propositional Logic. Spring Propositional Logic Spring / 32

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

Logic and Inferences

cis32-ai lecture # 18 mon-3-apr-2006

Propositional Resolution Introduction

4 Derivations in the Propositional Calculus

CS 771 Artificial Intelligence. Propositional Logic

(ÀB Ä (A Â C)) (A Ä ÀC) Á B. This is our sample argument. Formal Proofs

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Transcription:

Resolution (14A) Young W. Lim

Copyright (c) 2013-2014 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". based on the following document: http://www.learnprolognow.org/ Learn Prolog Now! Please send corrections (or suggestions) to youngwlim@hotmail.com. This document was produced by using LibreOffice/OpenOffice. Resolution (14A) 2

Proposition In Aristotelian logic a proposition is a particular kind of sentence, one which affirms or denies a predicate of a subject. In formal logic a proposition is considered as objects of a formal language. A formal language begins with different types of symbols. From Old French, from Latin prōpositiō ( a proposing, design, theme, case ). The content of an assertion that may be taken as being true or false and is considered abstractly without reference to the linguistic sentence that constitutes the assertion. Propositional logic includes only operators and propositional constants as symbols in its language. The propositions in this language are propositional constants (considered atomic propositions), and composite propositions, (recursive application of operators to propositions). Predicate logic include variables, operators, predicate and function symbols, and quantifiers as symbols in their languages. The propositions in these logics are more complex. Resolution (14A) 3

Predicate (grammar) The part of the sentence (or clause) which states something about the subject or the object of the sentence. "The dog barked very loudly" the subject is "the dog" the predicate is "barked very loudly". (logic) A term of a statement, where the statement may be true or false depending on whether the thing referred to by the values of the statement's variables has the property signified by that (predicative) term. From Middle French predicate (French prédicat), from post-classical Late Latin praedicatum ( thing said of a subject ), a noun use of the neuter past participle of praedicare ( proclaim ), as Etymology 2, below. From Latin predicātus, perfect passive participle of praedicō, from prae + dicō ( declare, proclaim ), from dicō ( say, tell ). Resolution (14A) 4

Premise A premise : an assumption that something is true. an argument requires a set of (at least) two declarative sentences ("propositions") known as the premises along with another declarative sentence ("proposition") known as the conclusion. From Middle English, from Old French premisse, from Medieval Latin premissa ( set before ) (premissa propositio ( the proposition set before )), feminine past participle of Latin praemittere ( to send or put before ), from prae- ( before ) + mittere ( to send ). two premises and one conclusion : the basic argument structure Because all men are mortal and Socrates is a man, Socrates is mortal. 2 premises 1 conclusion 3 propositions Resolution (14A) 5

Valid Argument Forms (Propositional) Modus ponens (MP) If A, then B A Therefore, B Modus tollens (MT) If A, then B Not B Therefore, not A Hypothetical syllogism (HS) If A, then B If B, then C Therefore, if A, then C Disjunctive syllogism (DS) A or B Not A Therefore, B Modus ponens (Latin) the way that affirms by affirming" Modus tollens (Latin) "the way that denies by denying" Syllogism (Greek: συλλογισμός syllogismos) "conclusion," "inference" Resolution (14A) 6

Modus Ponens The Prolog resolution algorithm based on the modus ponens form of inference a general rule the major premise and a specific fact the minor premise All men are mortal Socrates is a man Socrates is mortal rule fact modus ponendo ponens (Latin) the way that affirms by affirming"; often abbreviated to MP or modus ponens P implies Q; P is asserted to be true, so therefore Q must be true one of the accepted mechanisms for the construction of deductive proofs that includes the "rule of definition" and the "rule of substitution" Facts Rules Conclusion a a b b a b :- a b Facts Rules Conclusion man( Socrates ). mortal(x) :- man(x). mortal( Socrates ). Resolution (14A) 7

Syllogism (1) A syllogism (Greek: συλλογισμός syllogismos "conclusion," "inference") is a kind of logical argument that applies deductive reasoning to arrive at a conclusion based on two or more propositions that are asserted or assumed to be true. In its earliest form, defined by Aristotle, from the combination of a general statement (the major premise) and a specific statement (the minor premise), a conclusion is deduced. For example, knowing that all men are mortal (major premise) and that Socrates is a man (minor premise), we may validly conclude that Socrates is mortal. rule fact rule fact Resolution (14A) 8

Syllogism (2) A categorical syllogism consists of three parts: Major premise: Minor premise: Conclusion: All humans are mortal. All Greeks are humans. All Greeks are mortal. major term minor term (the predicate of the conclusion) (the subject of the conclusion) Each part - a categorical proposition - two categorical terms In Aristotle, each of the premises is in the form "All A are B" universal proposition "Some A are B" particular proposition "No A are B" universal proposition "Some A are not B" particular proposition Each of the premises has one term in common with the conclusion: this common term is called a major term in a major premise (the predicate of the conclusion) a minor term in a minor premise (the subject of the conclusion) Mortal is the major term, Greeks is the minor term. Humans is the middle term Resolution (14A) 9

Modus Ponens (revisited) Facts Rules Conclusion a a b b a b :- a b minor term major term Resolution (14A) 10

Derivation A reversed modus ponens is used in Prolog Prolog tries to prove that a query (b) is a consequence of the database content (a, a b). Using the major premise, it goes from b to a, and using the minor premise, from a to true. b :- a Such a sequence of goals is called a derivation. A derivation can be finite or infinite. a true Facts Rules Conclusion a a b b a b :- a b Facts Rules Conclusion a b :- a b Resolution (14A) 11

Horn Clause the resolvent of two Horn clauses is itself a Horn clause the resolvent of a goal clause and a definite clause is a goal clause These properties of Horn clauses can lead to greater efficiencies in proving a theorem (represented as the negation of a goal clause). Propositional Horn clauses are also of interest in computational complexity, where the problem of finding truth value assignments to make a conjunction of propositional Horn clauses true is a P-complete problem (in fact solvable in linear time), sometimes called HORNSAT. (The unrestricted Boolean satisfiability problem is an NP-complete problem however.) Satisfiability of first-order Horn clauses is undecidable. By iteratively applying the resolution rule, it is possible to tell whether a propositional formula is satisfiable to prove that a first-order formula is unsatisfiable; this method may prove the satisfiability of a first-order formula, but not always, as it is the case for all methods for first-order logic Resolution (14A) 12

Definite Clause clause : a disjunction of literals Horn clause : a clause with at most one positive (unnegated) literal (0, 1) definite clause : a Horn clause with exactly one positive literal (1) fact : a definite clause with no negative literals but with one positive literal only (1) goal clause : a Horn clause without a positive literal (0) Dual-Horn clause : a clause with at most one negated literal Disjunction form Implication form Definite clause p q... t u u p q... t Fact u u Goal clause p q... t false p q... t assume that u holds if p and q and... and t all hold assume that u holds show that p and q and... and t all hold Resolution (14A) 13

Resolution Resolution is a rule of inference leading to a refutation theorem-proving technique for sentences in propositional logic and first-order logic. By iteratively applying the resolution rule, it is possible to tell whether a propositional formula is satisfiable to prove that a first-order formula is unsatisfiable; this method may prove the satisfiability of a first-order formula, but not always, as it is the case for all methods for first-order logic Resolvent : the clause produced by a resolution rule A simple example a b, a c b c Suppose a is false. In order for the premise a b to be true, b must be true. Suppose a is true. In order for the premise a c to be true, c must be true. Therefore regardless of falsehood or veracity of a, if both premises hold, then the conclusion b c is true. Resolution (14A) 14

Refutation Refute To prove (something) to be false or incorrect. To deny the truth or correctness of (something). Reductio ad absurdum Latin: "reduction to absurdity"; pl.: reductiones ad absurdum also known as argumentum ad absurdum Latin: argument to absurdity is a common form of argument which seeks to demonstrate that a statement is true by showing that a false, untenable, or absurd result follows from its denial, or in turn to demonstrate that a statement is false by showing that a false, untenable, or absurd result follows from its acceptance. Resolution (14A) 15

SLD Resolution The SLD (Selective Linear Definite clause) resolution SLD stands for Linear resolution with a Selection function for Definite clauses definite clauses are just another name for Prolog clauses. "L" stands for the fact that a resolution proof can be restricted to a linear sequence of clauses: C 1, C 2,, C i, C i+1,, C l where the "top clause" C 1, is an input clause, and every other clause C i+1, is a resolvent one of whose parents is the previous clause C i The proof is a refutation if the last clause C l, is the empty clause. In SLD, all of the clauses in the sequence are goal clauses, and the other parent is an input clause in the given set of definite clauses S. In SL resolution, the other parent is either an input clause or an ancestor clause earlier in the sequence. In both SL and SLD, "S" stands for the fact that the only literal resolved upon in any clause C i, is one that is uniquely selected by a selection rule or selection function. In SL resolution, the selected literal is restricted to one which has been most recently introduced into the clause. In the simplest case, such a last-in-first-out selection function can be specified by the order in which literals are written, as in Prolog. However, the selection function in SLD resolution is more general than in SL resolution and in Prolog. There is no restriction on the literal that can be selected. Resolution (14A) 16

SLD vs SL Resolution (1) Disjunction form Implication form Definite clause p q... t u u p q... t Fact u u Goal clause p q... t false p q... t S: given a set of definite clauses C C C C i+ C 1 2 i 1 In SLD, all of the clauses in the sequence are goal clauses, and the other parent is an input clause in the given set of definite clauses S. l In SL resolution, the other parent is either an input clause or an ancestor clause earlier in the sequence. S: given a set of definite clauses C C C C i+ C 1 2 i 1 l http://www.doc.ic.ac.uk/~rak/papers/history.pd f Resolution (14A) 17

SLD vs SL Resolution (2) Disjunction form Implication form Definite clause p q... t u u p q... t Fact u u Goal clause p q... t false p q... t G1, G2,..., Gi,..., Gm H :- B1,..., Bn G1, G2,..., B1,..., Bn,..., Gm selection In both SL and SLD, "S" stands for the fact that the only literal resolved upon in any clause C i, is one that is uniquely selected by a selection rule or selection function. In SL resolution, the selected literal is restricted to one which has been most recently introduced into the clause. In the simplest case, such a last-in-first-out selection function can be specified by the order in which literals are written, as in Prolog. However, the selection function in SLD resolution is more general than in SL resolution and in Prolog. There is no restriction on the literal that can be selected. http://www.doc.ic.ac.uk/~rak/papers/history.pd f Resolution (14A) 18

Satisfiability A formula is satisfiable if it is possible to find an interpretation (model) that makes the formula true. A formula is valid if all interpretations make the formula true. A formula is unsatisfiable if none of the interpretations make the formula true A formula is invalid if some such interpretation makes the formula false. φ is valid if and only if φ is unsatisfiable it is not true that φ is satisfiable. φ is satisfiable if and only if φ is invalid. satisfiability is decidable for propositional formulae. satisfiability is an NP-complete problem Satisfiability is undecidable and indeed it isn't even a semidecidable property of formulae in first-order logic (FOL). This fact has to do with the undecidability of the validity problem for FOL. Resolution (14A) 19

Logic Programming (p q... t) u to show u, show p and show q and... and show t. u (p q... t) u :- p, q,..., t. X (p q... t) X (false p q... t) :- p, q,..., t. the resolution of a goal clause with a definite clause to produce a new goal clause is the basis of the SLD resolution inference rule a definite clause behaves as a goal-reduction procedure the negation of a problem to be solved as a goal clause. the problem of solving the existentially quantified conjunction of positive literals is represented by negating the problem (denying that it has a solution) Solving the problem amounts to deriving a contradiction, which is represented by the empty clause (or "false"). The solution of the problem is a substitution of terms for the variables in the goal clause, which can be extracted from the proof of contradiction. The Prolog notation is actually ambiguous, and the term goal clause is sometimes also used ambiguously. The variables in a goal clause can be read as universally or existentially quantified, and deriving false can be interpreted either as deriving a contradiction or as deriving a successful solution of the problem to be solved. Resolution (14A) 20

Resolution Algorithm Resolvent : a conjunction of current goals to prove (initially Q) The resolution algorithm selects a goal from the resolvent searches a clause in the database replaces the goal with the body of the clause. whose head unifies with the goal. The resolution loop replaces successively goals of the resolvent until they all reduce to true and the resolvent becomes empty. a success with a possible instantiation of the query goal Q', the final substitution is the composition of all the MGUs involved in the resolution restricted to the variables of Q. a failure if no rule unifies with the goal. Refutation: This type of derivation, which terminates when the resolvent is empty Resolution (14A) 21

A Resolution Algorithm Initialization Most General Unifier Initialize Resolvent to Q, the initial goal of the resolution algorithm. Initialize the final substitution σ to {} Initialize failure to false G1, G2,..., Gi,..., Gm Loop with Resolvent = G1, G2,..., Gi,..., Gm while (Resolvent ) { H :- B1,..., Bn 1. Select the goal Gi Resolvent; 2. If Gi == true, delete it and continue; G1, G2,..., B1,..., Bn,..., Gm 3. Select the rule H :- B1,..., Bn in the database such that Gi and H unify with the MGU θ. If there is no such a rule then set failure to true; break; 4. Replace Gi with B1,..., Bn in Resolvent % Resolvent = G1,...,Gi 1, B1,...,Bn, Gi+1,..., Gm 5. Apply θ to Resolvent and to Q; 6. Compose σ with θ to obtain the new current σ; %the final substitution } Resolution (14A) 22

Lists Each goal in the resolvent (in the body of a rule) must be different from a variable. Otherwise, this goal must be instantiated to a nonvariable term before it is called. The call/1 built-in predicate then executes it as in the rule: daughter(x, Y) :- mother(y, X), G = female(x), call(g). where call(g) solves the goal G just as if it were female(x). In fact, Prolog automatically inserts call/1 predicates when it finds that a goal is a variable. G is thus exactly equivalent to call(g), and the rule can be rewritten more concisely in: daughter(x, Y) :- mother(y, X), G = female(x), G. Resolution (14A) 23

Resolution (14A) 24

References [1] en.wikipedia.org [2] en.wiktionary.org [3] U. Endriss, Lecture Notes : Introduction to Prolog Programming [4] http://www.learnprolognow.org/ Learn Prolog Now! [5] http://www.csupomona.edu/~jrfisher/www/prolog_tutorial [6] www.cse.unsw.edu.au/~billw/cs9414/notes/prolog/intro.html [7] www.cse.unsw.edu.au/~billw/dictionaries/prolog/negation.html [8] http://ilppp.cs.lth.se/, P. Nugues, An Intro to Lang Processing with Perl and Prolog Resolution (14A) 25 Young W. Lim