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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id B5B19BBC4 for ; Fri, 3 Apr 2009 14:37:21 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhEDAAeg1UmGnQCBlGdsb2JhbACWIgEBAQEJCwgJEQO4fYQPBg X-IronPort-AV: E=Sophos;i="4.39,319,1235948400"; d="scan'208";a="37797955" Received: from shiva.jussieu.fr ([134.157.0.129]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Apr 2009 14:37:21 +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 n33CbK3O069870 for ; Fri, 3 Apr 2009 14:37:20 +0200 (CEST) X-Ids:165 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 n33CbJub013084 for ; Fri, 3 Apr 2009 14:37:19 +0200 Received: (from abate@localhost) by hydrogene.pps.jussieu.fr (8.13.4/8.13.2/Submit) id n33CbJpB013083 for caml-list@yquem.inria.fr; Fri, 3 Apr 2009 14:37:19 +0200 Date: Fri, 3 Apr 2009 14:37:19 +0200 From: Pietro Abate To: caml-list@yquem.inria.fr Subject: ocamlgraph ConcreteBidirectional and Dot Message-ID: <20090403123719.GA12123@uranium.pps.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: GNU/Linux User-Agent: Mutt/1.5.9i 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 jchkmail2.jussieu.fr with ID 49D60300.005 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 49D60300.005/134.157.168.1/hydrogene.pps.jussieu.fr/hydrogene.pps.jussieu.fr/ X-j-chkmail-Score: MSGID : 49D60300.005 on jchkmail2.jussieu.fr : j-chkmail score : . : R=. U=. O=. B=0.023 -> S=0.023 X-j-chkmail-Status: Ham X-Spam: no; 0.00; 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 val:01 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.