Page 1 of 1

newbie HELP!!

Posted: Sun Apr 05, 2009 1:38 am
by knightz
hi i just started learning LISP like 1 months ago. so i'm just really not that good with it. :(
anyways, i'm suppose to do like program about disease and their symptoms using common lisp.basically the program will ask if the patient have this symptoms or not, the patient suppose to answer yes or no,then the system will just tell the patient of their disease. i did a few try but failed though. so this is my last resort. if none of you guys know.. im not gonna try anymore. haha.. maybe i should give up on LISP and take on VB instead. lol :lol:

Re: newbie HELP!!

Posted: Tue Apr 07, 2009 8:54 am
by findinglisp
You might want to buy the book Paradigms of Artificial Intelligence Programming. It's a great book both about AI as well as Common Lisp. All the examples in the book are done in CL, including a pretty sophisticated medical diagnosis program (based on some of the MYCIN work, if I remember right). If you want to do a simpler version of that, then the basic "what animal am I thinking of?" program might be what you're looking for. Try Paul Graham's On Lisp, which you can find online.

Re: newbie HELP!!

Posted: Tue Apr 07, 2009 9:25 am
by Jasper
You mean multiple choice questions, like ones where you have a bunch of boxes with questions with lines yes/no leading to other boxes? And those eventually leading to some kind of advice?

Re: newbie HELP!!

Posted: Tue Apr 07, 2009 10:35 am
by gugamilare
This is a very simple task. I'm not going to make everything for you, but, if you can make an algorithm (e.g. in pseudo-language) then it is very simple to transform it into Common Lisp. If you have the algorithm and cannot translate it into CL, you should try learning a bit of CL first.

Re: newbie HELP!!

Posted: Tue Apr 07, 2009 12:02 pm
by Balooga
You need to read up on 'Expert Systems'.

Re: newbie HELP!!

Posted: Tue Apr 07, 2009 1:09 pm
by Paul Donnelly
You should approach this from a data-directed angle. If you have a tree like the following, how would you write a function that read out the questions and took the right branch based on the answer?

Code: Select all

("Are you breathing?" ("Are you bleeding?" "You have a cut."
                                           "You're fine.")
                      "You're dead.")
Or you might choose a different data representation based on what you like. This is just to illustrate that if you put the data in the right format for your problem, the program will practically write itself.