CSharp  Java  Python  Swift  GO  WPF  Ruby  Scala  F#  JavaScript  SQL  PHP  Angular  HTML
Knowledgebase for Wumpus worldAs in the previous topic we have learned about the wumpus world and how a knowledgebased agent evolves the world. Now in this topic, we will create a knowledge base for the wumpus world, and will derive some proves for the Wumpusworld using propositional logic. The agent starts visiting from first square [1, 1], and we already know that this room is safe for the agent. To build a knowledge base for wumpus world, we will use some rules and atomic propositions. We need symbol [i, j] for each location in the wumpus world, where i is for the location of rows, and j for column location. Atomic proposition variable for Wumpus world:
Note: For a 4 * 4 square board, there will be 7*4*4= 122 propositional variables.Some Propositional Rules for the wumpus world:Note: lack of variables gives us similar rules for each cell.Representation of Knowledgebase for Wumpus world:Following is the Simple KB for wumpus world when an agent moves from room [1, 1], to room [2,1]: Here in the first row, we have mentioned propositional variables for room[1,1], which is showing that room does not have wumpus(¬ W_{11}), no stench (¬S_{11}), no Pit(¬P_{11}), no breeze(¬B_{11}), no gold (¬G_{11}), visited (V_{11}), and the room is Safe(OK_{11}). In the second row, we have mentioned propositional variables for room [1,2], which is showing that there is no wumpus, stench and breeze are unknown as an agent has not visited room [1,2], no Pit, not visited yet, and the room is safe. In the third row we have mentioned propositional variable for room[2,1], which is showing that there is no wumpus(¬ W21), no stench (¬S_{21}), no Pit (¬P_{21}), Perceives breeze(B_{21}), no glitter(¬G_{21}), visited (V_{21}), and room is safe (OK_{21}). Prove that Wumpus is in the room (1, 3)We can prove that wumpus is in the room (1, 3) using propositional rules which we have derived for the wumpus world and using inference rule.
We will firstly apply MP rule with R1 which is ¬S_{11} → ¬ W_{11} ^ ¬ W_{12} ^ ¬ W_{21}, and ¬S_{11} which will give the output ¬ W_{11} ^ W_{12} ^ W_{12}.
After applying Andelimination rule to ¬ W_{11} ∧ ¬ W_{12} ∧ ¬ W_{21}, we will get three statements:
Now we will apply Modus Ponens to ¬S_{21} and R2 which is ¬S_{21} → ¬ W_{21} ∧¬ W_{22} ∧ ¬ W_{31}, which will give the Output as ¬ W_{21} ∧ ¬ W_{22} ∧¬ W_{31}
Now again apply Andelimination rule to ¬ W_{21} ∧ ¬ W_{22} ∧¬ W_{31}, We will get three statements:
Apply Modus Ponens to S_{12} and R_{4} which is S_{12} → W_{13} ∨. W_{12} ∨. W_{22} ∨.W_{11}, we will get the output as W_{13}∨ W_{12} ∨ W_{22} ∨.W_{11}.
After applying Unit resolution formula on W_{13} ∨ W_{12} ∨ W_{22} ∨W_{11} and ¬ W_{11} we will get W_{13} ∨ W_{12} ∨ W_{22}.
After applying Unit resolution on W_{13} ∨ W_{12} ∨ W_{22}, and ¬W_{22}, we will get W_{13} ∨ W_{12} as output.
After Applying Unit resolution on W_{13} ∨ W_{12} and ¬ W_{12}, we will get W_{13} as an output, hence it is proved that the Wumpus is in the room [1, 3].
Next TopicFirstOrder Logic
