Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

aima-talk · AI: A Modern Approach: Help for the text

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 381 - 411 of 946   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#381 From: žBĪjĪļ <r8921025@...>
Date: Thu Jul 29, 2004 4:23 am
Subject: Is this a bug in Chap 23.2 ?
r8921025
Send Email Send Email
 
Is this a bug in Chap 23.2 ?

On p. 841, line -7,
"we can rank documents based on the score:
P(r|D,Q)/P(~r|D,Q)=...
"

then on p. 842, line 1,
"With the assumption, we get
P(r|D,Q)/P(~r|D,Q)
=P(Q|D,r)*P(r|D) / P(~r|D)
"

I believe the derivation of the latter has bug.
What I'd suggest, is:
P(r|D,Q)/P(~r|D,Q)
=P(Q|D,r)*P(r|D) / (P(~r|D)*P(Q|D,~r))
=P(Q|D,r)*P(r|D) / (P(~r|D)*P(Q|~r)) by using the assumption on p.
841, last line.

But then the author would need to explain how to calculate the new
term P(Q|~r)).

David Liu

#382 From: žBĪjĪļ <r8921025@...>
Date: Thu Jul 29, 2004 4:29 am
Subject: Need reference for the equations on Language Modeling approach to info retrieval
r8921025
Send Email Send Email
 
Hi,
I'm looking for the source paper/publication of the equations on the
Language Modeling approach to information retrieval (Chap.23.2,
p.841, P(r|D,Q)=... ).  Does anybody know which paper these
equations came from?

Thanks!
David Liu

#383 From: Peter Fein <pfein@...>
Date: Mon Aug 9, 2004 4:20 pm
Subject: Examples License?
pafein
Send Email Send Email
 
Hi-

What license does do the sources in the code repository fall under?  I'm
interested in using some of these on a proprietary contract job.  Can I
use the code directly or do I need to write my own version based on
the repository (or would that be covered by the original license as
well, as is the case with the GPL)?  FWIW, I own the book... ;)  Thanks!

--Peter Fein

--
Peter Fein                 pfein@...                 773-575-0694

Be alert - some terrorists look normal. -Ministry of Information, Brazil

#384 From: rajat arora <rajatarora_82@...>
Date: Thu Aug 12, 2004 5:37 am
Subject: ur kind attention
rajatarora_82
Send Email Send Email
 
hello,
      kindly give me some valuable information on artificial intelligence as a topic to be discussed in the seminar.. would be waiting for your reply soon..
 thanking you,
rajat arora

Yahoo! India Matrimony: Find your life partner online.


#385 From: Peter Fein <pfein@...>
Date: Mon Aug 9, 2004 5:11 pm
Subject: Examples License?
pafein
Send Email Send Email
 
Should have clarified...  are the *Python* sources in the repository
under the same license as the Lisp sources (located at:
http://www.norvig.com/license.html)?

--Pete

Hi-

What license does do the sources in the code repository fall under?  I'm
interested in using some of these on a proprietary contract job.  Can I
use the code directly or do I need to write my own version based on
the repository (or would that be covered by the original license as
well, as is the case with the GPL)?  FWIW, I own the book... ;)  Thanks!

--Peter Fein

--
Peter Fein                 pfein@...                 773-575-0694

Be alert - some terrorists look normal. -Ministry of Information, Brazil

#386 From: "wizniz" <wizniz@...>
Date: Mon Sep 6, 2004 6:23 pm
Subject: Need help with A* search question
wizniz
Send Email Send Email
 
Hi i got a question here.. im pretty weak with java coding but i
learnt that the best way to solve this question i have is to use
java.

How do i use vectors to create the tree in the first place for this
question? i was thinking if i needed a vector the information needed
would be

Vector CityA (straight line distance) (distance so far=cost)

how do i use the vector to show teh connection or check for
connection for each city?

If anyone can help me with this pls email me.. either with some help
or if u have a suggested solution using java code. I would be most
grateful.. tnx a million.

Rgds
Feroz

---------------------------------------------------------
My aim is to find a path with the shortest distance between any 2
cities in a graph of interconnecting cities.

Input being : a list of city names, their x-coordinate and y-
coordinate. For example

city washington 138.0 145.0

The name of a city is a string of characters without any intervening
spaces.If two cities are connected by a direct route, it is indicated
in the input file. For example,

conn washington boston

indicates that washington is connected by a direct route to boston.
The start city and goal (destination) city is also indicated in the
input file. For example,

start kansas
goal michigan

indicates that kansas is the start city and michigan the goal
(destination) city.

Given the x- and y-coordinates of the cities, the connections between
the cities, the start city and the goal city, the program is to
perform A* search to find a path with the shortest distance from the
start city to the goal city. The straight-line distance is to be used
as the heuristic function, with the assumption that the cities are
laid out on a 2-dimensional plane.

The program must be general and works correctly on any number of
cities and any interconnection configuration.

-------------------------------------
An example inputfile is:
city  washington 138.0 145.0
city  california 149.0 145.0
city  michigan 142.0 137.0
city  boston  145.0 142.0
city  kansas 151.0 146.0
conn  washington boston
conn  washington kansas
conn  california boston
conn  california kansas
conn  michigan boston
start  kansas
goal   michigan

The corresponding outputfile in this case is:
13.067 kansas california boston michigan 0.01 sec

#387 From: Augustine ssevviri <augkaddu@...>
Date: Tue Sep 7, 2004 9:49 am
Subject: Expert system design
augkaddu
Send Email Send Email
 
Hi collegues,
 
Am here stuck with my MSc proposal.  It is on expert system design in laboratory medicine.
 
Iam stuck with the design part in the methodology section. 
 
I get no where for the necessary guidelines. If you could bail me out. 
 
Please it would be very kind of you. 
 
Hoping to hear from you soon.
 
Thanks.
 
Augustine


Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.

#388 From: Dan <nicknamero@...>
Date: Mon Aug 23, 2004 8:29 am
Subject: AIMA, Solved problems
nicknamero
Send Email Send Email
 
Hi,
I'm new in AI, I read some chapters from AIMA, and I resolve some problems, but I'm not sure if my result is corect, so , I ask you, THERE IS SOMEWHERE THE SOLUTIONS FOR AIMA PROBLEMS?
Thank You


Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

#389 From: "j1mmy_n3u7120n" <padmatv@...>
Date: Wed Sep 8, 2004 1:18 am
Subject: Re: Expert system design
j1mmy_n3u7120n
Send Email Send Email
 
Can u clarify more on your problem?

Disclaimer : I am not an expert at expert systems(no pun intended!).
But i have made some small scale expert systems in traditional
Languages like C/C++ and Java.
--- In aima-talk@yahoogroups.com, Augustine ssevviri <augkaddu@y...>
wrote:
> Hi collegues,
>
> Am here stuck with my MSc proposal.  It is on expert system design
in laboratory medicine.
>
> Iam stuck with the design part in the methodology section.
>
> I get no where for the necessary guidelines. If you could bail me
out.
>
> Please it would be very kind of you.
>
> Hoping to hear from you soon.
>
> Thanks.
>
> Augustine
>
>
> ---------------------------------
> Do you Yahoo!?
> Win 1 of 4,000 free domain names from Yahoo! Enter now.

#390 From: "j1mmy_n3u7120n" <padmatv@...>
Date: Wed Sep 8, 2004 1:11 am
Subject: Re: Need help with A* search question
j1mmy_n3u7120n
Send Email Send Email
 
Vectors will be hardly helpful! I see it nothing more than a
collection of elements just like an array. Moreover its pretty slow.

For your problem there is a much easier implementation,
write a class edge say like,
class Edge
{
/*basic attributes*/
String City1,City2;
float heuristic distance;
/*basic method*/
calcHeuristic()

/*Other methods and attributes may be added as needed*/
}

Then simply create a 2D Matrix
Edge[][];

read from the file and generate the appropriately sized matrix.
u can index the cities as u wish.
for ur example, we can have
0 washington
1 california
2 michigan
3 boston
4 kansas

Notice that all this is done just at the start .. then simply run
your A* algorithm on this matrix(which will have all the heuristic
distances already calculated).

This implementation is much easier to implement and not to mention
smaller.

--- In aima-talk@yahoogroups.com, "wizniz" <wizniz@r...> wrote:
> Hi i got a question here.. im pretty weak with java coding but i
> learnt that the best way to solve this question i have is to use
> java.
>
> How do i use vectors to create the tree in the first place for this
> question? i was thinking if i needed a vector the information
needed
> would be
>
> Vector CityA (straight line distance) (distance so far=cost)
>
> how do i use the vector to show teh connection or check for
> connection for each city?
>
> If anyone can help me with this pls email me.. either with some
help
> or if u have a suggested solution using java code. I would be most
> grateful.. tnx a million.
>
> Rgds
> Feroz
>
> ---------------------------------------------------------
> My aim is to find a path with the shortest distance between any 2
> cities in a graph of interconnecting cities.
>
> Input being : a list of city names, their x-coordinate and y-
> coordinate. For example
>
> city washington 138.0 145.0
>
> The name of a city is a string of characters without any
intervening
> spaces.If two cities are connected by a direct route, it is
indicated
> in the input file. For example,
>
> conn washington boston
>
> indicates that washington is connected by a direct route to boston.
> The start city and goal (destination) city is also indicated in the
> input file. For example,
>
> start kansas
> goal michigan
>
> indicates that kansas is the start city and michigan the goal
> (destination) city.
>
> Given the x- and y-coordinates of the cities, the connections
between
> the cities, the start city and the goal city, the program is to
> perform A* search to find a path with the shortest distance from
the
> start city to the goal city. The straight-line distance is to be
used
> as the heuristic function, with the assumption that the cities are
> laid out on a 2-dimensional plane.
>
> The program must be general and works correctly on any number of
> cities and any interconnection configuration.
>
> -------------------------------------
> An example inputfile is:
> city  washington 138.0 145.0
> city  california 149.0 145.0
> city  michigan 142.0 137.0
> city  boston  145.0 142.0
> city  kansas 151.0 146.0
> conn  washington boston
> conn  washington kansas
> conn  california boston
> conn  california kansas
> conn  michigan boston
> start  kansas
> goal   michigan
>
> The corresponding outputfile in this case is:
> 13.067 kansas california boston michigan 0.01 sec

#391 From: Paolo Amoroso <amoroso@...>
Date: Wed Sep 8, 2004 1:10 pm
Subject: Re: Expert system design
amoroso_paolo
Send Email Send Email
 
Augustine ssevviri <augkaddu@...> writes:

> Am here stuck with my MSc proposal.  It is on expert system design in
laboratory medicine.
>
> Iam stuck with the design part in the methodology section.

You may check this book on the classic MYCIN system:

   http://www.aaai.org/Resources/Classics/Mycin/mycin.html


Paolo
--
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

#392 From: "origenis" <origenis@...>
Date: Sat Sep 11, 2004 5:12 am
Subject: An comment on Figure 3.17
origenis
Send Email Send Email
 
Hello everyone,

the authors state about bidirectional search that (p. 80):

"Bidirectional search is implemented by having one or both of the
searches check each node before it is expanded to see if it is in the
fringe of the other search tree; if so a solution has been found."

Although this is true, if only one search checks in the other's fringe
bidirectional search is complete, but not optimal. Thus in Figure 3.17
p.81, there should be another footnote for bidirectional search
stating that in order to be optimal, both searches have to check the
fringe of the other before they expand each node.

Regards,

Kyriakos Chatzidimitriou

#393 From: Nizam A Haja <wizniz@...>
Date: Sun Sep 12, 2004 6:19 am
Subject: Re: Re: Need help with A* search question
wizniz
Send Email Send Email
 
Hi jimmy.. thanks a lot for  ur reply..

but i dont quite understand what the class edge is
for.. and how i can use the matrix to find out the
best solution i want..

would u have the code for that part? im confused on
how to use the class and yet show the overrall total
distance travelled so far.. and the A* search works on
a stucture that seems like a tree after the distances
are all worked out right?

Would u be able to write the code to solve this
question? If its not too much trouble.. thnx.

I could take a look and learn from it then..

Rgds
Feroz


--- j1mmy_n3u7120n <padmatv@...> wrote:

> Vectors will be hardly helpful! I see it nothing
> more than a
> collection of elements just like an array. Moreover
> its pretty slow.
>
> For your problem there is a much easier
> implementation,
> write a class edge say like,
> class Edge
> {
> /*basic attributes*/
> String City1,City2;
> float heuristic distance;
> /*basic method*/
> calcHeuristic()
>
> /*Other methods and attributes may be added as
> needed*/
> }
>
> Then simply create a 2D Matrix
> Edge[][];
>
> read from the file and generate the appropriately
> sized matrix.
> u can index the cities as u wish.
> for ur example, we can have
> 0 washington
> 1 california
> 2 michigan
> 3 boston
> 4 kansas
>
> Notice that all this is done just at the start ..
> then simply run
> your A* algorithm on this matrix(which will have all
> the heuristic
> distances already calculated).
>
> This implementation is much easier to implement and
> not to mention
> smaller.
>
> --- In aima-talk@yahoogroups.com, "wizniz"
> <wizniz@r...> wrote:
> > Hi i got a question here.. im pretty weak with
> java coding but i
> > learnt that the best way to solve this question i
> have is to use
> > java.
> >
> > How do i use vectors to create the tree in the
> first place for this
> > question? i was thinking if i needed a vector the
> information
> needed
> > would be
> >
> > Vector CityA (straight line distance) (distance so
> far=cost)
> >
> > how do i use the vector to show teh connection or
> check for
> > connection for each city?
> >
> > If anyone can help me with this pls email me..
> either with some
> help
> > or if u have a suggested solution using java code.
> I would be most
> > grateful.. tnx a million.
> >
> > Rgds
> > Feroz
> >
> >
>
---------------------------------------------------------
> > My aim is to find a path with the shortest
> distance between any 2
> > cities in a graph of interconnecting cities.
> >
> > Input being : a list of city names, their
> x-coordinate and y-
> > coordinate. For example
> >
> > city washington 138.0 145.0
> >
> > The name of a city is a string of characters
> without any
> intervening
> > spaces.If two cities are connected by a direct
> route, it is
> indicated
> > in the input file. For example,
> >
> > conn washington boston
> >
> > indicates that washington is connected by a direct
> route to boston.
> > The start city and goal (destination) city is also
> indicated in the
> > input file. For example,
> >
> > start kansas
> > goal michigan
> >
> > indicates that kansas is the start city and
> michigan the goal
> > (destination) city.
> >
> > Given the x- and y-coordinates of the cities, the
> connections
> between
> > the cities, the start city and the goal city, the
> program is to
> > perform A* search to find a path with the shortest
> distance from
> the
> > start city to the goal city. The straight-line
> distance is to be
> used
> > as the heuristic function, with the assumption
> that the cities are
> > laid out on a 2-dimensional plane.
> >
> > The program must be general and works correctly on
> any number of
> > cities and any interconnection configuration.
> >
> > -------------------------------------
> > An example inputfile is:
> > city  washington 138.0 145.0
> > city  california 149.0 145.0
> > city  michigan 142.0 137.0
> > city  boston  145.0 142.0
> > city  kansas 151.0 146.0
> > conn  washington boston
> > conn  washington kansas
> > conn  california boston
> > conn  california kansas
> > conn  michigan boston
> > start  kansas
> > goal   michigan
> >
> > The corresponding outputfile in this case is:
> > 13.067 kansas california boston michigan 0.01 sec
>
>
>




__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

#394 From: peter@...
Date: Sun Sep 12, 2004 10:39 am
Subject: Hi! :-)
norvig
Send Email Send Email
 
I don't bite, weah!

password -- 37062

#395 From: "talk2ravig" <ravindrag@...>
Date: Wed Sep 15, 2004 3:28 pm
Subject: AIMA source - Problem in DPLL implmentation
talk2ravig
Send Email Send Email
 
I was checking out the DPLL implementation in Java. For a small
formula having just 2 variables it ran into StackOverflow!! Following
is the formula for which I got the error.

((A OR (NOT A)) AND (A OR B))

Is this a bug or am I missing something?

Thanks,
Ravi

#396 From: Amit <realamit@...>
Date: Wed Sep 15, 2004 3:02 pm
Subject: Hi
realamit
Send Email Send Email
 

Hi Friends

Plz accept my greetings for this useful group. i am feeling very proud to join this group.

 

best wishes 



Don't Forget To Reply Me @ realamit@...

Don't Forget To Call Me @ 9426 0282 97

Don't Forget To Fill My Add. Book @ http://www.freegb.net/gbook.cgi?94511 


Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.

#397 From: "j1mmy_n3u7120n" <padmatv@...>
Date: Thu Sep 16, 2004 11:40 am
Subject: Re: Need help with A* search question
j1mmy_n3u7120n
Send Email Send Email
 
Note that the class is of no specific use , its more like the
structure in C but u can add some important functions like
calcHeuristic to this class which calculates heuristic distances (in
your case the euclidean distance between the cities).

the class matrix Edge[][] is nothing more than a weighted matrix like
the one we use in graphs.(Note that the tree is also a graph without
loops thats all. So u can represent a tree even in a weighted matrix
form .... )

what i did was instead of having just simple weighted matrix ... i
have many information stored along with the weight. For applying the
A* to this matrix .. u will be travelling the matrix from (left to
right) or (top to bottom) whichever way u prefer.

-- AI

P.S -> And no i don't have a working code neither am i planning to
write one in the immediate future.

--- In aima-talk@yahoogroups.com, Nizam A Haja <wizniz@r...> wrote:
> Hi jimmy.. thanks a lot for  ur reply..
>
> but i dont quite understand what the class edge is
> for.. and how i can use the matrix to find out the
> best solution i want..
>
> would u have the code for that part? im confused on
> how to use the class and yet show the overrall total
> distance travelled so far.. and the A* search works on
> a stucture that seems like a tree after the distances
> are all worked out right?
>
> Would u be able to write the code to solve this
> question? If its not too much trouble.. thnx.
>
> I could take a look and learn from it then..
>
> Rgds
> Feroz

#398 From: "magesmail" <magesmail@...>
Date: Thu Sep 16, 2004 7:11 am
Subject: Re: AIMA source - Problem in DPLL implmentation
magesmail
Send Email Send Email
 
hi,
*looks*  like it's a bug . I'll look into it (and correct the code ) .
  Thanks,
  Ravi



--- In aima-talk@yahoogroups.com, "talk2ravig" <ravindrag@g...> wrote:
>
> I was checking out the DPLL implementation in Java. For a small
> formula having just 2 variables it ran into StackOverflow!! Following
> is the formula for which I got the error.
>
> ((A OR (NOT A)) AND (A OR B))
>
> Is this a bug or am I missing something?
>
> Thanks,
> Ravi

#399 From: "talk2ravig" <ravindrag@...>
Date: Sat Sep 18, 2004 6:20 am
Subject: Re: AIMA source - Problem in DPLL implmentation
talk2ravig
Send Email Send Email
 
Hi Ravi,

Thanks. I did spend little time trying to go through the code to see
if there is anything I can fix myself. But haven't been able to give
sufficient time to that.
Initially I suspected OR statement but found that it happens with
pure AND statements as well e.g., ((A AND (NOT A)) AND B)

Regards,
Ravi


--- In aima-talk@yahoogroups.com, "magesmail" <magesmail@y...> wrote:
> hi,
> *looks*  like it's a bug . I'll look into it (and correct the
code ) .
>  Thanks,
>  Ravi
>
>
>
> --- In aima-talk@yahoogroups.com, "talk2ravig" <ravindrag@g...>
wrote:
> >
> > I was checking out the DPLL implementation in Java. For a small
> > formula having just 2 variables it ran into StackOverflow!!
Following
> > is the formula for which I got the error.
> >
> > ((A OR (NOT A)) AND (A OR B))
> >
> > Is this a bug or am I missing something?
> >
> > Thanks,
> > Ravi

#400 From: "talk2ravig" <ravindrag@...>
Date: Sat Sep 18, 2004 7:52 am
Subject: Re: AIMA source - Problem in DPLL implmentation
talk2ravig
Send Email Send Email
 
Hi Ravi,

I could fix the problem by doing the following changes to the code.
Not completely sure whether it breaks something else!

In the findPureSymbol() method of the DPLLSatisfiable class before
returning a new binding (new SymbolValuePair) a check is made (lines
162 and 166) to ensure that the symbol if present in
allPositiveSymbols *should not* be present in the allNegativeSymbols
and the other way. This check was causing the method to return NULL
for the examples I gave.

I commented-out the second condition of both the IFs (line 163 and
167) and it *seems* to have fixed the problem.

Was there any specific reason this check was in place? Are there any
negative side-effects of the change proposed above?

Thanks,
Ravi


--- In aima-talk@yahoogroups.com, "magesmail" <magesmail@y...> wrote:
> hi,
> *looks*  like it's a bug . I'll look into it (and correct the
code ) .
>  Thanks,
>  Ravi
>
>
>
> --- In aima-talk@yahoogroups.com, "talk2ravig" <ravindrag@g...>
wrote:
> >
> > I was checking out the DPLL implementation in Java. For a small
> > formula having just 2 variables it ran into StackOverflow!!
Following
> > is the formula for which I got the error.
> >
> > ((A OR (NOT A)) AND (A OR B))
> >
> > Is this a bug or am I missing something?
> >
> > Thanks,
> > Ravi

#401 From: "shehaner" <shehaner@...>
Date: Sun Sep 19, 2004 10:58 pm
Subject: AIMA.LISP FIle Loading Error
shehaner
Send Email Send Email
 
I followed the directions for installing AIMA code and all worked
well until I activated my Allegro 6.2 and tried to load the
AIMA.Lisp file.  I also tried this for several other WIndows Lisp
Packages and received the same error message.  These are the
instructions I gave and the error I received:

Commands Given to Allegro Windows version 6.2

(load "c:\\Norvig\\aima.lisp")      -  Where I have aima.lisp loaded
(aima-load 'all)
(aima-compile)

Errors Shown:

; Loading c:\Norvig\aima.lisp
Error: Package "C" not found. [file position = 222]
[condition type: READER-ERROR]
………………………………….
recompile due to incompatible FASL

I have also tried:

(Load "c:\\Norvig\\aima.lisp")  by itself

(Load "aima.lisp")  by itself,  etc.  and still get the same error.

I had modified the aima.lisp file as directed to change the *aima-
root* in line 9 to show c:\\Norvig\\aima.lisp

I put no quotes around the path and also tried it with quotes - to
no avail.

Please help if you have a suggestion.  I have spent the greater part
of two days on this and thank goodness I found this forum. I am new
to Lisp and find this a fasinating and logical language but can't
figure any way to run anything on the standard Lisp software
packages other than single function programs.

Thanks,    Ron Shehane

#402 From: "shehaner" <shehaner@...>
Date: Mon Sep 20, 2004 1:22 am
Subject: Error Loading AIMA. lisp
shehaner
Send Email Send Email
 
I keep getting and error when Loading the AIMA.lisp file.  I have
followed all directions and all the lisp files downloaded O.K.
However, when I enter the recommended commands below in my Allegro
6.2, or any other Windows Lisp package I have tried,  I get the
following error message.

Commands Given to Allegro Windows version 6.2

(load "c:\\Norvig\\aima.lisp")     - where my files are located
(aima-load 'all)
(aima-compile)

Errors Shown:

; Loading c:\Norvig\aima.lisp
Error: Package "C" not found. [file position = 222]
[condition type: READER-ERROR]
………………………………….
recompile due to incompatible FASL

I modified line 9 of Aima.lisp as directed and replaced *aima-root*
with c:\\Norvig\\.  I used no quotes once and quotes once and still
got the same error.  I tried just using the
(Load "c:\\Norvig\\aima.lisp" by itself, but still get the same
error.

Any help is appreciated. I spent two days trying many combinations
to make it work.

- Ron

#403 From: "magesmail" <magesmail@...>
Date: Thu Sep 23, 2004 7:09 pm
Subject: Re: AIMA source - Problem in DPLL implmentation
magesmail
Send Email Send Email
 
Hi Ravi (G) ,
(For those reading these emails there are TWO ravi's here . the person
who discovered the bug and solved it is RaviG .The person who
maintains the code is RaviM .This is RaviM speaking !)

First I'll address your bug fix and why this may not be adressing the
true problem . Second, I will  explain when you can expect the bug fix
to occur . Third, I will try to explain how to use the unit tests to
make sure you don't break anything when you change existing code .

****************************
1.The bug fix you suggested
*****************************

First of all, let me congratulate you on your efforts to fix the bug .
This is HIGHLY appreciated .

You said ...

>In the findPureSymbol() method of the DPLLSatisfiable class before
> returning a new binding (new SymbolValuePair) a check is made (lines
> 162 and 166) to ensure that the symbol if present in
> allPositiveSymbols *should not* be present in the allNegativeSymbols
> and the other way. This check was causing the method to return NULL
> for the examples I gave.
>
> I commented-out the second condition of both the IFs (line 163 and
> 167) and it *seems* to have fixed the problem.


The reason why this may NOT be  a good fix is that a "pure symbol" by
definition(see section 7.6 - A complete Backtracking algorithm  - page
221 in my edition ) is a "symbol that ALWAYS appears with the SAME
sign in all clauses "(emphasis mine). This is why there is a check to
see that the symbol is present only in one collection.If  a symbol is
present in both positiveSymbols and negativeSymbols it is by
definition not a pure symbol and hence the check.

Now , having said that, there is DEFINITELY a deeper bug here, perhaps
in how symbols are assigned to the collections .I wrote this code a
year ago and looking at it now i can see how it can be written better .

I haven't looked at the bug yet (see below for a fuller explanation)
but WILL be fixing it in the coming days.

********************************
So when can you expect a fix ?
********************************

First, some context .
I have just sent the second release of the code to Peter who should be
putting up the code on the aima website soon.This involves a major
rewrite of the SEARCH code and the addition of some FIRST ORDER logic
code .Unfortunately, i had left the propositional code  (and the
adversarial search code) untouched for this release which means that
the bug you pointed out will still be present for this release of the
code .

I am now working on release 3 which would involve a rewrite at the
propositional logic code(and the games code) .In my opinion, the
prepositional logic code is not as well tested as it should be and i
will be focussing on this in the coming couple of weeks . I am
extremely grateful for your bug report. I *guarantee* that this bug
will be fixed on  a  priority basis . If you would like a "pre
release" version of the new code (the code on the website is the
"official version" ) send a mail to me at magesmail@... and i'll
do the needful .

*************************************************************
How can you change code and be (fairly) sure you haven't broken anything ?
****************************************************************

Short answer : use a TestCase to isolate the bug.This will fail as
long as the bgug persists . Change code till it passes . Run ALL other
testcases to make sure you aven't broken anything

Long answer :




To check whether evrything works fine after a code change  ,
first ,
       (a)write a new unit test
    and (b) run all the existing unit tests . While the test coverage
is not 100 % this step gives you some comfort that you haven't broken
existing functionality.

The unit tests for DPLLSatisfiable are in class DpllTest .

(a) add a unit test for eg :
public void testDpllWorksWithRaviGSentence() {
                 String buggySentence = "((A OR (NOT A)) AND (A OR B))";
		 assertEquals(true, dpll.isSatisfiable(buggySentence));
	 }
now if you use the junit library(www.junit.org) to run this test, it
will fail with a heap overflow (this is the bug you reported) . Now
you can change the code till the heap overflow does not occur  when
you run the test . (remember the test can still fail if the sentence
you provide is not dpllSatisfiable.This is ok just change the
assertTrue to assertFalse )

After this, run all the tests (AllTests.java) with junit.If all the
tests pass, you will not have broken anything covered by the tests.For
relase two the test coverage is 70 % of the code ,( up from omething
like 15 % for release1 ) and will continue to go up for further releases .


Thanks and regards,

Ravi Mohan







--- In aima-talk@yahoogroups.com, "talk2ravig" <ravindrag@g...> wrote:
> Hi Ravi,
>
> I could fix the problem by doing the following changes to the code.
> Not completely sure whether it breaks something else!
>
> In the findPureSymbol() method of the DPLLSatisfiable class before
> returning a new binding (new SymbolValuePair) a check is made (lines
> 162 and 166) to ensure that the symbol if present in
> allPositiveSymbols *should not* be present in the allNegativeSymbols
> and the other way. This check was causing the method to return NULL
> for the examples I gave.
>
> I commented-out the second condition of both the IFs (line 163 and
> 167) and it *seems* to have fixed the problem.
>
> Was there any specific reason this check was in place? Are there any
> negative side-effects of the change proposed above?
>
> Thanks,
> Ravi
>
>
> --- In aima-talk@yahoogroups.com, "magesmail" <magesmail@y...> wrote:
> > hi,
> > *looks*  like it's a bug . I'll look into it (and correct the
> code ) .
> >  Thanks,
> >  Ravi
> >
> >
> >
> > --- In aima-talk@yahoogroups.com, "talk2ravig" <ravindrag@g...>
> wrote:
> > >
> > > I was checking out the DPLL implementation in Java. For a small
> > > formula having just 2 variables it ran into StackOverflow!!
> Following
> > > is the formula for which I got the error.
> > >
> > > ((A OR (NOT A)) AND (A OR B))
> > >
> > > Is this a bug or am I missing something?
> > >
> > > Thanks,
> > > Ravi

#404 From: "magesmail" <magesmail@...>
Date: Sat Sep 25, 2004 7:41 am
Subject: Announcement :- AIMA Java v 2 code release
magesmail
Send Email Send Email
 
The second version of the java code is now up at
http://aima.cs.berkeley.edu/java-overview.html.

Build instructions , design notes etc maybe found at
http://aima.cs.berkeley.edu/java/aima-java-notes.txt

#405 From: "Amir Dolatabadi" <A_Dolatabadi@...>
Date: Sun Oct 3, 2004 7:56 pm
Subject: percept sequence
A_Dolatabadi@...
Send Email Send Email
 
Hi,

On page 34, What do you understand by:
percept sequence:[A,clean],[A,clean]
The first percept changes the position of the vacuum-cleaner
to place B and in that position, the second percept has no meaning
for the agent.

Amir.

#406 From: Dharmesh Jani <janidharmesh@...>
Date: Mon Oct 4, 2004 1:17 am
Subject: Re: percept sequence
janidharmesh
Send Email Send Email
 
Hey
It just means that keep on moving right until square A is clean...
remember it is a sequence of percepts and so as far as A is clean it will keep on moving to the right side.....As soon as it perceives [A,Dirty} it will take the action SUCK....
This is mentioned in the context that the vacuum cleaner cannot jump directly from square A to square B.. But it will take a definite amount of time and during that time too it continously receives the percepts....
 
So the sequence to which u are referring to can be extended to somewhat like this....
[A,Clean] , [A,Clean] ,  [A,Clean] , [A,Dirt] , [A,Clean] , [B,Clean] , B,Dirt] ,  [B,Clean]
here on the 4th percept it will suck and at the 6th percept it enters square B...
on the 7th one it sucks dirt in squareB......
here ofcourse the things not mentioned, i guess for simplicity, are the boundary conditions and the fact that how does the vaccum agent knows that it has reached the square B.  if u also want to include that then the solution can be something like, make the agent work in squares of fixed size......i.e. the agent assumes that i has entered square B after travelling a certain distance....and travels back to the left when it reaches the end of square B.
 
this is what i can think of.......
give me feedback on this.....
 
 
 
 

Amir Dolatabadi <A_Dolatabadi@...> wrote:

Hi,

On page 34, What do you understand by:
percept sequence:[A,clean],[A,clean]
The first percept changes the position of the vacuum-cleaner
to place B and in that position, the second percept has no meaning
for the agent.

Amir.








DHARMESH JANI
janidharmesh@...
janidharmesh@...
Let us think about the thinking things...


Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!

#408 From: "ckp_for_u" <chetan_phalak4u@...>
Date: Tue Oct 19, 2004 1:27 pm
Subject: language tutor ::
ckp_for_u
Send Email Send Email
 
i need a language tutor preferably in c,java.
it should take a sentence from user...and notify the user of the
mistakes that he made using parsing or other techniques.........

it is sort of....urgent ...

#409 From: "stingray_101_1999" <stingray_101_1999@...>
Date: Wed Oct 20, 2004 11:05 am
Subject: PUZZLES
stingray_101...
Send Email Send Email
 
HELLO TO ALL AIMA-ITES

  THE SECOND EDITION OF AIMA IS FANTASTIC.

  I JUST NEED SOME HELP ON THE MISSIONARIES AND CANNIBALS PROBLEM
  IF ANYONE COULD PROVIDE A SOLUTION,IT WOULD BE GREAT. THIS WILL ALSO
HELP ME WITH THE FARMER,FOX,GOOSE,GRAIN PROBLEM BECAUSE I THINK THEY
ARE QUITE SIMILAR.

#410 From: "brandon_pitt_47" <brandon_pitt_47@...>
Date: Sat Oct 23, 2004 12:24 am
Subject: Question 9.11
brandon_pitt_47
Send Email Send Email
 
Hey, I was wondering if anybody could help me with question 9.11 about finding
who the
person is.

question:  P. 317
A popular children's riddle is "Brothers and sisters have I none, but that man's
father is my
father's son."  Use the rules of the family domain(Chapter 8, page 254) to show
who that
man is.  You may apply any of the inference mehtods described in this chapter. 
Why do
you think that this riddle is difficult?

any suggestions??

thanks,
brandon

#411 From: "sjjsca" <sjjsca@...>
Date: Sat Oct 23, 2004 1:56 am
Subject: Question 20.19
sjjsca
Send Email Send Email
 
Hey, anyone has solution for 20.19? It'll save my life! Tks

Messages 381 - 411 of 946   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright Đ 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help