Lecture 8: Resolution theorem-proving



Similar documents
AUTOMATED REASONING SLIDES 3: RESOLUTION The resolution rule Unification Refutation by resolution Factoring Clausal Form and Skolemisation

Predicate Logic. Example: All men are mortal. Socrates is a man. Socrates is mortal.

Logic in general. Inference rules and theorem proving

Lecture 13 of 41. More Propositional and Predicate Logic

ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS

(LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.

Certamen 1 de Representación del Conocimiento

Sound and Complete Inference Rules in FOL

Predicate Logic. For example, consider the following argument:

The Modal Logic Programming System MProlog

Foundational Proof Certificates

Computational Methods for Database Repair by Signed Formulae

Computational Logic and Cognitive Science: An Overview

First-Order Stable Model Semantics and First-Order Loop Formulas

Repair Checking in Inconsistent Databases: Algorithms and Complexity

CS510 Software Engineering

CHAPTER 7 GENERAL PROOF SYSTEMS

Computing divisors and common multiples of quasi-linear ordinary differential equations

University of Ostrava. Reasoning in Description Logic with Semantic Tableau Binary Trees

The Syntax of Predicate Logic

Turing Degrees and Definability of the Jump. Theodore A. Slaman. University of California, Berkeley. CJuly, 2005

15-780: Graduate AI Lecture 3. FOL proofs. Geoff Gordon (this lecture) Tuomas Sandholm TAs Erik Zawadzki, Abe Othman

High Integrity Software Conference, Albuquerque, New Mexico, October 1997.

Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation)

Applied Logic in Engineering

Introduction to Logic in Computer Science: Autumn 2006

Schema Mappings and Data Exchange

The Division Algorithm for Polynomials Handout Monday March 5, 2012

Chapter 7 Uncomputability

Rules of Inference Friday, January 18, 2013 Chittu Tripathy Lecture 05

Example: Backward Chaining. Inference Strategy: Backward Chaining. First-Order Logic. Knowledge Engineering. Example: Proof

2. The Language of First-order Logic

Handout #1: Mathematical Reasoning

Relations: their uses in programming and computational specifications

First-Order Theories

Lecture 19: Introduction to NP-Completeness Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

Predicate logic. Logic in computer science. Logic in Computer Science (lecture) PART II. first order logic

The Classes P and NP

First-Order Logics and Truth Degrees

We would like to state the following system of natural deduction rules preserving falsity:

Likewise, we have contradictions: formulas that can only be false, e.g. (p p).

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

DEFINABLE TYPES IN PRESBURGER ARITHMETIC

P NP for the Reals with various Analytic Functions

Formalization of the CRM: Initial Thoughts

DISCRETE MATH: LECTURE 3

Fixed-Point Logics and Computation

Answers G53KRR

Formal Engineering for Industrial Software Development

Lecture 1: Oracle Turing Machines

Propositional Logic. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both.

OPERATIONAL TYPE THEORY by Adam Petcher Prepared under the direction of Professor Aaron Stump A thesis presented to the School of Engineering of

Beyond Propositional Logic Lukasiewicz s System

General Theory of Differential Equations Sections 2.8, , 4.1

A Propositional Dynamic Logic for CCS Programs

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

(a) Write each of p and q as a polynomial in x with coefficients in Z[y, z]. deg(p) = 7 deg(q) = 9

Resolution. Informatics 1 School of Informatics, University of Edinburgh

1 Formulating The Low Degree Testing Problem

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

Extending Semantic Resolution via Automated Model Building: applications

! " # The Logic of Descriptions. Logics for Data and Knowledge Representation. Terminology. Overview. Three Basic Features. Some History on DLs

CSC 373: Algorithm Design and Analysis Lecture 16

System BV is NP-complete

Monitoring Metric First-order Temporal Properties

µz An Efficient Engine for Fixed points with Constraints

Schedule. Logic (master program) Literature & Online Material. gic. Time and Place. Literature. Exercises & Exam. Online Material

Lecture Notes in Discrete Mathematics. Marcel B. Finan Arkansas Tech University c All Rights Reserved

3.2 The Factor Theorem and The Remainder Theorem

Principle of Data Reduction

3. Mathematical Induction

Scalable Automated Symbolic Analysis of Administrative Role-Based Access Control Policies by SMT solving

Predicate Logic Review

5.3 Improper Integrals Involving Rational and Exponential Functions

Computability Theory

An Automated Approach to Deontic Reasoning

Plan-Space Search. Searching for a Solution Plan in a Graph of Partial Plans

Modern Algebra Lecture Notes: Rings and fields set 4 (Revision 2)

Factoring Polynomials

Factorization in Polynomial Rings

6.2 Permutations continued

SPARQL: Un Lenguaje de Consulta para la Web

Satisfiability Checking

def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

INTRODUCTORY SET THEORY

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

Aikaterini Marazopoulou

2.1 Complexity Classes

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

Transcription:

Comp24412 Symbolic AI Lecture 8: Resolution theorem-proving Ian Pratt-Hartmann Room KB2.38: email: ipratt@cs.man.ac.uk 2014 15

In the previous Lecture, we met SATCHMO, a first-order theorem-prover implemented in a single page of Prolog. It has nice termination properties, but it not practically very useful. This lecture introduces a more serious approach to constructing proofs in first-order logic: resolution. Resolution is the basis of many widely-used theorem-provers today.

We would like to be able to determine logical relationships such as validity For example, x(artist(x) y(beekeeper(y) admire(x, y))) x(beekeeper(y) y(artist(y) admire(y, x) despise(x, y))) x(artist(x) y(beekeeper(y) despises(y, x) admire(x, y)))

Here is a more complex example x y z(p(x, y) p(y, z) p(x, z)) x y z(q(x, y) q(y, z) q(x, z)) x y(p(x, y) p(y, x)) x y(p(x, y) q(x, y)) x yp(x, y) x yq(x, y)

As with Satchmo, we first convert to clause form. A literal is an atomic formula or an atomic formula prefixed by. Thus, p, q(a), r(x, y) are all literals; p p, q(x) p and r(x, y) are not literals. A clause is a literal or a collection of literals all joined by. Thus p, p q(x), p(a) r(a, b) r are all clauses; p q(a), p p and r(x, y) are not clauses.

The following result is easily established: Let ϕ be a quantifier-free formula. Then there exist clauses C 1,..., C n such that = ϕ (C 1 C 2... C n ). In other words, any quantifier-free formula is logically equivalent to the conjunction of some collection of clauses.

A formula in the predicate calculus in which all the quantifiers are at the front is said to be in prenex form. The formulas x(man(x) mortal(x)) x yloves(x, y) are in prenex form The formulas x(boy(x) y(girl(y) loves(x, y))) x((boy(x) y(girl(y) loves(x, y))) happy(x)) are not.

The following result can easily be established: Let ϕ be a formula. Then there exists a prenex form formula ψ such that = ϕ ψ. In other words, any formula is logically equivalent to a formula with all the quantifiers at the front.

Example x(boy(x) y(girl(y) loves(x, y))) is equivalent to x y(boy(x) (girl(y) loves(x, y))) Example x((boy(x) y(girl(y) loves(x, y))) happy(x)) is equivalent to x y((boy(x) girl(y) loves(x, y)) happy(x))

Given a prenex formula, existential quantifiers can be eliminated. Consider This is equisatisfiable with ( x)(man(x) philosopher(x)) man(a) philosopher(a). (This name must be new: i.e. not occurring in any other formulas.) Similarly is equisatisfiable with ( y)( x)(loves(x, y)) ( x)(loves(x, b)).

Things are different however, for: ( x)( y)(loves(x, y)). This formula is equisatisfiable with: ( x)(loves(x, f (x))) where f is a function (called a Skolem function). Note the use of a function (rather than a constant): the formula says that everyone loves someone or other but not necessarily the same person. We need a function whenever we want to eliminate an existential quantifier which is to the right of some universal quantifiers.

These new constants and functions are called Skolem constants and Skolem functions, respectively. The process of replacing existentially quantified variables with Skolem constants and functions is called Skolemization. Notice that Skolemization does not produce logically equivalent formulas; but it does produce equisatisfiable formulas.

Suppose then, we put a formula ϕ in prenex form, and Skolemize. The result will be where χ is quantifier-free. x 1... x n χ But the universal quantifiers convey no information any more, so we might as well write: Now we replace χ (the quantifier-free rump) by an equivalent collection of clauses. The result is said to be the clause form for ϕ. χ

So we can massage any formula of the predicate calculus into a collection of clause form expressions (containing variables) of the form L 1... L N where the L i are literals Example: has, as its clausal form, x(boy(x) y(girl(y) love(x, y))) boy(x) girl(f (x)) boy(x) love(x, f (x)) Since we can equisatisfiably convert to clausal forms, we need only inference procedures which work on clausal forms.

First, we look at the ground case. The rule modus ponens: Re-writing: p q Generalizing to longer clauses: q p p q p q p C p D C D

This gives us a way to make inferences. Consider the formulas boy(john) (girl(mary) loves(john, mary)), boy(john), girl(mary), loves(john, mary). It should be obvious that these formulas are not (simultaneously satisfiable) In clausal form: boy(john) girl(mary) loves(john, mary), boy(john), girl(mary), loves(john, mary).

We can apply resolution repeatedly as follows: loves(j, m) boy(j). girl(m) boy(j) girl(m) loves(j, m) boy(j) loves(j, m) loves(j, m) Since the empty clause has been derived, it is evident (even to a computer) that the formulas we started with are not satisfiable.

This gives us a way to test validity. For suppose we want to test whether We convert ϕ 1,... ϕ n = ψ. ϕ 1,... ϕ n, ψ to clausal form and try to use resolution and factoring to obtain a contradiction. If we succeed, the sequent is valid. In particular, we have shown the validity of the argument with premises boy(john) (girl(mary) loves(john, mary)) girl(mary) boy(john) and conclusion loves(john, mary).

Next, we look at the non-ground case. To apply resolution to non-ground clauses, we need the concept of unification. If A and A are atoms, we say that A and A are unifiable if there is a substitution σ of terms for variables such that Aσ = A σ.

Example 1: man(x) man(socrates) unify, under the substitution σ : x socrates. Example 2: q(x, f (x)) q(u, v) unify, under the substitution σ : u x; v f (x). Example 3: p(x) q(u) do not unify. Example 4: p(x, f (x)) p(f (y), y) do not unify either.

We noted that q(x, f (x)) q(u, v) unify, under the substitution making the common term σ : u x; v f (x) q(x, f (x)). But they also unify under the substitution, say, making the common term σ : u a; v f (a); x a, q(a, f (a)).

If A and A are unifiable, then there is a substitution θ such that Aθ = A θ and, for any substitution σ such that Aσ = A σ, we have σ = θρ for some substitution ρ. We say that θ is a most general unifier (m.g.u). The m.g.u. is unique up to renaming of variables. It can be efficiently computed...

Now back to the analogue of modus ponens for non-ground clauses: p(x) q(x) p(a). q(a) Generalizing again: A C A D, (C D)θ where A and A are unifiable atoms with m.g.u. θ This rule of inference is known as the resolution rule

It is obvious that we can remove repeated literals from clauses: p p p C p C Generalizing to the non-ground case gives the factoring rule: C (Cθ) 0, with θ the m.g.u of some literals in C and 0 denoting deletion of repeated literals,

Again, we can use resolution and factoring to construct proofs: lv(john, mary) boy(john). girl(mary) boy(x) girl(y) lv(x, y) boy(x) lv(x, mary) lv(john, mary) If clause C is derivable from a set C of clauses by means of resolution and factoring, we write C C.

As before, this gives us a way to make inferences. Consider the formulas x(boy(x) y(girl(y) loves(x, y))) girl(mary) boy(john) loves(john, mary). In clausal form: boy(x) girl(y) loves(x, y) girl(mary) boy(john) loves(john, mary). But these clauses imply. Therefore, the original set of formulas is unsatisfiable.

As before: to test whether ϕ 1,... ϕ n = ψ, convert ϕ 1,... ϕ n, ψ to clausal form and try to use resolution and factoring to obtain a contradiction. If you succeed, the sequent is valid

In particular, in showing that the set of formulas x(boy(x) y(girl(y) loves(x, y))) girl(mary) boy(john) loves(john, mary). is unsatisfiable, we have shown that the argument x(boy(x) y(girl(y) loves(x, y))) boy(john) girl(mary) loves(john, mary) is valid.

In fact, the following result can be proved: Theorem Let C be a set of clauses. Then C if and only if the universal closure of C is unsatisfiable. This means that resolution and factoring are all the rules we need to determine entailments We say that the proof system in question is (sound and) complete. To think about: Why does this not give us an algorithm for testing validity?

Let A be the collection of all atoms (over some signature). Let be a partial order on A. We say that is an A-ordering if, for all substitutions θ, A A implies Aθ A θ. We extend any A-ordering to literals by ignoring negations.

Example of A-ordering: A 2 A iff A involves a unary predicate and Example of A-ordering: A d A iff d(a) < d(a ) and A involves a binary predicate. d(x, A) < d(x, A ) for all variables x in A, where d(a) is the depth of A and d(x, A) is the term depth of x in A.

Given an A-ordering, ordered resolution is the same as resolution, namely A C A D, (C D)θ subject to the added restriction that, for every literal L in C, A L, and for every literal L in D, A L. Similarly with ordered factoring. If clause C is derivable from a set C of clauses by means of -ordered resolution and factoring, we write C C.

Amazingly, ordering restrictions never compromise completeness Theorem Let C be a set of clauses and an A-ordering. Then C if and only if C is unsatisfiable.

Let us say that the 1-variable fragment is the set of clauses C satisfying either of the following conditions: every literal of C is ground; there is a variable x such that, for every literal L of C, Vars(L) = {x}. The clauses p(a) q(b, f (a)), p(x) r(h(x, g(x)), x) are in the 1-variable fragment, but p(a) q(x, f (a)), p(x) r(y, x) are not in the 1-variable fragment. Note that resolution and factoring preserve membership in the 1-variable fragment.

In general, resolution increases the functional depth of clauses: p(x) q(fx) r(gx ) s(x ) q(x ) p(x) r(gfx) s(fx) However, d -ordered resolution and factoring do not: p(x) q(fx) r(x ) s(x ) q(x ) p(x) r(fx) s(fx)

Suppose we take a set C of clauses in the 1-variable fragment, and keep applying resolution and factoring to them. Obviously, only clauses featuring the signature of C will be generated. Because the functional depth is not increased, the total number of clauses that can be generated from C by d -ordered resolution and factoring is bounded by an exponential function of the size of the signature. Hence, the satisfiability of clauses in the 1-variable fragment (with a fixed depth-bound) can be algorithmically decided in exponential time.