Re: Storing data and code in a Db with LISP-like interface
From: mAsterdam <mAsterdam_at_vrijdag.org>
Date: Wed, 26 Apr 2006 01:01:05 +0200
Message-ID: <444eaa0f$0$31647$e4fe514c_at_news.xs4all.nl>
person(john).
vegetable(tomato1).
vegetable(broccoli1).
thing(X):-fruit(X).
Queries:
Welcome to SWI-Prolog (Multi-threaded, Version 5.4.7) Copyright (c) 1990-2003 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details.
Date: Wed, 26 Apr 2006 01:01:05 +0200
Message-ID: <444eaa0f$0$31647$e4fe514c_at_news.xs4all.nl>
You really should play a little with prolog:
program (neof.pro):
person(john).
judge(john). fruit(apple1). fruit(tomato1).
vegetable(tomato1).
vegetable(broccoli1).
likes(john, leftover1). likes(john, apple1). likes(john, tomato1). thing(X):-vegetable(X).
thing(X):-fruit(X).
Queries:
Welcome to SWI-Prolog (Multi-threaded, Version 5.4.7) Copyright (c) 1990-2003 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
1 ?- chdir('H:/src/prolog').
Yes
2 ?- consult('H:/src/prolog/neof.pro').
% H:/src/prolog/neof.pro compiled 0.00 sec, 1,996 bytes
What = leftover1 ;
What = apple1 ;
What = tomato1 ;
No
4 ?- vegetable(tomato1).
Yes
5 ?- fruit(tomato1).
Yes
6 ?- thing(tomato1).
Yes
7 ?- person(tomato1).
No Received on Wed Apr 26 2006 - 01:01:05 CEST