Title: Automated Reasoning Systems
1Automated Reasoning Systems
- For first order Predicate Logic
2AR general context.
- Given is a knowledge base in predicate logic T
- is a set of formulae in first order logic
- formally also called a Theory
- Given is also an additional first order formula F
- Notation T F (T implies F)
- Find reasoning techniques that allow to decide on
this for EACH F and T. - Requirements
- correctness -- completeness --
efficiency
3AR decidability.
- BUT semi-decidable !
- Completeness Theorem of Goedel 31
- SO if F follows from T, then we find a proof,
else it is possible that the procedure doesnt
terminate.
4Wait a second ...
- Wrong !
- Let T smart(Kelly) en F strong(Kelly)
- Although strong(Kelly) ? strong(Kelly) is always
true, we have - neither smart(Kelly) strong(Kelly)
- nor smart(Kelly) strong(Kelly)
5AR general outline (1).
- First we sketch the most generally used approach
for automated reasoning in first-order logic
- The different technical components will only be
explained in full detail in a second pass
(outline (2)).
6AR general outline (2) .
- We study different subsets of predicate logic
- Horn clause logic
- Clausal logic
- full predicate logic
- In each case we study semi-deciding procedures.
- Each extension requires the introduction of new
techniques.
7Backward Reasoning Resolution
8Backward resolution
90) The TASK (example)
- Are axioms describe knowledge about some world.
- How to prove such theorems in general?
101) Proof by inconsistency
- But add the negation of F to the axioms and prove
that this extension is inconsistent.
- the 4 axioms are never true in 1 same
interpretation.
112) Clausal form
- Normalize the formulae to a (more simple)
standard form.
- ? only left ? only right
- no no ?
which is inconsistent if and only if the
original set was inconsistent.
Notice ?x ?y ?z can be dropped.
12Example
is already in clausal form ( P ? P ? true)
Ps usually requires much more work!
133) Unification
- find their most general common instance.
- Most general unifier (mgu) x -gt f(A)
-
y -gt g(f(A))
144) The resolution step
15De resolutie step (2)
mgu applied to r(z) ? q(g(x))
Clauses on which resolution is performed must
not have any variables in common.
165) Resolution proofs
- In order to prove a set of clauses inconsistent
- apply resolution and add the result to the set
- if you obtain the clause false ? STOP !
This means inconsistency of the last set
17Example
So inconsistent !
18A deeper study
19Horn clause logic
- where A, B1, B2,,Bn are atoms.
- An atom is a formula of the form p(t1,,tm), with
p a predicate symbol and t1,,tm terms. - Horn clause formulae are universally quantified
over all variables that occur in them. - B1,,Bn are called body-atoms of the Horn clause
A is the head of the Horn clause. - n may be 0 in this case we say that the Horn
clause is a fact.
20Alternative notation
- This is a special case of the conjunctive normal
form (only disjunctions and negations), with
only 1 positive disjunct.
21Wich kind of formulaecan we prove?
- All variables are existentially quantified !
22A very simple example
- Bosmans is a showmaster
(1) - Showmasters are rich
(2) - Rich people have big houses
(3) - Big houses need a lot of maintenance (4)
- Goal automatically deduce that Bosmans house
needs a lot of maintenance.
23Representatie in Horn logica
- Bosmans is a showmaster
(1) - Showmasters are rich
(2) - Rich people have big houses
(3) - Big houses need a lot of maintenance
(4) - To prove
showmaster(Bosmans)
?p rich(p) ? showmaster(p)
?p big(house(p)) ? rich(p)
?p lot_maint(house(p)) ? big(house(p))
Lot_maint(house(Bosmans))
24AR for ground Horn clause logic
- Backward (and forward) reasoning
- proof procedures based on generalized Modus Ponens
25Restricting to groundHorn clauses
26Easy with modus ponens !
27Modus ponens in AR
A is also true in this interpretation (see truth
tables)
- Problem how to organize this into a procedure
which is also complete (for ground Horn clauses)?
28Generalized Modus ponens
- Is obviously still correct (truth tables).
29A glimpse at a Forward Reasoning Modus Ponens
strategy
30A forward proof procedure
- Given theory T and formula F
- If all atoms from F are in Derived at
termination, then T implies F, otherwise it
doesnt.
31Extended example
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))
32Remarks
- Correctness generalized modus ponens is correct
- Completeness intuition
- for a finite ground Horn clause theory, only a
finite number of ground atoms are implied - these are all derived after finite time
- Efficiency
- can be extremely slow !
- If T contains many Horn clauses unrelated to F,
then the procedure derives many irrelevant (for F
) atoms.
33Backward reasoning
- For ground Horn Clause logic
34Inconsistency
- A theory T is inconsistent if it has NO model.
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
35The example again
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))
- Problem this is NOT a Horn clause theory !?
36Refutation proofsthe false predicate
- We agree that false has the truth value false
under every interpretation. - Imagine that we defined false as false ?
p ? p for some predicate p
37definite goals
- So what is the form of F?
(?x1 ?xm B1 ? B2 ? ? Bn) ? ?x1 ?xm
(B1 ? B2 ? ? Bn) ? ?x1 ?xm false ?
(B1 ? B2 ? ? Bn) ? ?x1 ?xm false ?
B1 ? B2 ? ? Bn
A ? B ? A ? B
- Observe F is again a Horn clause !!
38In conjunctive normal form
0 positive disjuncts !
- Implicative en disjunctive form remain consistent
- (an empty disjunction is always false)
39Back to the example
- a ground Horn clause theory !
40Modus ponensgeneralized some more
- Ordinary Modus ponens is the special case with
- n i 1 and m 0
- Correctness via truth tables
41Some backward reasoning steps in the example
false ? big(house(Bos))
false ? rich(Bos)
42The backward procedurethe idea
- Apply generalized modus ponens to the body-atoms
Bi of the goal, using the Horn clauses of T
- Then a false formula ia a consequence of T ? F
43Backwards procedure
- On top of this you need to apply backtracking
over the selected clauses and the selected body
atoms. - If the algorithm stops because it has tried all
these alternatives F was not implied!
44Back to the example
Step 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 ?
45Another example (propositional)
- Prove p
- Observe non-determinism on both atom selection
and on clause selection ! - we only illustrate the clause selection here
46Search tree traversed bythe backward procedure
false ? p
p ? q ? r q ? t q ? s r ? n r ? o s o n
47Backward procedure is more efficient
- The proof is now goal directed towards the
theorem. - no more exploration of irrelevant rules
- Different search methodes can be used to traverse
this search tree. - Atom-selection may influence efficiency too
- ex. by detecting a failing branch sooner
- but has no impact on whether or not we find a
solution - (in case there are only finitely many ground
Horn clauses)
48Completeness
false ? p p ? p
(1) p (2)
false ? p
- Is only complete if the search tree is traversed
using a complete search method.
49Representation-power of ground Horn clauses
- Is ? a subset of propositional logic.
- In general, more expressive logics are needed.
- Essence with variables, one formula may be
equivalent to a very large number of
propositional formulae.