Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: AI in Perl - proof of concept

by Courage (Parson)
on Jul 12, 2002 at 18:57 UTC ( [id://181374]=note: print w/replies, xml ) Need Help??


in reply to AI in Perl - proof of concept

Excelent speech! A couple of comments.

1. In your Prolog code, why you did not wrote a question clause ?

2. How do you think, is it possible to create a module that will allow to write very Prolog-like programs? I mean with a help of Filter::Simple module create another filter module which will transform Prolog-like input into perl program?

Courage, the Cowardly Dog
PS. s/Owid/Ovid/ in your prolog code.

Replies are listed 'Best First'.
Re: Re: AI in Perl - proof of concept
by Ovid (Cardinal) on Jul 12, 2002 at 19:02 UTC

    Glad you liked it and thanks for pointing out the tyop :)

    I didn't print out the question clause because I threw this together rather quickly.

    As for writing Prolog type programs, I want to play with this some more to better identify patterns in the code before I start refactoring it. Writing a filter when I'm still generating a proof of concept is a bit premature. Of course, if you want to play with this and extend it...

    Typo on your post: s/Excelent/Excellent/; :)

    Heading off for a three day weekend, so I won't be able to comment further.

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Re: Re: AI in Perl - proof of concept
by vladb (Vicar) on Jul 13, 2002 at 15:45 UTC
    Answering to your question #2, I think it shouldn't be a challenge for Perl. I've looked at the Prolog Tutorial and the syntax doesn't appear to be overly complex. I guess, prolog could be translated in comparable Perl code and then executed? Say, just like what Ovid did with his AI example, it should be possible to write a Prolog to Perl translator at the least.

    In fact, there have already been some steps undertaken in this direction. Take a look at the Language::Prolog::Interpreter module. It's A simple interpreter which doesn't allow infix operators (except for C<:-> and C<,>, both of which are built in).

    There's also these Language::Prolog::* modules. They do appear to be the first courageous step towards accomplishing what you are asking for?

    Update:

    Ahh, taking Ovid's lead, let me fix another grammatical error in your post:

    1. In your Prolog code, why you did not wrote a question clause ?

    Should be...

    1. In your Prolog code, why did you not write a question clause ?

    Err.. don't take me wrong, I'm not an English grammar wiz as well :). I simply write the way it sounds right ;-).

    _____________________
    # Under Construction

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://181374]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-24 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found