Re: Storing data and code in a Db with LISP-like interface
From: Markus Triska <triska_at_gmx.at>
Date: Wed, 26 Apr 2006 23:53:45 +0200
Message-ID: <444febee$0$11610$3b214f66_at_tunews.univie.ac.at>
Date: Wed, 26 Apr 2006 23:53:45 +0200
Message-ID: <444febee$0$11610$3b214f66_at_tunews.univie.ac.at>
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,
> vegetables that john likes would look like this:
?- findall(Veg, likes(john,vegetable,Veg), Vegs).
Vegs = [broccoli, tomato]
> All fruits that john likes would look like this
?- findall(Fruit, likes(john,fruit,Fruit), Fruits).
Fruits = [apple, tomato] ;
> All foods that john likes would look like this
?- findall(Food, likes(john,_,Food), Foods).
Foods = [apple, tomato, broccoli, tomato] ;
All the best,
Markus.
Received on Wed Apr 26 2006 - 23:53:45 CEST