Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Storing data and code in a Db with LISP-like interface

Re: Storing data and code in a Db with LISP-like interface

From: Alvin Ryder <alvin321_at_telstra.com>
Date: 26 Apr 2006 16:34:07 -0700
Message-ID: <1146094447.260458.63810@v46g2000cwv.googlegroups.com>


Markus Triska wrote:
> Hi,
>
> Nick Malik [Microsoft] wrote:
>
> >
> > Believe it or not, in Prolog, it is a bit tougher to ask: what are all the
> > fruits that John likes,
>
> It's still fairly trivial:
>

You're both right.

Nick's point is correct, pure prolog does not answer those types of questions, it only deals with first-order logic and that's a second order question, which requires predicates themselves, like "likes", to become arguments.

> > vegetables that john likes would look like this:
>
> ?- findall(Veg, likes(john,vegetable,Veg), Vegs).
>
> Vegs = [broccoli, tomato]
>

And you're right, practical prolog's let you roll your own solutions or use things like "bagof", "setof" and "findall" which return lists and solve these problems trivially.

Cheers. Received on Wed Apr 26 2006 - 18:34:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US