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

From: Alvin Ryder <alvin321_at_telstra.com>
Date: 21 Apr 2006 09:13:46 -0700
Message-ID: <1145636026.888699.162290_at_g10g2000cwb.googlegroups.com>


Bob Badour wrote:
> Pascal Bourguignon wrote:
>
> > Bob Badour <bbadour_at_pei.sympatico.ca> writes:
> >
> >>Can it handle n-ary relations? Like "John bought 10 apples each at
> >>10cents" ?
> >
> >
> > Of course:
> >
> > bought(john,10,apple,10,cent).
> >
> > How many apple did john buy?
> >
> > ?- bought(john,HowMany,apple,_price,_money).
>
> Thank you, that's much more revealing than 100 binary relations.
>

But those snipped relationships are the kinds of things the original poster was talking about ;-)

> Does prolog summarize the results? Or does it list each individual purchase?
>

Straight out of the can it doesn't summarize the results, it stops when one solution to a goal is found. You enter ; and it seeks another solution.

But anything that can represent a Rubix cube and solve it in about 600 lines of code can be made to do all sorts of clever things.

OTOH if you're searching for things Prolog cannot do you're right, there are many apparently easy things it can't do, that's why I originally spoke of possibly extending it.

> Consider:
>
> bought(john,10,apple,10,cent).
> bought(john,3,apple,15,cent).
>
> ?- bought(john,HowMany,apple,_price,_money).
Received on Fri Apr 21 2006 - 18:13:46 CEST

Original text of this message