From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=5.0 tests=HTML_00_10,HTML_MESSAGE, SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 99B07BC69 for ; Sat, 5 May 2007 01:46:30 +0200 (CEST) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l44NkTKd006061 for ; Sat, 5 May 2007 01:46:30 +0200 Received: by py-out-1112.google.com with SMTP id a78so799411pyh for ; Fri, 04 May 2007 16:46:29 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=dUg1Cjl8eIJFfETpraYJ+aQKGooPr+hZFHN/2zAuwnO6s02fMKN97cbfOKimvDwz/BBJfKgzMGXARGML5qAJF1mBfbStbLWHJUWrvuAABToJ1acVe1NH85KTxc4WVsHfKCPpVymUKGgL6Bt3/uMTAPLa/OVWPp261JCJ5Iohruc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=bKNzq+Pim/7EYsEDdsRsGgYVV1eB9Y32A/vWSei+JATXP0LGQrYuqXHV6R009ZK4NquYMPo1jLakJPZsqvZ+T6KS/wCa/aPTX//YhUfHW5ETVT4J6UlguXs8xHaeZtag44W7xrOyZ7AnB8y5CEkXXcSVE525EZN3RfYKgGoV95s= Received: by 10.35.106.15 with SMTP id i15mr3828773pym.1178322389199; Fri, 04 May 2007 16:46:29 -0700 (PDT) Received: by 10.35.21.5 with HTTP; Fri, 4 May 2007 16:46:29 -0700 (PDT) Message-ID: Date: Fri, 4 May 2007 16:46:29 -0700 From: "Justin Corn" To: caml-list@yquem.inria.fr Subject: beginner question: DAGs w/ recursive types an encapsulation of a Map MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_26668_32238739.1178322389132" X-j-chkmail-Score: MSGID : 463BC5D5.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 463BC5D5.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; recursive:01 recursive:01 arbitrarily:01 node:01 node:01 ocaml:01 arbitrarily:01 ocaml:01 justin:98 justin:98 char:01 char:01 edges:01 edges:01 algorithm:01 ------=_Part_26668_32238739.1178322389132 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Dear all, I'm trying to construct a tree (for the Aho-Corasick exact match algorithm) but I can't quite figure out how to do this. 1) Is it possible to declare a recursive type that would allow for a tree having an arbitrarily large number of children per node? I couldn't figure that one out, so I was thinking I could use a Map collection to represent edges. 2) How do you wrap a Map in an object or record? In my case the edges represent single characters, so I started with #module CharMap = Map.Make(Char);; but then the top level was not happy with #type node = { a: int; b: CharMap.t };; 3) If there are preexisting graphical libraries for ocaml, maybe I should just use those, but after searching a bit I was unable to find any. Does someone know where I could find one? Thanks, Justin ------=_Part_26668_32238739.1178322389132 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Dear all,

I'm trying to construct a tree (for the Aho-Corasick exact match algorithm) but I can't quite figure out how to do this.

1) Is it possible to declare a recursive type that would allow for a tree having an arbitrarily large number of children per node?

I couldn't figure that one out, so I was thinking I could use a Map collection to represent edges.

2) How do you wrap a Map in an object or record?  In my case the edges represent single characters, so I started with

#module CharMap = Map.Make(Char);;

but then the top level was not happy with

#type node = { a: int; b: CharMap.t };;

3) If there are preexisting graphical libraries for ocaml, maybe I should just use those, but after searching a bit I was unable to find any.  Does someone know where I could find one?

Thanks,
Justin
------=_Part_26668_32238739.1178322389132--