Wumpus World Question

View: New views
3 Messages — Rating Filter:   Alert me  

Wumpus World Question

by Poivo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In a simple wumpus world rappresentation(Wumpus world is an N x N board game with a number of wumpuses and treasures that are randomly placed in various cells. Wumpuses emit smell and treasures glitter. Smell and glitter can be sensed in the horizontal and vertical neighbors of the cell containing a wumpus or a treasure. In this simple model pits aren't present.) how to assert  "A cell containing a wumpus impiles all neighbors of that cell smell"?
I already have defined these following relations:
(defconcept Cell (?c))
(defrelation Neighbors ((?c1 Cell) (?c2 Cell)))
(defconcept WumpusCell (?c))
(defconcept Smell (?c Cella) :<=> (exists ?c1 (and (WumpusCell ?c1) (Neighbors ?c ?c1))))

Re: Wumpus World Question

by Thomas Russ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ah yes, the wumpus.  I remember it from the PDP-10....

On Apr 16, 2008, at 1:25 AM, Poivo wrote:

>
> In a simple wumpus world rappresentation(Wumpus world is an N x N  
> board game
> with a number of wumpuses and treasures that are randomly placed in  
> various
> cells. Wumpuses emit smell and treasures glitter. Smell and glitter  
> can be
> sensed in the horizontal and vertical neighbors of the cell  
> containing a
> wumpus or a treasure. In this simple model pits aren't present.) how  
> to
> assert  "A cell containing a wumpus impiles all neighbors of that cell
> smell"?
> I already have defined these following relations:
> (defconcept Cell (?c))
> (defrelation Neighbors ((?c1 Cell) (?c2 Cell)))
> (defconcept WumpusCell (?c))
> (defconcept Smell (?c Cella) :<=> (exists ?c1 (and (WumpusCell ?c1)
> (Neighbors ?c ?c1))))

(assert (=> (and (wumpuscell ?c) (neighbors ?c ?cn))
             (smell ?cn)))

This takes advantage of the fact that the default quantification of  
rules in PowerLoom is universal, sparing you the need to be explicit:

(assert (forall (?c ?cn)
           (=> (and (wumpuscell ?c) (neighbors ?c ?cn))
             (smell ?cn))))

_______________________________________________
powerloom-forum mailing list
powerloom-forum@...
http://mailman.isi.edu/mailman/listinfo/powerloom-forum

Re: Wumpus World Question

by Poivo () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the answers, it's working perfectly! Now with these defitions

(defconcept Cell (?c))
(defrelation Neighbors ((?c1 Cell) (?c2 Cell)))
(defconcept WumpusCell (?c))
(defconcept Smell (?c Cella) :<=> (exists ?c1 (and (WumpusCell ?c1) (Neighbors ?c ?c1))))
(defconcept denywumpus (?c Cella) :<=> (exists ?c1 (and (adiacenti ?c ?c1) (not (smell ?c1)))))

Powerloom can determine effects from causes, but not viceversa. As an example: here's a simple rappresentation of the wumpus's 3x3 world:

(assert (Cell cell0))
(assert (Cell cell1))
(assert (Cell cell2))
(assert (Cell cell3))
(assert (Cell cell4))
(assert (Cell cell5))
(assert (Cell cell6))
(assert (Cell cell7))
(assert (Cell cell8))
(assert (Neighbors cell0 cell1))
(assert (neighbors cell0 cell1))
(assert (neighbors cell0 cell3))
(assert (neighbors cell1 cell0))
(assert (neighbors cell1 cell2))
(assert (neighbors cell1 cell4))
(assert (neighbors cell2 cell1))
(assert (neighbors cell2 cell5))
(assert (neighbors cell3 cell0))
(assert (neighbors cell3 cell4))
(assert (neighbors cell3 cell6))
(assert (neighbors cell4 cell1))
(assert (neighbors cell4 cell3))
(assert (neighbors cell4 cell5))
(assert (neighbors cell4 cell7))
(assert (neighbors cell5 cell2))
(assert (neighbors cell5 cell4))
(assert (neighbors cell5 cell8))
(assert (neighbors cell6 cell3))
(assert (neighbors cell6 cell7))
(assert (neighbors cell7 cell4))
(assert (neighbors cell7 cell6))
(assert (neighbors cell7 cell8))
(assert (neighbors cell8 cell5))
(assert (neighbors cell8 cell7))

Graphically speaking:
  __________________
 |__0_ _|__1_ __|__2__ |
 |__3_ _|__4___ | _5___|
 |__6_ _|__7___ | _8___|

Stating that:

(assert (WumpusCell cella7))

And asking

(retrieve all(smell ?c))

Powerloom correctly retrieves:

 There are 4 solutions:
   #1: ?C=CELL4
   #2: ?C=CELL6
   #3: ?C=CELL8
   #4: ?C=CELL7

While, with these assertions:
(assert (smell cell4))
(assert (smell cell6))
(assert (smell cell8))
(assert (smell cell7))
;;the following two assertions are needed to univocally identify a single cell containing the wumpus
(assert (not (smell cell3)))
(assert (not (smell cell5)))

Powerloom isn't able to determine the single cell containing the wumpus:

(retrieve all(WumpusCell ?c))

No solutions.

(...

Even if is able to determine without error all the cells that does NOT contain it:

(retrieve all(denywumpus ?c))
There are 5 solutions:
   #1: ?C=CELL8
   #2: ?C=CELL6
   #3: ?C=CELL4
   #4: ?C=CELL2
   #5: ?C=CELL0

...)


I thought adding even more definitions or rules, but they all seem very artificial and not formerly correct.
Any idea on how to let Powerloom determine wumpus's positions?