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=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id A57F6BBC4 for ; Fri, 3 Apr 2009 16:40:55 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhEDAFS91UmGnQCBlGdsb2JhbACNHokEAQEBAQkLCAkRA7kThA8G X-IronPort-AV: E=Sophos;i="4.38,431,1233529200"; d="scan'208";a="26967484" Received: from shiva.jussieu.fr ([134.157.0.129]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Apr 2009 16:40:55 +0200 Received: from hydrogene.pps.jussieu.fr (hydrogene.pps.jussieu.fr [134.157.168.1]) by shiva.jussieu.fr (8.14.3/jtpda-5.4) with ESMTP id n33Eesr1038407 for ; Fri, 3 Apr 2009 16:40:54 +0200 (CEST) X-Ids:168 Received: from hydrogene.pps.jussieu.fr (localhost.localdomain [127.0.0.1]) by hydrogene.pps.jussieu.fr (8.13.4/jtpda-5.4) with ESMTP id n33EesRt021546 for ; Fri, 3 Apr 2009 16:40:54 +0200 Received: (from abate@localhost) by hydrogene.pps.jussieu.fr (8.13.4/8.13.2/Submit) id n33Eesng021545 for caml-list@yquem.inria.fr; Fri, 3 Apr 2009 16:40:54 +0200 Date: Fri, 3 Apr 2009 16:40:54 +0200 From: Pietro Abate To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] ocamlgraph ConcreteBidirectional and Dot Message-ID: <20090403144054.GA21243@uranium.pps.jussieu.fr> References: <20090403123719.GA12123@uranium.pps.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090403123719.GA12123@uranium.pps.jussieu.fr> X-Operating-System: GNU/Linux User-Agent: Mutt/1.5.9i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (shiva.jussieu.fr [134.157.0.168]); Fri, 03 Apr 2009 16:40:54 +0200 (CEST) X-Virus-Scanned: ClamAV 0.94.2/9201/Fri Apr 3 05:37:50 2009 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at jchkmail.jussieu.fr with ID 49D61FF6.007 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 49D61FF6.007/134.157.168.1/hydrogene.pps.jussieu.fr/hydrogene.pps.jussieu.fr/ X-j-chkmail-Score: MSGID : 49D61FF6.007 on jchkmail.jussieu.fr : j-chkmail score : . : R=. U=. O=. B=0.005 -> S=0.005 X-j-chkmail-Status: Ham X-Spam: no; 0.00; 0200,:01 functor:01 sig:01 sig:01 struct:01 pervasives:01 hash:01 hashtbl:01 hash:01 struct:01 node:01 attrs:01 mismatch:01 val:01 node:01 I still don't have an answer for this problem, but I'm wondering now ... is there a way to create a Labeled ConcreteBidirectional reusing these building blocks ? is there an ocamlgraph specific ml ? :) p On Fri, Apr 03, 2009 at 02:37:19PM +0200, Pietro Abate wrote: > Hello all. > > I've a small problem with ocamlgraph. > I want to parse a dot graph into a ConcreteBidirectional. > > The problem is that the signature needed for Dot.Parse requires a function > edge, but I've no mean to specify a label (since it is unlabelled !!)... > > The functor for ConcreteBidirectional says E.t = (V.t * V.t), > but I don't quite understand the type of B.G.E.label ... > > ConcreteBidirectional is of type Sig.I with > with type V.t = V.t and type V.label = V.t and type E.t = V.t * V.t > > Sig.I includes Sig.G > > and Sig.G has E: Sig.EDGE with type vertex = vertex > but I'm missing the type of label for unlabelled graphs ... that should be > an implementation detail, isn't it ? > > I tried to look at the implementation of per_imp.ml but I got a bit lost... > > this is what I'm trying to do: > > ------------------- > module V = struct > type t = string > let compare = Pervasives.compare > let hash = Hashtbl.hash > let equal l1 l2 = (l1 = l2) > end > > module G = Imperative.Digraph.ConcreteBidirectional(V) > > module B = Builder.I(G) > > module L = struct > open Dot_ast > let node (id,_) attrs = match id with > | Ident i -> i > | Number n -> n > | String s -> s > | Html h -> h > let edge l = "" > end > > module DIn = Dot.Parse (B)(L) > > --------------- > > the problem is: > > Error: Signature mismatch: > Modules do not match: > sig > val node : Graph.Dot_ast.id * 'a -> 'b -> string > val edge : 'a -> string > end > is not included in > sig > val node : > Graph.Dot_ast.node_id -> Graph.Dot_ast.attr list -> B.G.V.label > val edge : Graph.Dot_ast.attr list -> B.G.E.label > end > Values do not match: > val edge : 'a -> string > is not included in > val edge : Graph.Dot_ast.attr list -> B.G.E.label > Command exited with code 2. > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs