Grokbase Groups Perl ai January 2005
FAQ
Hi all,

As some of you probably know, I am working on AI::Prolog. It is
currently available on the CPAN and it's a pure Perl implementation of
Prolog. In the long run, I'll probably port some of the guts to C for
performance reasons, but I'm sticking with Perl right now for ease of
prototyping.

My last journal entry (http://use.perl.org/journal.pl?op=edit&id=22940)
has some discussion of my future plans, but if anyone has any feedback
regarding the utility of this module, I'm all ears.

Cheers,
Ovid

=====
If this message is a response to a question on a mailing list, please send
follow up questions to the list.

Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/

Search Discussions

  • Salvador "Fandiño" at Jan 30, 2005 at 11:44 am

    --- Ovid wrote:

    Hi all, Hi
    As some of you probably know, I am working on AI::Prolog. It is
    currently available on the CPAN and it's a pure Perl implementation
    of
    Prolog. In the long run, I'll probably port some of the guts to C
    for
    performance reasons, but I'm sticking with Perl right now for ease
    of
    prototyping.

    My last journal entry
    (http://use.perl.org/journal.pl?op=edit&id=22940)
    has some discussion of my future plans, but if anyone has any
    feedback
    regarding the utility of this module, I'm all ears.
    Do you know about my modules Language::Prolog::Yaspi and
    Language::XSB?, they are Perl interfaces to SWI-Prolog and XSB
    respectively. If you are implementing AI::Prolog for fun, everything
    is ok, but if you plan to use Prolog from Perl seriously I thing that
    my modules are a better option.

    You would like to take a look at Prolog::Language::Types also, a set
    of classes that encapsulate Prolog terms on Perl, maybe its data
    structures are focussed on being efficient representation and not on
    being directly manipulated as prolog terms but it can be configured
    to use different internal representations.

    And Prolog::Language::Sugar, implements some syntatic sugar to create
    prolog terms from Perl with a Prolog look.

    Cheers,

    - Salvador






    __________________________________
    Do you Yahoo!?
    All your favorites on one personal page – Try My Yahoo!
    http://my.yahoo.com
  • Richard Jelinek at Jan 30, 2005 at 11:58 am
    Hi,
    On Sun, Jan 30, 2005 at 03:43:59AM -0800, Salvador Fandińo wrote:
    Do you know about my modules Language::Prolog::Yaspi and
    Language::XSB?, they are Perl interfaces to SWI-Prolog and XSB
    respectively. If you are implementing AI::Prolog for fun, everything
    is ok, but if you plan to use Prolog from Perl seriously I thing that
    my modules are a better option.
    I'm sure Ovid is oriented on CPAN. ;-) As for "the better option"(tm):
    It depends. Of course, SWI-Prolog is currently one of the best choices
    for doing Prolog, and a seamless (sic!) integration between this and Perl
    (back and forth) - if it existed - is a very good option.

    However, it certainly does increase complexity of deployment and
    maintenance a "final" application.
    You would like to take a look at Prolog::Language::Types also, a set
    of classes that encapsulate Prolog terms on Perl, maybe its data
    structures are focussed on being efficient representation and not on
    being directly manipulated as prolog terms but it can be configured
    to use different internal representations.

    And Prolog::Language::Sugar, implements some syntatic sugar to create
    prolog terms from Perl with a Prolog look.
    Why am I babbling here? We currently do evaluate the available
    alternatives to enhance the inductive, deductive and abductive
    capabilities of our semantic inference engine. Unfortunately none of
    the alternatives available is yet suited for commercial-grade (sorry)
    deployment.

    So in a Nutshell: I still do not see "the better option" and the race
    is IMHO open.

    --
    best regards,

    Dipl.-Inf. Richard Jelinek

    - The PetaMem Group - Prague/Nuremberg - www.petamem.com -
    -= 3394928 Mind Units =-
  • Salvador "Fandiño" at Jan 30, 2005 at 12:28 pm

    --- Richard Jelinek wrote:

    Hi,
    On Sun, Jan 30, 2005 at 03:43:59AM -0800, Salvador Fandińo wrote:
    Do you know about my modules Language::Prolog::Yaspi and
    Language::XSB?, they are Perl interfaces to SWI-Prolog and XSB
    respectively. If you are implementing AI::Prolog for fun,
    everything
    is ok, but if you plan to use Prolog from Perl seriously I thing that
    my modules are a better option.
    I'm sure Ovid is oriented on CPAN. ;-) As for "the better
    option"(tm):
    It depends. Of course, SWI-Prolog is currently one of the best
    choices
    for doing Prolog, and a seamless (sic!) integration between this
    and Perl
    (back and forth) - if it existed - is a very good option.

    However, it certainly does increase complexity of deployment and
    maintenance a "final" application.
    You would like to take a look at Prolog::Language::Types also, a set
    of classes that encapsulate Prolog terms on Perl, maybe its data
    structures are focussed on being efficient representation and not on
    being directly manipulated as prolog terms but it can be
    configured
    to use different internal representations.

    And Prolog::Language::Sugar, implements some syntatic sugar to create
    prolog terms from Perl with a Prolog look.
    Why am I babbling here? We currently do evaluate the available
    alternatives to enhance the inductive, deductive and abductive
    capabilities of our semantic inference engine. Unfortunately none
    of
    the alternatives available is yet suited for commercial-grade
    (sorry)
    deployment.

    So in a Nutshell: I still do not see "the better option" and the
    race
    is IMHO open.

    --
    best regards,

    Dipl.-Inf. Richard Jelinek

    - The PetaMem Group - Prague/Nuremberg - www.petamem.com -
    -= 3394928 Mind Units =-



    __________________________________
    Do you Yahoo!?
    Meet the all-new My Yahoo! - Try it today!
    http://my.yahoo.com
  • Ovid at Jan 30, 2005 at 5:54 pm

    --- Richard Jelinek wrote:
    On Sun, Jan 30, 2005 at 03:43:59AM -0800, Salvador Fandińo wrote:
    Do you know about my modules Language::Prolog::Yaspi and
    Language::XSB?, they are Perl interfaces to SWI-Prolog and XSB
    respectively. If you are implementing AI::Prolog for fun,
    everything
    is ok, but if you plan to use Prolog from Perl seriously I thing that
    my modules are a better option.
    (What follows is not about XSB as I have never used it.)

    Salvador, I've done quite a bit of research on Prolog alternatives in
    Perl and I am familiar with Language::Prolog::Yaswi
    (http://use.perl.org/~Ovid/journal/22708). I came to the conclusion
    that this module was the best available (that I could find), but there
    were some problems with it.

    1. It doesn't compile with the latest version of SWI-Prolog, I had to
    drop down to the 5.2 series.
    2. Compiling 5.2.X SWI-Prolog with --enable-mt failed entirely on my
    Mac OS X.
    3. The README states very clearly that "very early alpha release and
    lots of bugs should be expected."

    There were some other issues, but those were the big ones. Since this
    project doesn't appear to have been touched for two years and (with all
    due respect) since you didn't respond to my email inquiries, I
    concluded that Language::Prolog::Yaswi was a dead project.

    Don't get me wrong, Salvador, I think you've done some fantastic work
    with it, but I want to truly be able to take advantage of logic
    programming in Perl and I can't do that with a distribution I can't
    recommend to others. I'd love to see more work on the project (tests,
    docs, interface, compile with latest version, etc.)
    I'm sure Ovid is oriented on CPAN. ;-) As for "the better
    option"(tm):
    It depends. Of course, SWI-Prolog is currently one of the best
    choices
    for doing Prolog, and a seamless (sic!) integration between this and
    Perl
    (back and forth) - if it existed - is a very good option.

    However, it certainly does increase complexity of deployment and
    maintenance a "final" application.
    Richard, yes, these are problems. Not everyone would want an external
    dependency on SWI-Prolog, but if they really wanted or needed logic
    programming for some project, I could see them using
    Language::Prolog::Yaswi.

    My pure Perl version is intended primarily as a proof of concept with
    the long-term goal being porting the engine to C for performance
    reasons. Running at 1000 LIPs is atrocious (and we won't even begin to
    discuss memory requirements of Perl data structures.) This will not be
    as feature rich as Yaswi, but it would definitely be easier to install
    and configure.
    Why am I babbling here? We currently do evaluate the available
    alternatives to enhance the inductive, deductive and abductive
    capabilities of our semantic inference engine. Unfortunately none of
    the alternatives available is yet suited for commercial-grade (sorry)
    deployment.

    So in a Nutshell: I still do not see "the better option" and the race
    is IMHO open.
    Richard, out of curiosity, is the main objection to Yaswi the
    interface, the external dependencies or something else altogether?

    Cheers,
    Ovid

    =====
    If this message is a response to a question on a mailing list, please send
    follow up questions to the list.

    Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/
  • Richard Jelinek at Jan 30, 2005 at 7:13 pm
    Hi,
    1. It doesn't compile with the latest version of SWI-Prolog, I had to
    drop down to the 5.2 series.
    2. Compiling 5.2.X SWI-Prolog with --enable-mt failed entirely on my
    Mac OS X.
    3. The README states very clearly that "very early alpha release and
    lots of bugs should be expected."

    There were some other issues, but those were the big ones. Since this
    project doesn't appear to have been touched for two years and (with all
    due respect) since you didn't respond to my email inquiries, I
    concluded that Language::Prolog::Yaswi was a dead project.

    Don't get me wrong, Salvador, I think you've done some fantastic work
    with it, but I want to truly be able to take advantage of logic
    programming in Perl and I can't do that with a distribution I can't
    recommend to others. I'd love to see more work on the project (tests,
    docs, interface, compile with latest version, etc.)
    Similar problems on Linux here too. Our production system runs
    "Welcome to SWI-Prolog (Version 4.0.9)" while our development system
    runs "Welcome to SWI-Prolog (Multi-threaded, Version 5.2.13)"

    Our NLP/NLU application does run on both environments, as long as we
    do not use the Yaswi module (newest version fails with the 4.0.9 on
    production as well as with 5.5.x if we want to put that on development
    system).

    [...]
    Richard, yes, these are problems. Not everyone would want an external
    dependency on SWI-Prolog, but if they really wanted or needed logic
    programming for some project, I could see them using
    Language::Prolog::Yaswi.

    My pure Perl version is intended primarily as a proof of concept with
    the long-term goal being porting the engine to C for performance
    reasons. Running at 1000 LIPs is atrocious (and we won't even begin to
    discuss memory requirements of Perl data structures.) This will not be
    as feature rich as Yaswi, but it would definitely be easier to install
    and configure.
    You know - I'm almost ashamed to say this, because I haven't
    contributed a single line to either project, but the
    consolidation-driven manager in me feels a certain bitterness about
    seeing double effort and two halfway-done projects.

    Ovid: Is it really less work to push AI::Prolog to where you probably
    want it to be (engine ported to C), than harness development (and thus
    power) of the SWI engine and team up with Salvador?

    I mean - this can be a totally ignorant/naive thought of me, but OTOH
    it may be pragmatical.
    Richard, out of curiosity, is the main objection to Yaswi the
    interface, the external dependencies or something else altogether?
    I try a priorized list:

    1) dependency, adding complexity to the requirements for installation
    base
    2) point 1) wouldn't be that much of a problem if one could be sure,
    that in future taking two versions of SWI-Prolog and
    Language::Prolog::Yaswi that are not *insanely* far apart (not more
    than 2 years), would still work.
    3) interface. We had good experience with Inline::C, I just don't get
    it, why it shouldn't be possible to embed prolog programs in Perl
    exactly that way. (the HEREDOC of AI::Prolog comes nearest to this
    requirement). So why no Inline::Prolog?



    --
    best regards,

    Dipl.-Inf. Richard Jelinek

    - The PetaMem Group - Prague/Nuremberg - www.petamem.com -
    -= 3394928 Mind Units =-
  • Ovid at Jan 30, 2005 at 7:59 pm

    --- Richard Jelinek wrote:
    Our NLP/NLU application does run on both environments, as long as we
    do not use the Yaswi module (newest version fails with the 4.0.9 on
    production as well as with 5.5.x if we want to put that on
    development
    system).
    From what I understand about Yaswi and SWI-Prolog, I know it runs runs
    on 5.1.x and 5.2.x and the 5.1 series is the minimum. 5.5.x
    definitely fails.
    You know - I'm almost ashamed to say this, because I haven't
    contributed a single line to either project, but the
    consolidation-driven manager in me feels a certain bitterness about
    seeing double effort and two halfway-done projects.
    Believe me, I certainly understand that. I certainly had no intention
    of releasing my own, but I couldn't find anything else :(
    Ovid: Is it really less work to push AI::Prolog to where you probably
    want it to be (engine ported to C), than harness development (and
    thus power) of the SWI engine and team up with Salvador?
    That depends, I suppose, on whether or not Salvador has the time. I
    realize that there's a lot of work involved. I would like to work on
    providing a cleaner interface, docs, tests, etc. to Yaswi, but I
    confess that my C is rusty -- anyone reading through
    AI::NeuralNet::Simple can tell you that :) In order for me to feel
    really confident, I'd need a bit of a roadmap on the C portion to know
    what's really involved in developing on that side.

    Personally, I think Salvador's module is a much better starting point.
    Mine, however, is being actively developed and has no external
    dependencies. It's a tough call.

    Salvador, are you listening? :)
    3) interface. We had good experience with Inline::C, I just don't get
    it, why it shouldn't be possible to embed prolog programs in Perl
    exactly that way. (the HEREDOC of AI::Prolog comes nearest to this
    requirement). So why no Inline::Prolog?
    I have not personally looked into doing Inline::Prolog. Others I have
    spoken with tell me that doing this would be a bit of a nightmare
    though targeting a C interface to Prolog might not be so bad. This
    sounds like the route that Salvador is taking. I suppose I should look
    into this again. Maybe it's easier than I thought?

    Cheers,
    Ovid

    =====
    If this message is a response to a question on a mailing list, please send
    follow up questions to the list.

    Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/
  • Salvador "Fandiño" at Jan 30, 2005 at 9:02 pm

    --- Ovid wrote:

    --- Richard Jelinek wrote:
    Our NLP/NLU application does run on both environments, as long as we
    do not use the Yaswi module (newest version fails with the 4.0.9 on
    production as well as with 5.5.x if we want to put that on
    development
    system).
    From what I understand about Yaswi and SWI-Prolog, I know it runs
    runs
    on 5.1.x and 5.2.x and the 5.1 series is the minimum. 5.5.x
    definitely fails.
    Only versions 5.x.x are supported. It just need a minor change to
    work on 5.4.x. Versions on the 4.x.x series are too incompatible, I
    don see the point on supporting them.

    About SWI-Prolog 5.5.x, the foreign interface has not been extended
    yet to support unicode strings/atoms so I have to wait until it is
    done.
    You know - I'm almost ashamed to say this, because I haven't
    contributed a single line to either project, but the
    consolidation-driven manager in me feels a certain bitterness about
    seeing double effort and two halfway-done projects.
    Believe me, I certainly understand that. I certainly had no
    intention
    of releasing my own, but I couldn't find anything else :(
    Ovid: Is it really less work to push AI::Prolog to where you probably
    want it to be (engine ported to C), than harness development (and
    thus power) of the SWI engine and team up with Salvador?
    That depends, I suppose, on whether or not Salvador has the time.
    I
    realize that there's a lot of work involved. I would like to work
    on
    providing a cleaner interface, docs, tests, etc. to Yaswi, but I
    confess that my C is rusty -- anyone reading through
    AI::NeuralNet::Simple can tell you that :) In order for me to feel
    really confident, I'd need a bit of a roadmap on the C portion to
    know what's really involved in developing on that side.
    I don't have too much time, but I promisse to fix any bug you report
    to me, specially on the C side, and apply any patch improving the
    docs, tests, etc. :-)


    Personally, I think Salvador's module is a much better starting
    point.
    Mine, however, is being actively developed and has no external
    dependencies. It's a tough call.

    Salvador, are you listening? :)
    3) interface. We had good experience with Inline::C, I just don't get
    it, why it shouldn't be possible to embed prolog programs in Perl
    exactly that way. (the HEREDOC of AI::Prolog comes nearest to this
    requirement). So why no Inline::Prolog?
    I have not personally looked into doing Inline::Prolog. Others I
    have
    spoken with tell me that doing this would be a bit of a nightmare
    though targeting a C interface to Prolog might not be so bad. This
    sounds like the route that Salvador is taking. I suppose I should
    look
    into this again. Maybe it's easier than I thought?
    I don't believe that an Inline::Prolog module would be comparable to
    Inline::C

    Mapping C to Perl is semantically obvious, there are several input
    parameters and one output parameter and the functions are always
    deterministic so it is the same in Perl and Prolog. All that is
    required is converting the data formats.

    On the other side semantically Prolog is completely different to
    Perl, any predicate argument can be used as input, output or both,
    and predicates can be undeterministic. How would you map member/2 to
    Perl for example? how would you call it from Perl?

    For a high level interface to Prolog I would better use something
    similar to Perl DBI, or even the real DBI.

    Cheers,

    - Salvador




    __________________________________
    Do you Yahoo!?
    Take Yahoo! Mail with you! Get it on your mobile phone.
    http://mobile.yahoo.com/maildemo
  • Salvador "Fandiño" at Jan 30, 2005 at 8:39 pm
    __________________________________
    Do you Yahoo!?
    Meet the all-new My Yahoo! - Try it today!
    http://my.yahoo.com
  • Ovid at Jan 30, 2005 at 9:13 pm

    --- Salvador Fandiño wrote:
    oops, sorry, I didn't get your mails, maybe they were classified as
    spam by the yahoo filter and I only check my spam from time to time
    because I got too much :-(

    Please, send me your comments again and I would try to fix the bugs.

    Anyway, I will upload a new version supporting latest SWI-Prologs
    soon, the problems are nothing serious, caused by some minnor changes
    to the prolog package layout on disk. Just two lines have to be
    changed on one of the Makefiles :-)
    Wonderful news, Salvador!

    Below my sign-off is my original email to you on the subect.

    Also, I was wondering if you could share an example of how I would
    translate this (I hadn't gotten far enough with Yaswi to figure out how
    math works.)

    steals(PERP, STUFF) :-
    thief(PERP),
    value(STUFF, EUROS),
    EUROS > 100.

    Cheers,
    Ovid

    (original email)

    Hello Salvador,

    I was hoping to install Language::Prolog::Yaswi. I recently compiled
    Perl with threads and installed (and manually tested) SWI-Prolog. Your
    module compiles just fine, but when I try to run the tests I get the
    following errors:

    t/1Low.......NOK 1# Failed test (t/1Low.t at line 9)
    # Tried to use 'Language::Prolog::Yaswi::Low'.
    # Error: Can't load
    '/home/ovid/temp/Language-Prolog-Yaswi-0.04/blib/arch/auto/Language/Prolog/Yaswi/Low/Low.so'
    for module Language::Prolog::Yaswi::Low:
    /home/ovid/temp/Language-Prolog-Yaswi-0.04/blib/arch/auto/Language/Prolog/Yaswi/Low/Low.so:
    undefined symbol: PL_initialise at
    /usr/local/lib/perl5/5.8.6/i686-linux-thread-multi/DynaLoader.pm line
    230.

    This was with swi-prolog 5.4.5. When I dropped down to 5.2.13,
    everything worked just fine and installed beautifully. Do you have any
    plans to have this module support newer versions of Prolog?

    Cheers,
    Ovid

    =====
    If this message is a response to a question on a mailing list, please send
    follow up questions to the list.

    Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupai @
categoriesperl
postedJan 29, '05 at 9:56p
activeJan 30, '05 at 9:13p
posts10
users3
websiteperl.org

People

Translate

site design / logo © 2021 Grokbase