| 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
> ... mAsterdam did all the typing already.
> SWI-Prolog comes from ... Amsterdam? Hmmm.
:) With all those letters matching, I felt as if I had won a lottery.
> > How do I express the following query in Prolog:
> > Find a person who likes a fruit and a vegetable.
> > (and (select person instance *)
> > (select * like (and (select vegetable instance *)
> > (select fruit instance *))))
>
> "Find X where X is a person, X likes V, V is a vegetable,
> X likes F, and F is a fruit."
I actually expressed what I meant more clearly in the query then in english which was ambigious :( I meant find a person who likes something that is both a vegetable and a fruit.
In your notation, it might be
"Find X where X is a person, X likes T, and T is a vegetable, and T is
a fruit."
> The tomato is *not* a vegetable!
:) why isn't it?
PS. I'll be posting a further extension of the Food Judge Example for the advanced Prologers. Received on Wed Apr 26 2006 - 19:50:48 CDT
![]() |
![]() |