Thread: Project Idea

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    217
    Rep Power
    0

    Lightbulb Project Idea


    I was sitting around one day and came up with this idea:

    A "bot" that you could input text to like, "My keys are in my car", then you could ask a question like, "Where are my keys?" and the "bot" would say, "Your keys are under your car".

    I know Perl is probably the language for this, but how hard would it be to do in C... I don't know where to start...
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    217
    Rep Power
    0

    Talking


    "your keys are in your car"



    sorry typo
  4. #3
  5. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,110
    Rep Power
    1803
    I think that you are 30 years late with that idea!:rolleyes: What you are talking about is called an 'expert system'. Neither Perl nor C++ are the most appropriate language. Prolog would be the language for that. In fact that is what Prolog does, so you would not need to code anything much other than the user interface!

    For a quick introduction to Prolog see: Fundamental Prolog (Part 1)

    The same site has more tutorials: Visual Prolog Tutorials

    You can download the free Personal Edition of Visual Prolog from the site. http://www.visual-prolog.com.

    However, what might be an interesting exercise is to write your own Prolog style inference engine in C or C++. It would be a purely academic exercise of course. I suggest you learn more about Prolog and what it does and how before you re-invent the wheel.

    Clifford.
  6. #4
  7. not a fan of fascism (n00b)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Feb 2003
    Location
    ct
    Posts
    2,756
    Rep Power
    95
    hey thanks for the links Cilfford, that seems like a very interesting language... [adds Prolog to the neverending list of things to learn]
    here is a link to the GNU version if your on linux like me:
    http://pauillac.inria.fr/~diaz/gnu-prolog/
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    217
    Rep Power
    0

    thanks


    cool thanks guys
  10. #6
  11. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,162
    Rep Power
    2222
    Did a project in Prolog for a class about 15 years. It was a kind of genealogy utility in which we first defined who married whom and then whom they begat. Then you would enter two individuals and it would tell you how they were related. We ran it in Borland's Turbo Prolog. BTW, I have no idea where the code is now.

    At the very first, it was quite a paradigm shift away from procedural languages. But then I got the hang of it (which didn't take that long) the fairly lengthy program almost wrote itself. And worked almost the first time. The only problem I had was implementing something like a for loop, because prolog would do it as a recursive call, but then when you returned back out of all those recursive calls, the program would have forgotten what the values were in the inner-most call.
  12. #7
  13. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,110
    Rep Power
    1803
    Originally posted by infamous41md
    ...here is a link to the GNU version if your on linux like me:
    http://pauillac.inria.fr/~diaz/gnu-prolog/
    The older (and incompatible with 6) Visual Prolog 5.2 has a Linux version. http://www.visual-prolog.com/vip/vip...re_version.htm

    Clifford

IMN logo majestic logo threadwatch logo seochat tools logo