automated reasoning systems for first order predicate logic

49
Automated Reasoning Systems Automated Reasoning Systems For first order Predicate Logic For first order Predicate Logic

Upload: kenia-merrow

Post on 14-Dec-2015

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Automated Reasoning Systems For first order Predicate Logic

Automated Reasoning SystemsAutomated Reasoning Systems

For first order Predicate LogicFor first order Predicate Logic

Page 2: Automated Reasoning Systems For first order Predicate Logic

2

AR: general context.AR: general context. Given is a knowledge base in predicate logic: Given is a knowledge base in predicate logic: TT

is a set of formulae in first order logicis a set of formulae in first order logic

formally also called: a formally also called: a “Theory’’“Theory’’

Given is also an additional first order formula: Given is also an additional first order formula: FF

Is Is FF a logical consequence of a logical consequence of TT ? ? Notation: Notation: T T |=|= FF ( (T T impliesimplies F F) )

Find reasoning techniques that allow to decide Find reasoning techniques that allow to decide

on this for EACH on this for EACH FF and and TT..

RequirementsRequirements:: correctness -- completeness -- efficiencycorrectness -- completeness -- efficiency

Page 3: Automated Reasoning Systems For first order Predicate Logic

3

AR: decidability.AR: decidability.

There There CANNOT EXIST AN ALGORITHMCANNOT EXIST AN ALGORITHM that decides whether that decides whether TT

|=|= FF, for any theory , for any theory TT and any formula and any formula FF..

Theorem Church ‘36:Theorem Church ‘36:

There exists a reasoning techniqueThere exists a reasoning technique, such that for , such that for

any theory any theory TT and formula and formula FF, such that , such that TT |=|= FF, the , the

reasoning technique reasoning technique provesproves TT |= |= FF..

SOSO: if : if FF follows from follows from TT, then we find a proof, else it is , then we find a proof, else it is

possible that the procedure doesn’t terminate.possible that the procedure doesn’t terminate.

BUT: semi-decidable ! BUT: semi-decidable !

Completeness Theorem of Goedel ‘31:Completeness Theorem of Goedel ‘31:

Page 4: Automated Reasoning Systems For first order Predicate Logic

4

Wrong !Wrong ! Let: Let: T =T = {{smart(Kelly)smart(Kelly)}} en en F =F = strong(Kelly)strong(Kelly) Although Although strong(Kelly) strong(Kelly) ~strong(Kelly)~strong(Kelly) is always is always

true, we have:true, we have: neither: neither: {{smart(Kelly)smart(Kelly)}} |= |= strong(Kelly)strong(Kelly) nor: nor: {{smart(Kelly)smart(Kelly)}} |= |= ~strong(Kelly)~strong(Kelly)

The theorems of Church and Goedel are The theorems of Church and Goedel are contradicting: We can try to prove F and ~F in contradicting: We can try to prove F and ~F in parallel, and according to Goedel’s theorem one of parallel, and according to Goedel’s theorem one of these must succeed after a finite time. these must succeed after a finite time.

Wait a second ...Wait a second ...

Page 5: Automated Reasoning Systems For first order Predicate Logic

5

AR: general outline (1).AR: general outline (1). First we sketch First we sketch the most generally used approach the most generally used approach

for automated reasoning in first-order logic:for automated reasoning in first-order logic:

backward resolutionbackward resolution

The The different technical componentsdifferent technical components will only be will only be explained in full detail in a second pass (explained in full detail in a second pass (outline (2)outline (2)).).

Page 6: Automated Reasoning Systems For first order Predicate Logic

6

AR: general outline (2) .AR: general outline (2) . We study We study different subsetsdifferent subsets of predicate logic: of predicate logic:

ground Horn clause logicground Horn clause logic Horn clause logicHorn clause logic Clausal logic Clausal logic full predicate logicfull predicate logic

In In each caseeach case we study semi-deciding we study semi-deciding procedures. procedures.

Each extension requires the introduction of Each extension requires the introduction of new new techniquestechniques..

Page 7: Automated Reasoning Systems For first order Predicate Logic

Backward Reasoning ResolutionBackward Reasoning Resolution

… … in a nutshellin a nutshell

Page 8: Automated Reasoning Systems For first order Predicate Logic

8

Backward resolution:Backward resolution:

0) The task: an example. 0) The task: an example.

1) Proof by inconsistency. 1) Proof by inconsistency.

2) Conversion to clausal form. 2) Conversion to clausal form.

3) Unification.3) Unification.

4) The resolution step.4) The resolution step.

5) (Backward) resolution proofs.5) (Backward) resolution proofs.

Page 9: Automated Reasoning Systems For first order Predicate Logic

9

0) The TASK (example):0) The TASK (example):

Are axioms:Are axioms: describe knowledge about some describe knowledge about some world. world.

z ~ q(z)z ~ q(z)y p(f(y))y p(f(y))x p(x) x p(x) q(x) q(x) r(x) r(x)

TT

How to prove such theorems in general?How to prove such theorems in general?

u u r(f(u))r(f(u))

In this world, is In this world, is always true ?always true ?FF

pp = parent= parentff = father= fatherrr = rich= richqq = old= old

Page 10: Automated Reasoning Systems For first order Predicate Logic

10

1) Proof by inconsistency1) Proof by inconsistency

u u r(f(u))r(f(u))

FF Don’t prove Don’t prove FF directly: directly:

But add the But add the negationnegation of of FF to the axioms and prove to the axioms and prove that this extension is inconsistent. that this extension is inconsistent.

~ ~ u r(f(u))u r(f(u)) z ~ q(z)z ~ q(z)y p(f(y))y p(f(y))x p(x) x p(x) q(x) q(x) r(x) r(x)

NEW TASK:NEW TASK:

is inconsistent.is inconsistent. the 4 axioms are never true in 1 same interpretation. the 4 axioms are never true in 1 same interpretation.

Page 11: Automated Reasoning Systems For first order Predicate Logic

11

2) Clausal form:2) Clausal form:= Normalize the formulae to a (more simple) standard form. = Normalize the formulae to a (more simple) standard form.

NoticeNotice: “: “xx y …y … zz““ can be dropped.can be dropped.

EachEach set of axioms can be transformed into a new set set of axioms can be transformed into a new set of formulae, that contains of formulae, that contains onlyonly formulae of the form: formulae of the form:

xxy…y…zz p(…)p(…) q(…)q(…) …… r(…)r(…) t(…) t(…) s(…)s(…) … … u(…)u(…)

which is which is inconsistentinconsistent if and only ifif and only if the original set was the original set was inconsistent.inconsistent.

only left; only left; only right only right no no ~~ ; no ; no

Page 12: Automated Reasoning Systems For first order Predicate Logic

12

Example:Example:

PsPs: usually requires much more work! : usually requires much more work!

: is already in clausal form: ( P : is already in clausal form: ( P P P truetrue))

~ ~ u r(f(u))u r(f(u)) u false u false r(f(u)) r(f(u))

z ~ q(z)z ~ q(z) z false z false q(z) q(z)

y p(f(y))y p(f(y))

x p(x) x p(x) q(x) q(x) r(x) r(x)

x q(x) x q(x) r(x) r(x) p(x) p(x)

Page 13: Automated Reasoning Systems For first order Predicate Logic

13

3) Unification:3) Unification: Given 2 atomic formulae:Given 2 atomic formulae:

ExEx.: p(f(A),y) p(x, g(x)).: p(f(A),y) p(x, g(x))

find their find their most general common instancemost general common instance..

ExEx.: x must become: f(A).: x must become: f(A)

g(x) must become: g(f(A))g(x) must become: g(f(A))

y must become: g(f(A))y must become: g(f(A))

p(f(A), g(f(A)))p(f(A), g(f(A)))

Most general unifier (Most general unifier (mgumgu) : x -> f(A)) : x -> f(A) y -> g(f(A))y -> g(f(A))

Page 14: Automated Reasoning Systems For first order Predicate Logic

14

4) The resolution step4) The resolution step Proposition logic:Proposition logic:

P P QQPP Q Q

P P QQ ~Q~Q~P ~P

P1P1 P2P2 … … Pn Pn Q1Q1 ...... QmQmR1 R1 … … RkRk P1P1 S1S1 … … SlSlP2P2 … … Pn Pn R1 R1 … … RkRk Q1Q1 ...... Qm Qm S1S1 … … SlSl

Q Q P PP P true trueQQ true true

Q Q P Pfalse false Q Q false false P P

Page 15: Automated Reasoning Systems For first order Predicate Logic

15

De resolutie step (2):De resolutie step (2): Predicate logic:Predicate logic:

Example:Example:p(p(xx,,f(A)f(A))) q(g( q(g(xx))))

r(r(zz) ) p(p(BB,,zz))

r(r(f(A)f(A)) ) q(g( q(g(BB)) )) mgu(mgu(p(p(xx,,f(A)f(A))),, p(p(BB,,zz)) )) == xx -> -> BB zz -> -> f(A)f(A)

= mgu = mgu applied toapplied to r(r(zz) ) q(g(q(g(xx))))

Clauses on which resolution is performed Clauses on which resolution is performed must not have any variables in common. must not have any variables in common.

Page 16: Automated Reasoning Systems For first order Predicate Logic

16

5) Resolution proofs:5) Resolution proofs:

In order to prove a set of clauses inconsistent:In order to prove a set of clauses inconsistent:

select 2 of them, for which resolution is possibleselect 2 of them, for which resolution is possible

apply resolution and add the result to the setapply resolution and add the result to the set

ifif you obtain the clause you obtain the clause false false : : STOP !STOP !

This means inconsistency of the last setThis means inconsistency of the last set

AND AND inconsistency of the original setinconsistency of the original set

ANDAND that that FF was implied by was implied by TT

Page 17: Automated Reasoning Systems For first order Predicate Logic

17

Example:Example:

q(x) q(x) r(x) r(x) p(x) p(x) false false r(f(u)) r(f(u))

false false q(z) q(z)

p(f(y))p(f(y))

q(f(u)) q(f(u)) p( p(f(u)f(u)) )

x -> f(u)x -> f(u)

false false p( p(f(u)f(u)))

z -> f(u)z -> f(u)

false false

y -> uy -> u SoSo: inconsistent !: inconsistent !

Page 18: Automated Reasoning Systems For first order Predicate Logic

A deeper study:A deeper study:

Modus ponensModus ponensGround Horn LogicGround Horn Logic

UnificationUnificationHorn LogicHorn Logic

ResolutionResolution Clausal LogicClausal Logic

NormalizationNormalizationFull Predicate LogicFull Predicate Logic

Page 19: Automated Reasoning Systems For first order Predicate Logic

19

Horn clause logicHorn clause logic

x1 … xk A B1 B2 … Bn

All formulae in All formulae in TT are of the form: are of the form:

where where A, B1, B2,…,BnA, B1, B2,…,Bn are are atomsatoms.. An An atomatom is a formula of the form is a formula of the form p(p(t1,…,tmt1,…,tm)), with , with

pp a predicate symbol and a predicate symbol and t1,…,tmt1,…,tm terms. terms. Horn clause formulae are Horn clause formulae are universally quantifieduniversally quantified

over all variables that occur in them.over all variables that occur in them. B1,…,BnB1,…,Bn are called are called body-atomsbody-atoms of the Horn of the Horn

clause; clause; AA is the is the headhead of the Horn clause. of the Horn clause. nn may be 0: in this case we say that the Horn may be 0: in this case we say that the Horn

clause is a clause is a factfact..

Page 20: Automated Reasoning Systems For first order Predicate Logic

20

Alternative notation:Alternative notation:

Implicative formImplicative form Conjunctive formConjunctive form

x1 … xk A B1 B2 … Bn

x1 … xk A ~B1 ~B2 … ~Bn

Alternatively one can write a Horn Clause:Alternatively one can write a Horn Clause:

as:as: Q Q P P Q Q ~P ~P

This is a special case of the “conjunctive normal This is a special case of the “conjunctive normal form” (only disjunctions and negations), with form” (only disjunctions and negations), with only 1 positive disjunctonly 1 positive disjunct..

Page 21: Automated Reasoning Systems For first order Predicate Logic

21

Wich kind of formulaeWich kind of formulaecan we prove?can we prove?

x1 … xk B1 B2 … Bn

In Horn clause logic, we limit ourselves to prove In Horn clause logic, we limit ourselves to prove formulae formulae FF of the form: of the form:

where where B1, B2, …, BnB1, B2, …, Bn are again atoms. are again atoms.

All variables are existentially quantified ! All variables are existentially quantified !

Page 22: Automated Reasoning Systems For first order Predicate Logic

22

A very simple example:A very simple example: Bosmans is a showmaster (1)Bosmans is a showmaster (1)

Showmasters are rich (2)Showmasters are rich (2)

Rich people have big houses (3)Rich people have big houses (3)

Big houses need a lot of maintenance (4)Big houses need a lot of maintenance (4)

Goal:Goal: automatically deduce that Bosmans’ house automatically deduce that Bosmans’ house needs a lot of maintenance. needs a lot of maintenance.

Page 23: Automated Reasoning Systems For first order Predicate Logic

23

Representatie in Horn logica:Representatie in Horn logica: Bosmans is a showmaster Bosmans is a showmaster

(1)(1)

Showmasters are rich (2)Showmasters are rich (2)

Rich people have big houses (3)Rich people have big houses (3)

Big houses need a lot of maintenance Big houses need a lot of maintenance (4)(4)

To prove:To prove:

showmaster(Bosmans)showmaster(Bosmans)

p rich(p) p rich(p) showmaster(p) showmaster(p)

p big(house(p)) p big(house(p)) rich(p) rich(p)

p lot_maint(house(p)) p lot_maint(house(p)) big(house(p)) big(house(p))

Lot_maint(house(Bosmans))Lot_maint(house(Bosmans))

Page 24: Automated Reasoning Systems For first order Predicate Logic

AR for ground AR for ground Horn clause logicHorn clause logic

Backward (and forward) reasoning Backward (and forward) reasoning

proof procedures based on generalized proof procedures based on generalized Modus PonensModus Ponens

Page 25: Automated Reasoning Systems For first order Predicate Logic

25

Restricting to groundRestricting to groundHorn clauses: Horn clauses:

showmaster(Bosmans)rich(Bosmans) showmaster(Bosmans)big(house(Bosmans)) rich(Bosmans)lot_maint(house(Bosmans)) big(house(Bosmans))

So, for now: Horn clauses without variables:So, for now: Horn clauses without variables: Example:Example:

lot_maint(house(Bosman))

Prove:Prove:

Page 26: Automated Reasoning Systems For first order Predicate Logic

26

Easy with modus ponens !Easy with modus ponens !

big(house(Bos)) rich(Bos)big(house(Bos))

3 applications of modus ponens:3 applications of modus ponens:

showm(Bos)rich(Bos) showm(Bos)rich(Bos)

gives the desired conclusion.gives the desired conclusion.

lot_maint(house(Bos)) big(house(Bos))lot_maint(house(Bos))

Page 27: Automated Reasoning Systems For first order Predicate Logic

27

Modus ponens in AR:Modus ponens in AR:

BA B

A

For any interpretation making both B and A B true (= any model of {B , A B} )

Modus ponens is correct:Modus ponens is correct:

A is also true in this interpretation (see truth tables)

ProblemProblem: how to organize this into a procedure : how to organize this into a procedure which is also which is also completecomplete (for ground Horn clauses)?(for ground Horn clauses)?

Page 28: Automated Reasoning Systems For first order Predicate Logic

28

Generalized Generalized Modus ponensModus ponens

B1B2…BnA B1 B2 … BnA

Increase the number of conjuncts:Increase the number of conjuncts:

Is obviously still correct (truth tables).Is obviously still correct (truth tables).

Page 29: Automated Reasoning Systems For first order Predicate Logic

A glimpse at a A glimpse at a Forward Reasoning Forward Reasoning

Modus Ponens strategyModus Ponens strategy

Page 30: Automated Reasoning Systems For first order Predicate Logic

30

A forward proof procedureA forward proof procedure

Derived Derived := { };:= { };RepeatRepeat

Select someSelect some A A B1 B1 B2 B2 … … Bn Bn from from TT,,such that allsuch that all B1B1,, B2B2,, …… ,, BnBn DerivedDerived,, andand AA DerivedDerived;;

DerivedDerived:= := DerivedDerived { {AA};};

UntilUntil all atoms of all atoms of FF == C1 C1 C2 C2 … … Cm Cm are in are in DerivedDerived or no more Selection are possibleor no more Selection are possible

Given theory Given theory TT and formula and formula FF::

If all atoms from If all atoms from FF are in are in DerivedDerived at termination, at termination, then then TT implies implies FF, otherwise it doesn’t. , otherwise it doesn’t.

Page 31: Automated Reasoning Systems For first order Predicate Logic

31

Extended example:Extended example:

One possible derivation:One possible derivation:Step 0: Derived := { }Step 1: Derived := {showm(Bos)}Step 2: Derived := Derived {belg(Bos)}Step 3: Derived := Derived {european(Bos)}Step 4: Derived := Derived {rich(Bos)}Step 5: Derived := Derived {big(house(Bos))}End : Derived := Derived {lot_maint(house(Bos))}

european(Bos) belg(Bos)rich(Bos) showm(Bos) european(Bos)big(house(Bos)) rich(Bos)lot_maint(house(Bos)) big(house(Bos))

showm(Bos)belg(Bos)

Page 32: Automated Reasoning Systems For first order Predicate Logic

32

Remarks:Remarks:

CorrectnessCorrectness: generalized modus ponens is correct: generalized modus ponens is correct

CompletenessCompleteness: intuition:: intuition: for a finite ground Horn clause theory, only a finite for a finite ground Horn clause theory, only a finite

number of ground atoms are impliednumber of ground atoms are implied

these are all derived after finite timethese are all derived after finite time

EfficiencyEfficiency::can be extremely slow ! can be extremely slow !

If If TT contains many Horn clauses unrelated to contains many Horn clauses unrelated to FF, then , then

the procedure derives many irrelevant (for the procedure derives many irrelevant (for FF ) )

atoms. atoms.

Page 33: Automated Reasoning Systems For first order Predicate Logic

Backward reasoningBackward reasoning

For ground Horn Clause logicFor ground Horn Clause logic

Page 34: Automated Reasoning Systems For first order Predicate Logic

34

Inconsistency:Inconsistency:

T implies F iff Each model of T makes F true iff Each model of T makes ~F false iff T {~F} has no model iff T {~F} is inconsistent

A theory A theory TT is inconsistent if it has NO model. is inconsistent if it has NO model.

Let T be a theory and F a formula.T implies F if and only if T {~F} is inconsistent.

Theorem:Theorem:

Proof:Proof:

Page 35: Automated Reasoning Systems For first order Predicate Logic

35

The example again:The example again: Prove that the theory:Prove that the theory:

showm(Bos)belg(Bos)european(Bos) belg(Bos)rich(Bos) showm(Bos) european(Bos)big(house(Bos)) rich(Bos)lot_maint(house(Bos)) big(house(Bos))~ lot_maint(house(Bos))

is inconsistent.is inconsistent.

Problem:Problem: this is NOT a Horn clause theory !? this is NOT a Horn clause theory !?

Page 36: Automated Reasoning Systems For first order Predicate Logic

36

Refutation proofs:Refutation proofs:the “false” predicate the “false” predicate

false

We introduce a new predicate symbol:We introduce a new predicate symbol:

We agree that We agree that falsefalse has the truth value ‘false’ has the truth value ‘false’ under under everyevery interpretation. interpretation.

Imagine that we defined Imagine that we defined falsefalse as : as : falsefalse p p ~p ~p

for some predicate for some predicate pp

Page 37: Automated Reasoning Systems For first order Predicate Logic

37

““definite” goals:definite” goals: In the Horn logic setting In the Horn logic setting FF has the form: has the form:

x1 … xm B1 B2 … Bn

So what is the form of So what is the form of ~F~F??

~(x1 … xm B1 B2 … Bn)

x1 … xm ~(B1 B2 … Bn)

x1 … xm false ~(B1 B2 … Bn)

x1 … xm false B1 B2 … BnA ~B A B

Observe: Observe: ~F~F is again a Horn clause !! is again a Horn clause !!

Page 38: Automated Reasoning Systems For first order Predicate Logic

38

In conjunctive normal form:In conjunctive normal form: Again:Again: x1 … xm false B1 B2 …

Bn is equivalent with:is equivalent with: x1 … xm false

~B1 ~B2 … ~Bn

x1 … xm ~B1 ~B2 … ~Bn

0 positive0 positive disjunctsdisjuncts !!

As a special case, “false” is the empty disjunction:As a special case, “false” is the empty disjunction:

false

Implicative en disjunctive form remain consistentImplicative en disjunctive form remain consistent (an empty disjunction is always false) (an empty disjunction is always false)

Page 39: Automated Reasoning Systems For first order Predicate Logic

39

Back to the exampleBack to the example

a ground Horn clause theory !a ground Horn clause theory !

showm(Bos)belg(Bos)european(Bos) belg(Bos)rich(Bos) showm(Bos) european(Bos)big(house(Bos)) rich(Bos)lot_maint(house(Bos)) big(house(Bos))false lot_maint(house(Bos))

The extended theory (to be proven The extended theory (to be proven inconsistent) now is:inconsistent) now is:

Page 40: Automated Reasoning Systems For first order Predicate Logic

40

Modus ponensModus ponensgeneralized some more:generalized some more:

Ordinary Modus ponens is the special case with:Ordinary Modus ponens is the special case with: n = i = 1 and m =0n = i = 1 and m =0

CorrectnessCorrectness: via truth tables: via truth tables

A B1 B2 … Bi … BnBi C1 C2 … Cm

A B1 B2 … C1 C2 … Cm … Bn

Page 41: Automated Reasoning Systems For first order Predicate Logic

41

Some backward reasoning steps Some backward reasoning steps in the example:in the example:

and so on ...and so on ...

false lot_maint(house(Bos))lot_maint(house(Bos)) big(house(Bos))

false big(house(Bos))

false big(house(Bos))big(house(Bos)) rich(Bos)

false rich(Bos)

Page 42: Automated Reasoning Systems For first order Predicate Logic

42

The backward procedure:The backward procedure:the ideathe idea

Convert Convert FF into a definite goal: into a definite goal:

false B1 B2 … Bi … Bn

Apply generalized modus ponens to the body-Apply generalized modus ponens to the body-atoms atoms BiBi of the goal, using the Horn clauses of of the goal, using the Horn clauses of TT

untiluntil: is deduced.: is deduced. false

Then:Then: a false formula ia a consequence of a false formula ia a consequence of T T {~F} {~F}

we have proven inconsistency ofwe have proven inconsistency of T T {~F} {~F}

Page 43: Automated Reasoning Systems For first order Predicate Logic

43

Backwards procedureBackwards procedure

On top of this you need to apply On top of this you need to apply backtrackingbacktracking over over the selected clauses and the selected body atoms.the selected clauses and the selected body atoms.

If the algorithm stops because it has tried all these If the algorithm stops because it has tried all these alternatives: alternatives: FF was was notnot implied! implied!

Goal Goal := := false false B1 B1 B2 B2 … … Bn Bn ; ;RepeatRepeat

Select someSelect some BiBi atom from the body of atom from the body of GoalGoal Select some clauseSelect some clause Bi Bi C1 C1 C2 C2 … … Cm Cm fromfrom TT

ReplaceReplace BiBi in the body of in the body of GoalGoal by by C1 C1 C2 C2 … … Cm Cm

UntilUntil GoalGoal = = false false or no more Selections possible or no more Selections possible

Page 44: Automated Reasoning Systems For first order Predicate Logic

44

Back to the exampleBack to the exampleStep 0: Goal := false lot_maint(house(Bos)) select: lot_maint(house(Bos)) big(house(Bos)) Step 1: Goal := false big(house(Bos)) select: big(house(Bos)) rich(Bos)Step 2: Goal := false rich(Bos) select: rich(Bos) showm(Bos) european(Bos)Step 3: Goal := false showm(Bos) european(Bos) select: showm(Bos)Step 4: Goal := false european(Bos) select: european(Bos) belg(Bos)Step 5: Goal := false belg(Bos) select: belg(Bos)Step 6: Goal := false

Page 45: Automated Reasoning Systems For first order Predicate Logic

45

p p q q r rq q t tq q s s

r r n nr r o ossoonn

Another example (propositional)Another example (propositional)

Prove: Prove: pp Observe:Observe: non-determinism on both atom non-determinism on both atom

selection and on clause selection ! selection and on clause selection ! we only illustrate the clause selection herewe only illustrate the clause selection here

Page 46: Automated Reasoning Systems For first order Predicate Logic

46

Search tree traversed bySearch tree traversed bythe backward procedurethe backward procedure

p p q q r rq q t tq q s sr r n nr r o ossoonn

false false pp

false false qq r r

false false tt r r false false ss r r

false false rr

false false nn false false oo

false false false false

Page 47: Automated Reasoning Systems For first order Predicate Logic

47

Backward procedure Backward procedure is more efficientis more efficient

The proof is now The proof is now goal directedgoal directed towards the theorem. towards the theorem. no more exploration of no more exploration of irrelevant rulesirrelevant rules

Different search methodesDifferent search methodes can be used to traverse can be used to traverse this search tree. this search tree.

Atom-selectionAtom-selection may influence efficiency too: may influence efficiency too: ex.: by detecting a failing branch soonerex.: by detecting a failing branch sooner

but has but has no impactno impact on whether or not we find a on whether or not we find a solutionsolution

(in case there are only (in case there are only finitely many groundfinitely many ground Horn clauses) Horn clauses)

Page 48: Automated Reasoning Systems For first order Predicate Logic

48

Completeness:Completeness: ExampleExample:: false false p p

p p p p (1)(1)p p (2)(2)

Possible derivations:Possible derivations:

false false p p

false false p p(1)(1)

false false p p(1)(1)

……(1)(1)

false false

(2)(2)

Is only complete if the search tree is Is only complete if the search tree is traversed using a complete search method.traversed using a complete search method.

Page 49: Automated Reasoning Systems For first order Predicate Logic

49

Representation-power of Representation-power of ground Horn clausesground Horn clauses

Is Is a subset of a subset of propositionalpropositional logic. logic.

showm(Bos) showm_Bos

big(house(Bos)) big_house_Bos

Example:Example:

In general, more expressive logics are needed.In general, more expressive logics are needed. EssenceEssence: with variables, one formula may be equivalent to a very large number of propositional formulae. : with variables, one formula may be equivalent to a very large number of propositional formulae.