Additional Clarification
De Morgan’s rules for quantification
Higher Order Logics
- FOPL allow you to quantify over objects (the entities that exist in the world).
- Higher order logics allow you to quantify over relations (predicates) as well
- This is sometimes very useful (e.g., representing beliefs) but there is no understanding of how to reason effectively with such logics so we stick to FOPL.
Axioms and Theorems
- Mathematicians distinguish between axioms and theorems:
- Axioms are the basic facts about a domain
- Theorems are proved by applying inference procedures to axioms
(axioms entail theorems)
Building a Knowledge Base
- 5 step methodology
- 1. Decide what to talk about
- 2. Decide on Predicates, functions and constants
- 3. Encode the general knowledge about the domain
- 4. Encode the specific problem instance
- 5. Use inference procedures to get the answer
An Example Problem --- the mislabeled boxes puzzle
- Puzzle: A merchant places 3 boxes on a table. Each box contains only 1 kind of fruit: apples, bananas or oranges. You are asked to guess which fruit is in each box. The merchant tells you that each box is mislabeled. Box a is labeled apples, box b oranges, and box c bananas. You are allowed to look in the box labeled oranges and you find that it contains apples. What do you guess the contents of the other 2 boxes are?
Solution
- Objects:
- fruits: apples, oranges, and bananas
- boxes: a, b, and c
Solution continued
- Domain specific knowledge:
- Problem specific knowledge:
- 1. contains(b, apples)
- 2. label(a, apples)
- 3. label(b, oranges)
- 4. label(c, bananas)
Solution continued
Solution continued
Solution continued
Representing Change in the World
- A model-based agent is an agent that keeps track of the world by maintaining an internal model of the relevant aspects of the world.
- The alternative is a reflex agent that maps from percepts to actions
Situation Calculus
- Situation Calculus is a formalism for representing change in the world in FOPL --- representing diachronic rules.
- It identifies situations (the state of the world at a particular time); instead of P(x1,x2,...xn) you have P(x1,x2,...xn,s) where s is a situation variable. Are situations objects?
- Can use situations to represent different states of the world in the same knowledge base.
Situation Calculus continued
- Every property or relation that can change over time is given an extra situation argument; this is crucial to determining the truth of the sentence.
- Example:
- at(agent, [1,1], s0)
- at(agent, [1,2], s1)
Effect Axioms
Frame Axioms
Simplified Wumpus World I
OTTER input file
- set(auto).
- formula_list(usable).
- adjacent(start, middle).
- adjacent(middle, finish).
- all s l1 l2 (at(agent, l1, s) & adjacent(l1, l2) -> at(agent, l2, result(goForward, s))).
- at(agent, start, s0).
- -(exists s (at(agent, finish, s))).
- end_of_list.
OTTER Proof
- ------------- PROOF ------------
- 1 [] -at(agent,x,y) | -adjacent(x,z) | at(agent,z,result(goForward,y)).
- 2 [] -at(agent,finish,x).
- 3 [] adjacent(start,middle).
- 4 [] adjacent(middle,finish).
- 5 [] at(agent,start,s0).
OTTER Proof (continued)
- 6 [hyper,5,1,3] at(agent,middle,result(goForward,s0)).
- 7 [hyper,6,1,4] at(agent, finish, result(goForward,result(goForward,s0))).
- 8 [binary,7.1,2.1] $F.
Synchronic Rules
- So far have specified rules about what changes over time also need “same time” rules:
- causal rules:
- loc1, loc2, s at(W, loc1, s) ^ adjacent(loc1, loc2) => smelly(loc2)
- diagnostic rules:
- loc1, s smelly(loc1) => loc2 at(W, loc2, s) ^
adjacent(loc1, loc2) | loc1 = loc2