Chapter 9
Logical Inference
- Remember that the purpose of logical inference is to generate new sentences from old sentences where the new sentences are entailed by the old sentences:
- entailment means that the new sentences are necessarily true given that the old sentences are true. The new sentences must be true in all world/models in which the old sentences are true.
- An inference procedure that generates only entailed sentences is called sound
Inference Rules
The Knowledge Base
- The axioms in a knowledge base are satisfiable and they are true for the world/model being represented
- Inference rules are axioms that can be added to any knowledge base because they are valid
Unsound inference rules
- Are there sensible unsound inference rules?
Abduction is an example: the process of reasoning from observation to explanation (or effect to cause); plausible reasoning
- Best done in uncertain reasoning systems based on probability theory
Puzzle K.B. with ground terms only
- 1. contains(b,apples)
- 2. label(a,apple)
- 3.label(b,oranges)
- 4. label(c,bananas)
- 5.contains(a,apples) | contains(a,oranges) | contains(a,bananas)
- 6.contains(b,apples) | contains(b,oranges) | contains(b,bananas)
- 7.contains(c,apples) | contains(c,oranges) | contains(c,bananas)
Puzzle continued
- 8. contains(b,apples) => ~contains(a,apples) ^ ~contains(c,apples)
- 9. contains(c,oranges) => ~contains(a,oranges) ^ ~contains(b,oranges)
- 10. contains(a,bananas) => ~contains(b,bananas) ^ ~contains(c,bananas)
- 11. label(a,apples) => ~contains(a,apples)
- 19. label(c,bananas) => ~contains(c,bananas)
First Puzzle proof
- 20. (1, 8, MP) ~contains(a,apples) ^ ~contains(c,apples)
- 21. (20, AE) ~contains(c,apples)
- 22. (4,19,MP) ~contains(c,bananas)
- 23. (7, 21, 22,UR) contains(c,oranges)
(really 2 steps needed)
- 24. (23, 9, MP) ~contains(a,oranges)
- 25. (2, 11, MP) ~contains(a,apples)
- 26. (5, 24, 25, UR) contains(a,bananas)
(really 2 steps needed)
Puzzle KB with variables
- 1. contains(b,apples)
- 2. label(a,apple)
- 3.label(b,oranges)
- 4. label(c,bananas)
- 5. x contains(x,apples) | contains(x,oranges) | contains(x,bananas)
- 6. x contains(b, x) => ~contains(a, x) ^ ~contains(c, x)
- 7. x contains(c, x) => ~contains(a, x) ^ ~contains(b, x)
- 8. x, y label(x,y) => ~contains(x,y)
Second Puzzle Proof
- 9. (1,6, MP, [x/apples]) ~contains(a,apples) ^ ~contains(c,apples)
- 10. (20,AE) ~contains(c,apples)
- 11. (4, 8, MP, [x/c, y/bananas]) ~contains(c,bananas)
- 12. (5,10,11,UR,[x/c]) contains(c,bananas)
.
.
.
- Could I prove sentences that aren't true in the puzzle world,
e.g., contains(apples,oranges)?
New inference rules for FOPL
New inference rules
Automated proof procedure
- related to search
- start state = KB
- operators = inference rules
- goal state = theorem required
- problem: big branching factor; lots of rules and lots of ways to apply some rules especially universal elimination
Generalized Modus Ponens
Example
- 1. x tall(x) ^ heavy(x) -> big(x)
- 2. tall(john)
- 3. heavy(john)
- 4. (1,2,3,GMP,[x/john]) big(john)
Unification
- The process of finding the substitution is called unification; the substitution itself is a unifier; Generalized Modus Ponens helps focus search on the substitutions that matter
- Unification takes 2 atomic sentences and returns a substitution that makes them look the same.
- unify(p,q) = theta, where subst(theta,p) = subst(theta,q)
Unification Examples
- unify(P(a,x), P(a,b)) = [x/b]
- unify(P(a,x), P(y,b)) = [x/b, y/a]
- unify(P(a,x), P(y,f(y)) = [y/a, x/f(a)]
- unify(P(a,x), P(x,b)) = ?
- unify(P(a,b), P(x,x)) = failure
- unify(P(a,f(a)), P(x,x)) = failure
- We always want the most general unifier (mgu); this is the one that makes the least commitment about the bindings of the variables
- e.g.: unify(P(x,f(y),b), P(x,f(b),b)) = [y/b] OR [x/a,y/b]; which one is the mgu?
Constraints on Unification
- 1. Each occurrence of a variable has the same term substituted for it
- 2. a variable can never be replaced by a term containing that variable, e.g., can’t use [x/f(x)]