110 likes | 123 Views
Knowledge in intelligent systems. So far, we’ve used relatively specialized, naïve agents. How can we build agents that incorporate knowledge and a memory?. Limitations of the approach thus far.
E N D
Knowledge in intelligent systems So far, we’ve used relatively specialized, naïve agents. How can we build agents that incorporate knowledge and a memory?
Limitations of the approach thus far • Thus far, the defining feature of the problems we’ve been solving is that all of the information needed (states and operators) is contained in the problem representation. • Not all tasks are like this. Some cannot be solved without maintaining information over time. This information is called knowledge.
Knowledge-based agents • Knowledge-based agentsmaintain information about their environment in a knowledge base. • The KB consists of a set of facts or assertions about the environment that the agent believes to be true. • These facts can be represented in any fashion, but typically a logic is chosen because of its rigor and computational simplicity.
Basic knowledge bases • The knowledge base is used to store information for later use. This involves two tasks: • ASKing the KB for relevant facts. • TELLing the KB new facts • New facts can be derived from percepts or from inference • Inference rules are specific to the language used to represent knowledge. It is the rigor and simplicity of logical inference rules that makes logics so good for representing information in KBs
The Wumpus World • Environment: • A series of rooms connected by passageways. • In one of these rooms is the wumpus, who will eat you. • Another room has the gold you are trying to find. • Yet other rooms have bottomless pits. • You have one arrow that you can shoot the wumpus with. The arrow flies in a straight line until it hits something (either a wall or the wumpus. • Percepts: • If you are in a room connected to the one where the wumpus is, you can smell it. • If you are in a room adjacent to one where there’s a pit, you can feel a breeze. • When you are in the room with the gold, you can see it glitter • When you shoot the wumpus, you will hear it scream, wherever you are.
Play the game! • Hunt the Wumpus
Structuring a logic • Statements in a logic are sentences that conform to a specific syntax. • (Think “word” and “grammar” from before.) • What separates a logic from a simple language (as we defined them before) is that a logic must also have a way of denoting the semantics or truth of a sentence within a given world. • Finally, logics have to give us the opportunity to reason - to define relationships between sentences such that we can discuss that A follows from B. We call this entailment, or logical inference. • Model checking is the process by which we utilize inference, by inferring only and all of those new facts that are definitely true given what we already know.
Propositional logic • In propositional logic, we represent information as propositions that can be either true or false. These propositions can be combined using certain logical connectives: S Atom | CS Atom TRUE | FALSE | Proposition Proposition P | Q | R …. CS ¬S | (S S) | (S S) | (S S) | (S S)
Inference Rules • What are the means by which we can validly draw inferences in our KB? • Modus Ponens: If we know p q is true, and we know p is true, we can infer q. • And-elimination: If we know (p q) is true, we can infer both p and q. • Logical equivalencies: Any of the equivalencies in Fig. 7-11 can be converted into an inference rule.
The Resolution Rule • The resolution rule allows us to simplify long disjunctions by resolving them with known facts that are complementary to the facts in the disjunction. • For example, we know that if there is a breeze in a square, one of the surrounding squares has a pit: Bi,j(Pi,j-1 Pi, j+1 Pi-1, j Pi+1, j) • However, if we also know ¬Pi, j+1, then we can use infer (Pi,j-1 Pi-1, j Pi+1, j) • This applies to any disjunction and any set of complementary sentences.
Conjunctive Normal Form • Why is the Resolution Rule useful? Any statement in propositional logic can be converted to CNF. • All statements in CNF are conjunctions of disjunctions of literals. • For example, B1,1(P1,2 P2,1) can be converted to: (B1,1 (P1,2 P2,1)) ((P1,2 P2,1) B1,1) (¬ B1,1 P1,2 P2,1) (¬(P1,2 P2,1) B1,1) (¬ B1,1 P1,2 P2,1) ((¬P1,2 ¬P2,1) B1,1) (¬ B1,1 P1,2 P2,1) (¬P1,2 B1,1) (¬P2,1 B1,1)