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

From: Neo <neo55592_at_hotmail.com>
Date: 26 Apr 2006 17:50:48 -0700
Message-ID: <1146099048.301699.281960_at_u72g2000cwu.googlegroups.com>


> ... 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 Thu Apr 27 2006 - 02:50:48 CEST

Original text of this message