Automated Reasoning With PROLOG
Automated Reasoning With PROLOG
AUTOMATED REASONING
machine does 'thinking' machine does book-keeping,
Krysia Broda user does nothing user does 'thinking'.
Room 378 Concerned with GENERAL DEDUCTION - applicable in many areas.
kb@doc.ic.ac.uk Specifically First order logic / equality - not modal or temporal logics
PROBLEM: DATA |= CONCLUSION (|= read as “implies”)
SLIDES 0: The data will be expressed in logic – e.g. (i) first order predicate logic,
(ii) clausal form, (iii) equalities only, or (iv) Horn clauses only.
INTRODUCTION and OVERVIEW ANSWER: YES/NO/DON'T KNOW (i.e. give up)
Introduction to the course -
what it covers and what it doesn’t cover YES + 'proof' - usually just one and smallest if possible, or
Examples of problems for a theorem prover YES + all proofs (or all answers) - (c.f. logic programming)
Prolog – an example of a theorem prover Problem can be answered:
• with refutation methods (show data + ¬ conclusion give a contradiction).
eg resolution and tableau methods covered here;
• for equality using special deduction methods (covered here);
KB - AR - 09 • directly, reasoning forwards from data using inference rules, or backwards
from conclusion using procedural rules; eg natural deduction (but not here)
Introduction: 0avi
Introduction (continued):
The course slides will generally be covered “as is” in class. Course notes (like this On the other hand, direct reasoning of the form "from X conclude Y" (also called forwards
one) amplify the slides. There are also some longer (“chapter”) notes with more reasoning), from data to conclusion, is sometimes used. When reasoning is directed
background material (not examinable) on my webpage (www.doc.ic.ac.uk/~kb). backwards from the conclusion, as in "to show Y, show X" it may be called backwards
reasoning). The deductions produced by LP are sometimes viewed in this way, when it is
In this course we'll be concerned with methods for automating reasoning. often referred to as a procedural interpretation.
We'll look at the "father" of all methods, resolution, as well as at tableaux methods.
We'll also consider reasoning with equality, especially when the data consists only of What we won't be concerned with: particular methods of knowledge representation, user
equations. All data will be in first order logic (i.e. not in modal logic, for example). interaction with systems, reasoning in special domains (except equational systems), or
Of course, there are special systems for automating other kinds of logics, for example model checking. All of these things are important; a problem can be represented in
modal logics. The methods are usually extensions of methods for first order logic, or different ways, making it more or less difficult to solve; clever algorithms can be used in
sometimes they reduce to using theorem provers for first order logic in special ways. special domains; user interactive systems are important too - e.g. Isabelle, the B-toolkit or
It is mainly for these reasons (but also because there isn't enough time) that we Perfect Developer, as they usually manage to prove the easy and tedious things and require
restrict things. intervention only for the hard proofs. Isabelle and its relations are now very sophisticated.
If a proof seems to be hard it may mean that some crucial piece of data is missing (so the
Logic programming (LP) is a familiar, useful and simple automated reasoning system proof doesn't even exist!) and user interaction may enable such missing data to be detected
which we will occasionally use to draw analogies and contrasts. e.g in LP we usually easily. Model checking (e.g. Alloy) can also be used to show a conclusion is not provable
desire all solutions to a goal. In theorem proving terms this usually amounts to by finding a model of the data that makes the conclusion false.
generating all proofs, although often just one proof might be enough. In LP reasoning
is done by refutation. The method of refutation assumes that the conclusion is false In order to see what kinds of issues can arise in automated reasoning, here are 3 problems
and attempts to draw a contradiction from this assumption and the given data. Nearly for you to try for yourself. Are they easy? How do you solve them? Are you sure your
always, refutations are sought in automated deduction. answer is correct? What are the difficulties? You should translate the first two into logic. In
the third, assume all equations are implicitly quantified over variables x, y and z and that a,
b, c and e are constants. 0avii
A harmonious household (!): 0bii
EXAMPLE PROBLEMS 0bi
Someone who lived in the house stole from Aunt Agatha.
Agatha the butler and James live in the house and are the only people that do.
• A general theorem prover might be expected to solve all of the following A thief dislikes, and is never richer than, his victim.
3 problems easily. James dislikes no-one whom Aunt Agatha dislikes.
• The user would translate the data into logic first. Agatha dislikes everyone except the butler.
• How would YOU solve the problems? The butler dislikes anyone not richer than Agatha and everyone she dislikes.
• Are they easy? What are the difficulties? No-one dislikes everyone.
• Are you sure the answer is correct? Agatha is not the butler.
Therefore Agatha stole from herself
Three naughty children: (and also that neither James nor the butler stole from her)
Dolly Ellen or Frances was the culprit and only one. A Mathematical Problem:
The culprit was in the house. aοb=c
Dolly said " It wasn't me, I wasn't in the house; Ellen did it." ο is an associative operator: x ο (y ο z) = (x ο y) ο z
Ellen said " It wasn't me and it wasn't Frances; xοx=e
but if I did do it then (Dolly did it too or was in the house)." x ο e = e ο x = x (e is the identity of ο)
Frances said " I didn't do it, Dolly was in the house;
if Dolly was in the house and did it so did Ellen." Show b ο a = c
None of the three told the truth. Who did it?
Some Famous Names in Theorem Proving Some Famous Names in Theorem Proving
Chang and Lee
Robert First book on theorem
Kowalski Proving (1968)
(1979) Theory
of Logic
Programming
Connection
Alan Bundy Graphs (1976)
Clam Theorem
Alan Robinson Gerard Huet Prover, Hillary Putnam
Discovered Resolution Discovered excellent book, Davis Putnam
1961 rewrite systems problem solving prover 1957
1976
Donald Knuth Martin Davis
Larry Wos Reiner Hahnle Knuth Bendix Davis Putnam Algorithm
Wrote Otter LeanTap 1997 and Algorithm (1957)
prover other provers (1971)
(1980s) and Key System for Tex J S Moore
successor Program Correctness Boyer MooreProver (1970s)
Prover9 2005 Structure Sharing (1971)
More Famous Names in Theorem Proving (No pictures!)
Donald Loveland - discovered Model Elimination 1967
Alain Colmerauer - first Prolog System
Mark Stickel - PTTP Theorem Prover 1982
David Plaistead - Hyper-linking (1992)
Reinhold Letz - Setheo, Free variable Tableau proving (1990s onwards)
Norbert Eisinger - Connection Graph theory (1986)
Woody Bledsoe - UT prover (natural deduction style)
Larry Paulson - Inventor of Isabelle
Andrei Voronkov - Vampire Theorem Prover
Ian Horrocks - Description Logic Theorem Prover