| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Storing data and code in a Db with LISP-like interface
Marshall Spight wrote:
> Neo wrote:
>
>>If "likes (john, apple1)" implies "john likes apple1" >>why isn't "john isa person" written as "isa (john, person)" >>or is "person (john)" an alternate/equivalent method?
I took it to mean short for "is a".
>>How do I express the following query in Prolog: >>Find a person who likes a fruit and a vegetable. >>(Assume there are more persons). >>For example in dbd, it would be: >> >>(and (select person instance *) >> (select * like (and (select vegetable instance *) >> (select fruit instance *) >> ) >> ) >>)
My prolog skills are as lame as yours - we even came up with allmost the same query-formulation :-)
> Amusingly, since we have specified that the tomato is both
> a fruit and a vegetable, anyone who likes tomatoes will qualify,
> as we see above. However, the reader is strongly cautioned!
> The tomato is *not* a vegetable!
Sadly now both our prolog systems think it /is/.
> To me, perhaps the most interesting thing about prolog is the
> trivial ease with which one can write the ancestor query,
> which causes such consternation for SQL.
>
>
> Marshall
>
Received on Wed Apr 26 2006 - 14:15:22 CDT
![]() |
![]() |