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 c5ff346549e7 (Postfix) with ESMTPS id 421A65D4 for ; Sun, 4 Nov 2018 17:42:07 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.54,464,1534802400"; d="scan'208,217";a="354053466" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 04 Nov 2018 18:41:56 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id 2EF1B824E4; Sun, 4 Nov 2018 18:41:56 +0100 (CET) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id EFF09824E4 for ; Sun, 4 Nov 2018 18:41:52 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=cilibrar@gmail.com; spf=Pass smtp.mailfrom=cilibrar@gmail.com; spf=None smtp.helo=postmaster@mail-oi1-f194.google.com IronPort-PHdr: =?us-ascii?q?9a23=3ArPG3ORcnoWP7aBUFFLry9Nq7lGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxcu8YB7h7PlgxGXEQZ/co6odzbaO7Oa4ASQp2tWoiDg6aptCVhsI24?= =?us-ascii?q?09vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7?= =?us-ascii?q?Ovr6GpLIj8Swyuu+54Dfbx9HiTahY75+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYe?= =?us-ascii?q?RWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZ?= =?us-ascii?q?TAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v6bpgRh31hy?= =?us-ascii?q?cdLzM2/2HZhMJzgqxGvhyuuwdyzJTIbIyPLvdyYr/RcNEcSGFcXshRTStBAoak?= =?us-ascii?q?YoUTEuoOIOdYpJTjqlsPqRu+BBKjBPn1xT9Th3/9wKo33PggEQHC3QwvBMgOv2?= =?us-ascii?q?7OrNjuO6cSVPq6zKjMzTnZc/xW3jL95ZHOfxs8r/+MWrdwftDQyUkpDw7KlEmf?= =?us-ascii?q?qYn/MzOSzOQNvHCX7+VhVeKzi24nthp+riKzyccrj4nFnoMVylbF9SVl2oo1IN?= =?us-ascii?q?m4RUhmatCnCJtdrz+WO5dyT884QGxluDw2xqAHtJO5ZiQG1ZAqyhHZZveaaYaH?= =?us-ascii?q?+AjjW/yUITpghHJqZra/hxGq/Eil0OL8V8203E9NripEj9XAr34N2wHX58WIUP?= =?us-ascii?q?d98UCh2TGA1wDX9O5IO1w7la3eK5I5w74wkIQcsVjbEyPohEn7iLWae0Yk9+Sy?= =?us-ascii?q?9ujqY7frqoWBO4JwhQzyKqEulda+AeQ8PAgORW+b+eGk2bL//E35RLRKgeYskq?= =?us-ascii?q?bDqpDXPssbpqujDA9U1oYv8QqwDzCj0NgAh3kIMEpFeA6bj4juI1zBPOr3DfK7?= =?us-ascii?q?g1i1lDdrxuvGPqH6D5XWLnnDla/hcqxn505dzgoz19Ff6IhOBrEPOvKgEnP24d?= =?us-ascii?q?fRCxt8Nw2v387mDs9838UQQzGhGKicZZnPvV7AzeMrIuOWbZQU8GL2Kvwk7eTn?= =?us-ascii?q?l1c2nFYcee+i2p5BOyPwJehvP0jMOSmkudwGC2pf5lNvHtyvs0WLVHtoX1j3Wq?= =?us-ascii?q?s94j8hD4f/VNXMQ4mshPqK2yLpR8QKNFADMUiFFDLTT6vBQ+0FMXvALcpokzhC?= =?us-ascii?q?Xr+kGdd4iEOe8TTiwr8iFdL6vy0VsZW5iopw7uzX0BYzrHl6VpXBlW6KSG5wky?= =?us-ascii?q?UDQDpkhK0=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AJCQA2Lt9bf8KnVdFjHgEGBwaBZYIqN?= =?us-ascii?q?Qx/KIN2gR2CXpAyTwEBB4pFcIQqiReBZg0jgVSCdYNAGgcBBDQWAQMBAQIBAQE?= =?us-ascii?q?BARMBAQkLCwgbDCUMgjYigwwEGQEbEQ0DEgMNNwIkAREBBQE+gxgBgWgBAwgND?= =?us-ascii?q?4xdjGmDHjyLDHsWBQEXgncFgTEBgnYKGScNWoEdGgIGEotkF3mBB4MlfoEoGQG?= =?us-ascii?q?BWQEBgS4BEgFMgleCVwKGVYI0H4ZCj0gJgWCFDoMkgxyDYxiCIY4/P4xJhx+DE?= =?us-ascii?q?A8hgTmBBXFNIxU7MYI7CYISGB2DN4QgdIVfHjCLboI+AQE?= X-IPAS-Result: =?us-ascii?q?A0AJCQA2Lt9bf8KnVdFjHgEGBwaBZYIqNQx/KIN2gR2CXpA?= =?us-ascii?q?yTwEBB4pFcIQqiReBZg0jgVSCdYNAGgcBBDQWAQMBAQIBAQEBARMBAQkLCwgbD?= =?us-ascii?q?CUMgjYigwwEGQEbEQ0DEgMNNwIkAREBBQE+gxgBgWgBAwgND4xdjGmDHjyLDHs?= =?us-ascii?q?WBQEXgncFgTEBgnYKGScNWoEdGgIGEotkF3mBB4MlfoEoGQGBWQEBgS4BEgFMg?= =?us-ascii?q?leCVwKGVYI0H4ZCj0gJgWCFDoMkgxyDYxiCIY4/P4xJhx+DEA8hgTmBBXFNIxU?= =?us-ascii?q?7MYI7CYISGB2DN4QgdIVfHjCLboI+AQE?= X-IronPort-AV: E=Sophos;i="5.54,464,1534802400"; d="scan'208,217";a="284290495" Received: from mail-oi1-f194.google.com ([209.85.167.194]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 04 Nov 2018 18:41:51 +0100 Received: by mail-oi1-f194.google.com with SMTP id k64-v6so5521239oia.13 for ; Sun, 04 Nov 2018 09:41:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=/85EpOhscYSyPMXzb/c5MYZ7a9soezuK1fnnM7yZlj8=; b=TU6G0L7RiCw6r6CaTAvv4o9SPXYV2Q+XDsmS+vK5FZvjKl2Ft1yX7/NkPRXzp0SeOv OnDItOPiqGHWvsAHT7RD8Sa973d2MJ83dlnz2eFUgBtNgKtFleU3XOdNKRQwZOyIJIPc PwSIvKuNyaniUD/ASLswLeGjg49pzIiOCEXDBZ6fgEVkScmsZTVEIsNtq4LrLzeIx6Ai qi4sFDKfM5C+jdW2RUf/xHEf+IX2rtmQuQbS5liuSteCxEkKV1Zfd0+p516zpdo3L6cH q2LVMQj8kMKX4FjT7bug7OAfVhNQsGuv5VZu50yq8DXRxvxzUdoFjdtJH7h54P/l2m+s ooFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/85EpOhscYSyPMXzb/c5MYZ7a9soezuK1fnnM7yZlj8=; b=cXKtL2rNq84h+74HL9uYDZOhmx6y5bwjkbA0PcU/EsZ3mWS35AQIoqwdBbXQSCIQO7 IxIfU0rY5J04JIT3AyGujDYSzHCP9AS1hchmkVNGB+sxFSZbMxJM4P63AE4stQUPjSAy 5aUO0tF4vlvsZDb51JcN/CAilVVuR8hyd1G8pHETlJNC8IHN0BheIT+5jsFR4RiZJ4T9 6NA27XU+eSxplH1sN6JB1kqzIOwkCm5KV6YVBPCbxcBBxwWvtLKePeHqZc/dL1OG91xJ 6lehDOs92T9s02YFPLAqOzuJBoAs8TVllBIEZX3oQtpouhRfwMki5rCMy7g4OqFCg4Hq h7lw== X-Gm-Message-State: AGRZ1gIJcOB2NCWApKebuWQQVBlJH13lrMM3UiRVVBv/wRav3UELs13H 4y2zWCb00tvsfVbvECXhHorw8V7x2iQZGgG+NW1M9vI7 X-Google-Smtp-Source: AJdET5c/ZFf6YM5H07TL5dPcjp421t6847IlwXw6aFLOCuwQVf81GKiIS2zYZBwgtp3IVANWMQVXEG3zR7wxa7YFEls= X-Received: by 2002:aca:7502:: with SMTP id q2-v6mr11732558oic.131.1541353309674; Sun, 04 Nov 2018 09:41:49 -0800 (PST) MIME-Version: 1.0 From: Rudi Cilibrasi Date: Sun, 4 Nov 2018 09:41:38 -0800 Message-ID: To: caml-list@inria.fr Content-Type: multipart/alternative; boundary="0000000000007f21e80579da483d" Subject: [Caml-list] Request for hint/help in camlp4/5-ppx conversion of famous logic quotation code by Harrison Reply-To: Rudi Cilibrasi X-Loop: caml-list@inria.fr X-Sequence: 17116 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --0000000000007f21e80579da483d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Greetings ML friends, I have been gradually following the ML style languages a couple decades with HOL/SML etc and recently got interested in the OCaml variation. I've been able to make simple OCaml programs for my research but am hitting a steep learning curve trying to understand the differences between the preprocessors camlp4, camlp5, and ppx. The documentation is confusing to me at this point. I have been trying to compile the code from the famous and great book on logic called "Handbook of Practical Logic and Automated Reasoning" but it does not work for me under Ubuntu 18.04 using OCaml 4.05. I have opam 1.2.2. I am getting an "Unbound module Quotation" error that Icannot solve and I suspect is related to old coding convention for preprocessing. Would anybody on the list be able to help me (perhaps privately via email/github) to convert this small fragment to modern PPX syntax so that we can "unlock" the rest of the code describing first order logic? I attach a transcript below trying to compile one of many copies of the same code on github, this one from https://github.com/logic-tools/sml-handbook/tree/master/code/OCaml Any help or info you can provide to get unblocked would be appreciated. Thank you in advance for your kind attention. Best regards, Rudi ---------------------------------------------------------------------------= ------------- =E2=9E=9C sml-handbook git:(master) =E2=9C=97 cd code/OCaml =E2=9E=9C OCaml git:(master) =E2=9C=97 make echo '#use "init.ml";;' >.ocamlinit; (sleep 3s; rm -f .ocamlinit) & ocaml OCaml version 4.05.0 File "Quotexpander.ml", line 2, characters 5-72: Warning 3: deprecated: Pervasives.& Use (&&) instead. File "Quotexpander.ml", line 7, characters 0-13: Error: Unbound module Quotation File "Quotexpander.ml", line 998, characters 7-9: Unbound quotation: "" Camlp5 parsing version 7.06 # =E2=9E=9C OCaml git:(master) =E2=9C=97 cat Quotexpander.ml let quotexpander s =3D if String.sub s 0 1 =3D "|" & String.sub s (String.length s - 1) 1 =3D "|" then "secondary_parser \""^ (String.escaped (String.sub s 1 (String.length s - 2)))^"\"" else "default_parser \""^(String.escaped s)^"\"";; Quotation.add "" (Quotation.ExStr (fun x -> quotexpander));; =E2=9E=9C OCaml git:(master) =E2=9C=97 ocaml --version The OCaml toplevel, version 4.05.0 =E2=9E=9C OCaml git:(master) =E2=9C=97 opam --version 1.2.2 =E2=9E=9C OCaml git:(master) =E2=9C=97 --=20 Happy to Code with Integrity : Software Engineering Code of Ethics and Professional Practice --=20 Caml-list mailing list. Subscription management and archives: https://sympa.inria.fr/sympa/arc/caml-list https://inbox.ocaml.org/caml-list Forum: https://discuss.ocaml.org/ Bug reports: http://caml.inria.fr/bin/caml-bugs= --0000000000007f21e80579da483d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Greetings ML friends,

=
I have been gradually following the ML style languages a couple = decades
with HOL/SML etc and recently got interested in the OCaml= variation.

I've been able to make simple OCam= l programs for my research but am
hitting a steep learning curve = trying to understand the differences
between the preprocessors ca= mlp4, camlp5, and ppx. The documentation
is confusing to me at th= is point.

I have been trying to compile the code f= rom the famous and great book
on logic called "Handbook of P= ractical Logic and Automated Reasoning"
but it does not work= for me under Ubuntu 18.04 using OCaml 4.05. I
have opam 1.2.2.= =C2=A0 I am getting an "Unbound module Quotation" error
that Icannot solve and I suspect is related to old coding convention
=
for preprocessing.=C2=A0 Would anybody on the list be able to help me = (perhaps
privately via email/github) to convert this small fragme= nt to modern
PPX syntax so that we can "unlock" the res= t of the code describing first=C2=A0
order logic?=C2=A0 I attach = a transcript below trying to compile one of many
copies of the sa= me code on github, this one from


Any help or info you can provide to get unblocked would be apprecia= ted.
Thank you in advance for your kind attention.

=
Best regards,

Rudi
----------= ---------------------------------------------------------------------------= ---
=E2=9E=9C=C2=A0 sml-handbook git:(master) =E2=9C=97 cd code/O= Caml
=E2=9E=9C=C2=A0 OCaml git:(master) =E2=9C=97 make
= echo '#use "init.ml";;' &g= t;.ocamlinit; (sleep 3s; rm -f .ocamlinit) & ocaml
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 OCaml version 4.05.0

File "= Quotexpander.ml", line 2, characters 5-72:
Warning 3: deprec= ated: Pervasives.&
Use (&&) instead.
File &= quot;Quotexpander.ml", line 7, characters 0-13:
Error: Unbou= nd module Quotation
File "Quotexpander.ml", line 998, c= haracters 7-9:
Unbound quotation: ""
Camlp5 parsing version 7.06

<= /div>
#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=E2=9E=9C=C2=A0 OCaml git:(master) =E2=9C=97 cat Quote= xpander.ml=C2=A0
let quotexpander s =3D
=C2=A0 if Strin= g.sub s 0 1 =3D "|" & String.sub s (String.length s - 1) 1 = =3D "|" then
=C2=A0 =C2=A0 "secondary_parser \&quo= t;"^
=C2=A0 =C2=A0 (String.escaped (String.sub s 1 (String.l= ength s - 2)))^"\""
=C2=A0 else "default_pars= er \""^(String.escaped s)^"\"";;

Quotation.add "" (Quotation.ExStr (fun x -> quotexpand= er));;
=E2=9E=9C=C2=A0 OCaml git:(master) =E2=9C=97 ocaml --versi= on
The OCaml toplevel, version 4.05.0
=E2=9E=9C=C2=A0 O= Caml git:(master) =E2=9C=97 opam --version
1.2.2
=E2=9E= =9C=C2=A0 OCaml git:(master) =E2=9C=97=C2=A0


<= /div>--
--0000000000007f21e80579da483d--