From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id DAEB27EEEF for ; Tue, 9 Jun 2015 22:34:33 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of kennethadammiller@gmail.com) identity=pra; client-ip=209.85.218.68; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="kennethadammiller@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of kennethadammiller@gmail.com designates 209.85.218.68 as permitted sender) identity=mailfrom; client-ip=209.85.218.68; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="kennethadammiller@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-oi0-f68.google.com) identity=helo; client-ip=209.85.218.68; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="postmaster@mail-oi0-f68.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DTAQATTXdVlETaVdFcgkWBfgaDGLEqk1kHTAEBAQEBARIBAQEBBwsLCR8whDsRHQEbHgMSAw03AiQBEQEFASIBGhqHdgEDEpAFkGs+MYs/gWuCeZlEChknDVeEXgELGgEFDpMqgUUFkG+JZIQbliESI4EMCYQ4IjGCRwEBAQ X-IPAS-Result: A0DTAQATTXdVlETaVdFcgkWBfgaDGLEqk1kHTAEBAQEBARIBAQEBBwsLCR8whDsRHQEbHgMSAw03AiQBEQEFASIBGhqHdgEDEpAFkGs+MYs/gWuCeZlEChknDVeEXgELGgEFDpMqgUUFkG+JZIQbliESI4EMCYQ4IjGCRwEBAQ X-IronPort-AV: E=Sophos;i="5.13,583,1427752800"; d="scan'208";a="164244885" Received: from mail-oi0-f68.google.com ([209.85.218.68]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 09 Jun 2015 22:34:33 +0200 Received: by oiax69 with SMTP id x69so2653726oia.1 for ; Tue, 09 Jun 2015 13:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=lJgEfZ2wO59Pe3CPNvdWORT7L5ELW5M22ZrHQDjHk48=; b=Amcpf9jvyeauWVg5/zQrpNUa03cAnQ/1qFU5YsqWqwfZTPqK8mjAmMIMzwDXJaj3xB 0txHcNy0A1YK3ija7HjBRs99WAh0NaayXoaHw0dhltYLQb8ztAy0C36wc1ajU7w0h3KB Le3vrZ/A9bI+LE5Ob4yOw4leErSLZ8d/Vh0sre1avuQRiSja0CnuIj8+FM0LXawM0TAD P0OtGfXW/ssNrI/zO4Ob6v7O9ue9oN9BtXi/Vd4Daav+faLqKcdhavgw2KqA9nlthAYP V/PrPgnhCAC2oTjDj/6yN0kfGtNwqJEp112fdxqtgyt3oHNfbKMbIkvoGk6ZfM0nx4kH /siw== MIME-Version: 1.0 X-Received: by 10.182.135.202 with SMTP id pu10mr21236568obb.52.1433882071670; Tue, 09 Jun 2015 13:34:31 -0700 (PDT) Received: by 10.202.191.8 with HTTP; Tue, 9 Jun 2015 13:34:31 -0700 (PDT) Date: Tue, 9 Jun 2015 16:34:31 -0400 Message-ID: From: Kenneth Adam Miller To: caml users , piqi@googlegroups.com Content-Type: multipart/alternative; boundary=089e0129400488281805181baf10 Subject: [Caml-list] OCaml piqi difficulties --089e0129400488281805181baf10 Content-Type: text/plain; charset=UTF-8 I've been using piqi for quite a while and it's done wonders for me. Lately though, I've had some issues with transforming some types provided by another library into a piqi representation. Essentially, I'm at a crossroads where I'm running into a compile error, and I'm not sure how to fix it. Here's the root of my problem: Error: This expression has type Stmt_piqi.stmt list list but an expression was expected of type Bapservice_piqi.Bapservice_piqi.lifted_region = Bapservice_piqi.Bapservice_piqi.stmt_list list Type Stmt_piqi.stmt list is not compatible with type Bapservice_piqi.Bapservice_piqi.stmt_list = Bapservice_piqi.Bapservice_piqi.stmt list Type Stmt_piqi.stmt is not compatible with type Bapservice_piqi.Bapservice_piqi.stmt = [ `cpuexn of Bapservice_piqi.Bapservice_piqi.cpuexn | `if_stmt of Bapservice_piqi.Bapservice_piqi.if_stmt | `jmp of Bapservice_piqi.Bapservice_piqi.jmp | `move of Bapservice_piqi.Bapservice_piqi.move | `special of Bapservice_piqi.Bapservice_piqi.special | `while_stmt of Bapservice_piqi.Bapservice_piqi.while_stmt ] lifted_region is defined in my piqi file as a stmt list list (a list of instructions). Here's the part that I don't know: in piqi do I import the module instead of including it in order to get the compiler to see that the types are equivalent? (because they are, this is very much like debugging a phantom type error. Stmt_piqi.stmt is the same as Bapservice_piqi.stmt). My thinking with the above question is that if I import the module in piqi, then the piqi command will *not* generate a whole new ml, different entirely to the ml that was compiled and included in the library that I'm using, bap (it currently *is*). In that case, the types will be equivalent and everything will compile nicely. But I attempted to import the module in my piqi file, and that results in some compile error that I don't know how to solve: Unbound module Stmt_piqi. Naturally, in my makefile for generating ml of piqi encoder/decoder ocaml modules, I have an include that points to the folder that contains the bap stmt.piqi file. So the piqi ocaml command succeeds, but now I need to tell ocaml how to resolve the stmt_piqi module (compiled away in bap.serialization). I'm using oasis, and I already have bap.serialization in my depends, and the generated piqi ml file is auto detected and the correct bap.serialization is propagated through as a specified package on the command line. How do I get the compiler to either see type equivalence of the Bapservice_piqi.stmt type or to know where to get the Stmt_piqi module? --089e0129400488281805181baf10 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I've been using piqi for quite a while and it's done wo= nders for me.
Lately though, I= 've had some issues with transforming some types provided by another li= brary into a piqi representation.

Essentially, I'm at a crossroads where I'm running into a compil= e error, and I'm not sure how to fix it. Here's the root of my prob= lem:

Error: This expression has t= ype Stmt_piqi.stmt list list
=C2=A0 =C2=A0 =C2=A0 =C2=A0but an expressio= n was expected of type
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Bapservice_piqi= .Bapservice_piqi.lifted_region =3D
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Bapservice_piqi.Bapservice_piqi.stmt_list list
=C2=A0 =C2=A0 =C2= =A0 =C2=A0Type Stmt_piqi.stmt list is not compatible with type
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0Bapservice_piqi.Bapservice_piqi.stmt_list =3D
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Bapservice_piqi.Bapservice_piqi.s= tmt list=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0Type Stmt_piqi.stmt is not com= patible with type
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Bapservice_piqi.Baps= ervice_piqi.stmt =3D
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ `cpuexn = of Bapservice_piqi.Bapservice_piqi.cpuexn
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0| `if_stmt of Bapservice_piqi.Bapservice_piqi.if_stmt
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| `jmp of Bapservice_piqi.Bapservice_= piqi.jmp
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| `move of Bapservice_= piqi.Bapservice_piqi.move
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| `sp= ecial of Bapservice_piqi.Bapservice_piqi.special
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0| `while_stmt of Bapservice_piqi.Bapservice_piqi.while_= stmt ]



lifted_region is defined in my piqi file = as a stmt list list (a list of instructions). Here's the part that I do= n't know: in piqi do I import the module instead of including it in ord= er to get the compiler to see that the types are equivalent?=C2=A0

<= /div>
(because they are, this is very much like debugging a phantom type error= . Stmt_piqi.stmt is the same as Bapservice_piqi.stmt).

My thinki= ng with the above question is that if I import the module in piqi, then the= piqi command will *not* generate a whole new ml, different entirely to the= ml that was compiled and included in the library that I'm using, bap (= it currently *is*). In that case, the types will be equivalent and everythi= ng will compile nicely.

But I attempted to import the module in = my piqi file, and that results in some compile error that I don't know = how to solve:

Unbound module Stmt_piqi.=C2=A0

Natural= ly, in my makefile for generating ml of piqi encoder/decoder ocaml modules,= I have an include that points to the folder that contains the bap stmt.piq= i file. So the piqi ocaml command succeeds, but now I need to tell ocaml ho= w to resolve the stmt_piqi module (compiled away in bap.serialization). I&#= 39;m using oasis, and I already have bap.serialization in my depends, and t= he generated piqi ml file is auto detected and the correct bap.serializatio= n is propagated through as a specified package on the command line.

=
How do I get the compiler to either see type equivalence of the Bapserv= ice_piqi.stmt type or to know where to get the Stmt_piqi module?
--089e0129400488281805181baf10--