Grokbase Groups Perl ai March 2004
FAQ
Hi,

I am construction a Full Text Search engine replacing the internal MySQL
engine in an experiment for index all the content of 20 years publications
of a newspaper, and the first layer to do a search is to convert the Boolean
Phrase entered by the user to a 3-CNF (3-conjuntive normal form).

All the FTS is programed in PERL, as I love it !, but I can't find a module
or an algorithm to reduce the expression to the 3-CNF.

I know that the problem to reduce some sentence to the 3-CNF-SAT form is
NP-complete, but I also read in my AI books that it's possible to implement
(without any garanties of the stop point and end time), as it is implemented
in Prolog or Lisp, then, my first approuch is to find some module to do the
reduction, if I cannot find, my second alternative is to glue my Perl
program to some Prolog interpreter (is it possible in Linux, I never tried
?).

Could someone help me ?

Thanks
Roberto Slepetys

Search Discussions

  • Salvador "Fandiño" at Mar 4, 2004 at 9:28 am
    Hi Roberto,
    reduction, if I cannot find, my second alternative is to glue my
    Perl program to some Prolog interpreter (is it possible in Linux,
    I never tried ?).
    you can use Language::Prolog::Yaswi to call SWI-Prolog from Perl.

    - Salva

    __________________________________
    Do you Yahoo!?
    Yahoo! Search - Find what you’re looking for faster
    http://search.yahoo.com
  • Roberto Slepetys Ferreira at Mar 4, 2004 at 2:36 pm
    Hi Salvador,

    I am looking for some way to do the same of LogicalExpand function of
    Wolfran Mathematica. It get's a logical expression in input and returns a
    CNF of the logical expression.

    Ex:
    IN: LogicalExpand [ a && b && ! ( c || ( d && ! e))]
    OUT: a && b && e && (! c || a) && b && ! c && ! d

    Is it possible to do with the Prolog linked with Perl ? I never programmed
    with prolog !?!

    Thanks

    Roberto Slepetys

    ----- Original Message -----
    From: "Salvador Fandiño" <sfandino@yahoo.com>
    To: "Roberto Slepetys Ferreira" <slepetys@homeworks.com.br>;
    <perl-ai@perl.org>
    Cc: "Roberto Slepetys Ferreira" <slepetys@homeworks.com.br>
    Sent: Thursday, March 04, 2004 6:27 AM
    Subject: Re: reduction to 3-CNF

    Hi Roberto,
    reduction, if I cannot find, my second alternative is to glue my
    Perl program to some Prolog interpreter (is it possible in Linux,
    I never tried ?).
    you can use Language::Prolog::Yaswi to call SWI-Prolog from Perl.

    - Salva

    __________________________________
    Do you Yahoo!?
    Yahoo! Search - Find what you're looking for faster
    http://search.yahoo.com
  • Sven Hilbert at Apr 19, 2004 at 10:13 pm
    Hi Roberto,

    I have the same problem right now.
    Did you find a solution?

    (I'd prefere Perl-only-scripts...)
    I am looking for some way to do the same of LogicalExpand function of
    Wolfran Mathematica. It get's a logical expression in input and returns a
    CNF of the logical expression.

    Ex:
    IN: LogicalExpand [ a && b && ! ( c || ( d && ! e))]
    OUT: a && b && e && (! c || a) && b && ! c && ! d
    regards
    Sven
  • Roberto Slepetys Ferreira at Apr 19, 2004 at 10:46 pm
    Hi Sven,

    Unhapply I cannot found any solution, in fact, I solved the trouble without
    the CNF reduction.

    But, if you find some way to manipulate logical propositions in PERL it will
    be nice to have this capacibility in PERL.

    I was looking for Prolog, and some way to glue it with PERL, but I am
    currently studing it without an answer to you.

    PS: If you find some way, please tell me !

    []s
    Slepetys

    ----- Original Message -----
    From: "Sven Hilbert" <fuzzySH@gmx.de>
    To: "Roberto Slepetys Ferreira" <slepetys@homeworks.com.br>;
    <perl-ai@perl.org>
    Sent: Monday, April 19, 2004 6:44 PM
    Subject: Re: reduction to 3-CNF

    Hi Roberto,

    I have the same problem right now.
    Did you find a solution?

    (I'd prefere Perl-only-scripts...)
    I am looking for some way to do the same of LogicalExpand function of
    Wolfran Mathematica. It get's a logical expression in input and returns
    a
    CNF of the logical expression.

    Ex:
    IN: LogicalExpand [ a && b && ! ( c || ( d && ! e))]
    OUT: a && b && e && (! c || a) && b && ! c && ! d
    regards
    Sven

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupai @
categoriesperl
postedMar 4, '04 at 4:20a
activeApr 19, '04 at 10:46p
posts5
users3
websiteperl.org

People

Translate

site design / logo © 2021 Grokbase