From pascal@rz.hu-berlin.de  Sun Nov 28 00:10:16 1999
Received: from suncom.rz.hu-berlin.de (suncom.rz.hu-berlin.de [141.20.1.31])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id AAA16441
	for <prolog@swi.psy.uva.nl>; Sun, 28 Nov 1999 00:10:15 +0100 (MET)
Received: from localhost.rz.hu-berlin.de (pascal@ppp196-67.rz.hu-berlin.de [141.20.196.67])
	by suncom.rz.hu-berlin.de (8.9.3/8.9.3) with ESMTP id AAA16947
	for <prolog@swi.psy.uva.nl>; Sun, 28 Nov 1999 00:10:04 +0100 (MET)
Received: (from pascal@localhost)
	by localhost (8.8.8/8.8.8/Debian/GNU) id AAA02561;
	Sun, 28 Nov 1999 00:10:44 +0100
Date: Sat, 27 Nov 1999 23:10:44 +0000 (GMT)
From: Pascal Vaillant <Pascal.Vaillant@rz.hu-berlin.de>
To: prolog@swi.psy.uva.nl
Subject: Re: indexing capabilty of swi-pl
Message-ID: <Pine.LNX.4.05.9911272309480.2462-100000@ppp196-67.rz.hu-berlin.de>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by swi.psy.uva.nl id AAA16441


On Sat, 30 Oct 1999, Jan Wielemaker wrote:

> > * Wich of this methods do you think is faster to access a dictionary,
> >    entry(KeyValue,....KeyInfos....)   (about 5.000 entries):
> >           - put entries as they are in the internal DB of Prolog (with
> >             KeyValue as first argument, relaying on SWI-PL first arg
> >             indexing;
> >           - put entries in a B-tree managed by Prolog.
> > 
> This depends on the number of clauses, but using large sets the choice
> is always a hash-table.  Try to avoid as much as possible duplicates
> and don't use a `catch-all' clause (using a variable) at the end.
> 5,000 entries is just peanuts.  We've played with tables more than
> 10 times as big without any trouble.
> 

Hello,

Can someone mail a small example program showing how to use a hash
table in SWI Prolog? From the manual, you use hash_term(Term,Key)
to attribute keys to entries; but I do not understand whether you
have to do something special to retrieve them afterwards.

Many thanks,

Pascal Vaillant
Humboldt-Universität Berlin



