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 B1BF07EEEF for ; Wed, 10 Jun 2015 00:48:23 +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.214.169; 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.214.169 as permitted sender) identity=mailfrom; client-ip=209.85.214.169; 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-ob0-f169.google.com) identity=helo; client-ip=209.85.214.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="postmaster@mail-ob0-f169.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AAAQAJbHdVlKnWVdFcgkVqNV8Ggxi9Q4V7AoFFB0wBAQEBAQESAQEBAQcLCwkfMIQjAQEBAgESEQQZARseAwELBgMCCzcCAiEBAREBBQEcBgESIod2AQMKCA2PY5BrPjGLP4FrgnmZUwoZJw1XhF4BAQEHAQEBAQEXAQUOizWCTYJAgmiBRQWLaIwYglOCO4FggXCObYVEEiOBDAmEOCIxgkcBAQE X-IPAS-Result: A0AAAQAJbHdVlKnWVdFcgkVqNV8Ggxi9Q4V7AoFFB0wBAQEBAQESAQEBAQcLCwkfMIQjAQEBAgESEQQZARseAwELBgMCCzcCAiEBAREBBQEcBgESIod2AQMKCA2PY5BrPjGLP4FrgnmZUwoZJw1XhF4BAQEHAQEBAQEXAQUOizWCTYJAgmiBRQWLaIwYglOCO4FggXCObYVEEiOBDAmEOCIxgkcBAQE X-IronPort-AV: E=Sophos;i="5.13,584,1427752800"; d="scan'208";a="164256847" Received: from mail-ob0-f169.google.com ([209.85.214.169]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Jun 2015 00:48:22 +0200 Received: by obbir4 with SMTP id ir4so22924869obb.1 for ; Tue, 09 Jun 2015 15:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ktDwWHhi7XDN9sZtF0xP69M/EhYKomQP/tSciSOFBUY=; b=FqbO8i21+NGUGifLD5fu/TCQd3lJi3HijgKXq+dmmqdzruZ+bd0KF2yHlWeYxLjAZt Qppt4SVa/7q6WQfJ8Fi55PAZP2bWH88+FWEsEaDlBLxPdhGuxxkus2Tfb1gjFTxGsiTY Y99QRnkJWTW7oLS5dl4cXmIYvP4916Ox3BeOu4pWHa509qWJ1eChfjkX9cEuPi+H6nAY 5rBWIGjWKYQi4xLpTSYI/punOEHxCzBALEmy1Ei0A3eaUUUuTINGbMAwqGzalD4q9h+A wd5pvSUZjAyrOMJx9cTk+/ZjMxg9rXThf3Fbvy9FYkCKBndnbnhJFdM3ias19AzTkZli 5Rtg== MIME-Version: 1.0 X-Received: by 10.60.134.132 with SMTP id pk4mr69696oeb.7.1433890101385; Tue, 09 Jun 2015 15:48:21 -0700 (PDT) Received: by 10.202.191.8 with HTTP; Tue, 9 Jun 2015 15:48:21 -0700 (PDT) In-Reply-To: References: Date: Tue, 9 Jun 2015 18:48:21 -0400 Message-ID: From: Kenneth Adam Miller To: caml users , piqi@googlegroups.com Content-Type: multipart/alternative; boundary=047d7b47252c23df1e05181d8e92 Subject: Re: [Caml-list] OCaml piqi difficulties --047d7b47252c23df1e05181d8e92 Content-Type: text/plain; charset=UTF-8 To be more clear, after I thought about it a bit more, I think what I need is definitely one of two things, either: 1) to edit is the include path, either for ocamlbuild or oasis. The problem is, the implementation for a module is already in the library path... In this way, it will know where to find the appropriate ml, or cmi, cmo/x 2) tell piqi how to fully qualify the module into the other library. -> http://piqi.org/doc/ocaml/#piqitoocamlmapping Speak of the devil, I think that might be it! *edit* OK, so I think I got it down... now it's just a piqi usage issue.I can edit the library interface that I'm using to expose that functionality. Now I need to know: .import [ module stmt .name XYZ ] once I expose the module name, and I should be able to force it to be fully qualified with the above. Problem is, I need to have the module name be Bap.Std.Bap_types.Bil_types.Bil_piqi; the periods are required. Problem: I can't put periods or '/' in the name of the module in order to get it to work. Variations on quotes didn't seem to make a difference either... How to get piqi to accept a fully qualified name? On Tue, Jun 9, 2015 at 4:34 PM, Kenneth Adam Miller < kennethadammiller@gmail.com> wrote: > 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? > --047d7b47252c23df1e05181d8e92 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
To be more clear, after I thought about it a bit more, I t= hink what I need is definitely one of two things, either:=C2=A0

1) to edit is the include path, either for ocamlbuild or oasis. The= problem is, the implementation for a module is already in the library path= ... In this way, it will know where to find the appropriate ml, or cmi, cmo= /x
2) tell piqi how to fully qualify the module into the other li= brary.=C2=A0
=C2=A0-> http://piqi.org/doc/ocaml/#piqitoocamlmapping
Spea= k of the devil, I think that might be it!

*edit*= =C2=A0
OK, so I think I got it down... now it's just a piqi u= sage issue.I can edit the library interface that I'm using to expose th= at functionality. Now I need to know:

.import [ module st= mt .name XYZ ]

once I expose the module name, and = I should be able to force it to be fully qualified with the above. Problem = is, I need to have the module name be Bap.Std.Bap_types.Bil_types.Bil_piqi;= the periods are required. Problem: I can't put periods or '/' = in the name of the module in order to get it to work. Variations on quotes = didn't seem to make a difference either...

How= to get piqi to accept a fully qualified name?

On Tue, Jun 9, 2015 at 4:34 PM, Ke= nneth Adam Miller <kennethadammiller@gmail.com> wr= ote:
I've been using piqi= for quite a while and it's done wonders for me.

Lately though, I've had some issues with transfo= rming some types provided by another library into a piqi representation.

Essentially, I'm at a crossro= ads 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
=C2= =A0 =C2=A0 =C2=A0 =C2=A0but an expression 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.stmt list=C2=A0
=C2=A0 =C2=A0 =C2= =A0 =C2=A0Type Stmt_piqi.stmt is not compatible with type
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0Bapservice_piqi.Bapservice_piqi.stmt =3D
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ `cpuexn of Bapservice_piqi.Bapservice_p= iqi.cpuexn
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| `if_stmt of Bapser= vice_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| `special of Bapservice_piqi.Bapserv= ice_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 ins= tructions). 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?=C2=A0

(because they are, this is very= much like debugging a phantom type error. Stmt_piqi.stmt is the same as Ba= pservice_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 m= odule Stmt_piqi.=C2=A0

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 ha= ve bap.serialization in my depends, and the generated piqi ml file is auto = detected and the correct bap.serialization is propagated through as a speci= fied package on the command line.

How do I get the compiler to e= ither see type equivalence of the Bapservice_piqi.stmt type or to know wher= e to get the Stmt_piqi module?

--047d7b47252c23df1e05181d8e92--