Download presentation
Presentation is loading. Please wait.
1
CHAPTER-4 LOGICAL AGENT
2
KNOWLEDGE-BASED AGENT
The central component of a knowledge-based agent is its knowledge base. A knowledge base is a set of sentences. Each sentence is expressed in a language called a knowledge representation language and represents language some assertion about the world. There should be a way to add new sentences to KB, and to query what is known.
3
KNOWLEDGE-BASED AGENT
The standard names for these tasks are TELL and ASK. Both tasks may involve inference –that is driving new sentence from old. Inference must obey the fundamental requirement that when one ASKs a question o knowledge base , the answer should follow from what has been told, TELLED to the knowledge base previously.
4
Knowledge-based agent
5
KNOWLEDGE-BASED AGENT: BACKGROUND KNOWLEDGE
The agent maintains a knowledge base , KB,which contain some back ground knowledge. Each time the agent program is called it does three things: First TELLs the KB what it perceives Second -ASK the KB what action it should perform Third -The agent records its choice with TELL and the action is executed
6
KNOWLEDGE-BASED AGENT: BACKGROUND KNOWLEDGE
The details of the representation language are hidden inside three functions: MAKE-PERCEPT-SENTENCE: the agent perceived the given percept at the given time. MAKE-ACTION-QUERY: constructs a sentence that asks what action should be done at the current time MAKE –ACTION-SENTENCE: constructs a sentence asserting that the chosen action was executed. The details of inference mechanisms are hidden inside TELL and ASK
7
DECLARATIVE VS PROCEDURAL APPROACH
Designing the representation language to make it easy to express this knowledge in the form of sentences simplifies the construction problem. This is called the declarative approach to system building. The procedural approach encodes desired behaviors directly as program code ;minimizing the role of explicit representation and reasoning can result in much more efficient system
8
THE WUMPUS WORLD Wumpus world is a cave consisting of rooms connected by passageways. A beast that eats anyone who enters its room. The Wumpus can be shot by an agent but the agent has only one arrow. Some rooms contain bottomless pits that will trap anyone who wanders into these rooms. GOAL is to find a heap of gold.
9
WUMPUS WORLD PEAS DESCRIPTION
Performance measure: for picking up the gold,-1000 for falling into a pit or being eaten by the wumpus ,-1 for each action taken and -10 for using up the arrow Environment: A 4×4 grid of rooms.
10
WUMPUS WORLD PEAS DESCRIPTION
Sensors: The agent has five sensors each of which gives a single bit of information. Stench- In the square containing the Wumpus and in the directly (not diagonally) adjacent squares the agent will perceive a stench. Breeze- In the square directly adjacent to a pit, the agent will perceive a breeze. Glitter- In the square where the gold is, the agent will perceive a glitter. When an agent walks into a wall, it will perceive a bump. When the Wumpus is killed, it emits a woeful scream that can be perceived anywhere in the cave. • Actuators: The agent can move forward ,turn left by 90o or turn right by 90o The agent dies if it enters a square containing a pit or a live wumpus.
11
LOGIC X + Y =4 is a well –formed sentence
Syntax of the representation language ,which specifies all the sentences that are well formed . X + Y =4 is a well –formed sentence X2Y += not a well-formed sentence A logic must also define the semantics of the language, meaning of sentences In logic the meaning is more precise .It defines the truth of each sentence with respect to each possible world Eg: x + y =4 is true, x=2 and y=4 x+y =4 is false ,x=1 and y=1
12
LOGIC • The term model in place of Possible world – model • m is a model of α – the sentence α is true in model m
13
ENTAILMENT •The relation of logical entailment is the idea that a sentence follows logically from another sentence. α╞ β The sentence α entails the sentence β The formal definition : α╞ β if and only if in every model in which α is true β is also true. if α is true then β must also be true Eg: x+y =4 entails the sentence 4= x+y
14
INFERENCE An inference algorithm i can derived a from KB, we write
KB ├i α which is pronounced “α is derived from KB by i “ or “ i derives a from KB” sentence α can be derived from KB by a procedure i (an inference algorithm)
15
PROPOSITIONAL LOGIC Propositional logic is the simplest logic – illustrates basic ideas The relation between a sentence and another sentence is called entailment. Syntax The syntax of propositional logic defines the allowable sentences. The atomic sentences- the indivisible syntactic elements-consist of a single proposition symbol. Each such symbol stands for a proposition that can be true or false. Uppercase names for symbols P,Q,R and so on. There are two proposition symbols with fixed meanings: True is the always true –proposition and False is the always false proposition
16
PROPOSITIONAL LOGIC Complex sentences are constructed from simpler sentences using logical connectives. There are 5 connectives in common use: NOT (¬): ¬W is called negation AND(˄) : W1,3 A P3,1 is called conjuction ;it’s part are the conjuncts. OR(˅) : A sentence using V such as (W1,3A P3,1) V W2,2 is called disjunction ;is a disjunction of disjuncts. Implies(⇒): A sentence such as (W1,3A P3,1)⇒ ¬W2,2 is called an implication. Its premise or antecedent is (W1,3A P3,1) and its conclusion or consequent is ¬W2,2 . Implications are also known as rules or if-then statements. If and only if(⇔): W1,3 ⇔ ¬W2,2 is a biconditional
17
BNF FOR PROPOSITIONAL LOGIC
18
ORDER OF PRECEDENCE The order of precedence in propositional logic is from highest to lowest is: ⌐,ᴧ,ᴠ, ⇒, ⇔
19
PROPOSITIONAL LOGIC: SEMANTICS
Semantics defines the rules for determining the truth of a sentence with respect to a particular model. Each model specifies true/false for each proposition symbol. All sentences are constructed from atomic sentences and the five connectives. A knowledge base consists of a set of sentences. Logical knowledge base is a conjunction of those sentences. ⇒ (implies) eg: P implies Q or if P then Q.
20
TRUTH TABLES FOR 5 LOGICAL CONNECTIVES
21
STANDARD LOGICAL EQUIVALENCES
22
REASONING PATTERNS IN PROPOSITIONAL LOGIC
Patterns of inference are called inference rules. The best known rule is called Modus Ponens (α ⇒ β), α β The notation means that whenever any sentences of the form α ⇒ β and α are given then the sentence β will be inferred. And-Elimination, which says that ,from a conjunction any of the conjucts can be inferred α ˄ β α
23
CONJUNCTIVE NORMAL FORM(CNF)
A sentence expressed as a conjunction of disjunctions of literals is said to be in conjunctive normal form or CNF. Steps of CNF: Eliminate ⇔, replacing (α ⇔ β) with ((α ⇒ β) ˄ (( β ⇒ α ) Eliminate ⇒ ,replacing (α ⇒ β) with (¬ α˅ β) ¬(¬a) ≡ a a double – negation elimination ¬(α ˄ β) ≡ (¬ α ˅ ¬ β) De Morgan ¬(α ˅ β) ≡ (¬ α ˄ ¬ β) De Morgan
24
THANK YOU!!!
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.