From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 264D7BB9B for ; Wed, 12 Oct 2005 19:53:17 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9CHrGp7015717 for ; Wed, 12 Oct 2005 19:53:16 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA06856 for ; Wed, 12 Oct 2005 19:53:16 +0200 (MET DST) Received: from mail.physik.uni-muenchen.de (mail.physik.uni-muenchen.de [192.54.42.129]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9CHrFmW015713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 12 Oct 2005 19:53:15 +0200 Received: from localhost (unknown [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 33FEC20006; Wed, 12 Oct 2005 19:53:15 +0200 (CEST) Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 28236-01-2; Wed, 12 Oct 2005 19:53:15 +0200 (CEST) Received: from mailhost.cip.physik.uni-muenchen.de (kaiser.cip.physik.uni-muenchen.de [141.84.136.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 0275020013; Wed, 12 Oct 2005 19:53:14 +0200 (CEST) Received: from eiger.cip.physik.uni-muenchen.de (eiger.cip.physik.uni-muenchen.de [141.84.136.54]) by mailhost.cip.physik.uni-muenchen.de (Postfix) with ESMTP id A1E9426E87; Wed, 12 Oct 2005 19:53:13 +0200 (CEST) Received: by eiger.cip.physik.uni-muenchen.de (Postfix, from userid 3092) id C991D12F75; Wed, 12 Oct 2005 19:53:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by eiger.cip.physik.uni-muenchen.de (Postfix) with ESMTP id C4F6912F20; Wed, 12 Oct 2005 19:53:13 +0200 (CEST) Date: Wed, 12 Oct 2005 19:53:13 +0200 (CEST) From: Thomas Fischbacher To: Xavier Leroy Cc: Christian Lindig , Caml List Subject: Re: [Caml-list] EQ hash tables? In-Reply-To: <434D2670.7000507@inria.fr> Message-ID: References: <14893115.1128951765427.JavaMail.www@wwinf1521> <434CC328.7060803@inria.fr> <434D2670.7000507@inria.fr> X-BOFH: Daemons did it MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: amavisd-new at physik.uni-muenchen.de X-Miltered: at nez-perce with ID 434D4D8C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 434D4D8B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 hash:01 integers:01 spawned:01 inv:01 inv:01 hash:01 2005,:98 cip:98 cip:98 lambda:01 lambda:01 wrote:01 define:01 data:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Wed, 12 Oct 2005, Xavier Leroy wrote: > Alternatively, you can always put > unique integers in the data type used as key. Suppose I define: type network = Links of network array and now, I set out to construct a wildly linked such network, which may indeed have the property that it "looks the same" from different places. Let us assume, for example, that entities of type network represent elements of a discrete group that is spawned by two generators, and the entries in Links [|a,b,a_inv,b_inv|] are the elements that are reached by left-application of the group generators A, B, or their inverses. How would one write a function that counts the sites in such a network? With proper EQ hash tables, it's quite easy. -- regards, tf@cip.physik.uni-muenchen.de (o_ Thomas Fischbacher - http://www.cip.physik.uni-muenchen.de/~tf //\ (lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_ (if (= x 0) y (g g (- x 1) (* x y)))) n 1)) (Debian GNU)