<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/01/e187f047fd50ec739e715541cee2a5ec"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-17T09:46:06"
  subject="Re: [Caml-list] Optimizing symbolic processing code"
  prev="2009/01/4ff47b3362226617fce6cf06a44ec5e5"
  next="2009/01/4274d9a042cd64c80ff97c7575ccf3cb"
  prev-in-thread="2009/01/3df558eab339e52cfc1c949697540acd"
  prev-thread="2009/01/585bcdfae45f6131d0268a09e5d0266a"
  next-thread="2009/01/7d9ffe8f9682d9fa8b4a85b38c339f33"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Optimizing symbolic processing code">
<msg 
  url="2009/01/8f74cee195e9898253fcdf3d0b9e3eea"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-16T08:42:54"
  subject="Optimizing symbolic processing code">
<msg 
  url="2009/01/1564274d854b2d85216a54ef618ecf88"
  from="blue storm &lt;bluestorm.dylc@g...&gt;"
  author="blue storm"
  date="2009-01-16T09:05:38"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
<msg 
  url="2009/01/42463dd39aad0eac550ca4e0e407beaa"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-16T09:44:49"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
</msg>
</msg>
<msg 
  url="2009/01/de82386b1ffadc797f53981187f9e437"
  from="Jon Harrop &lt;jon@f...&gt;"
  author="Jon Harrop"
  date="2009-01-16T13:38:02"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
<msg 
  url="2009/01/d18f89fa5df79d693f8e6c9aad0a5951"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-16T14:15:50"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
<msg 
  url="2009/01/d0510a2ea3cd55297cb1fd0d9dd54338"
  from="Peter Ilberg &lt;peter.ilberg@g...&gt;"
  author="Peter Ilberg"
  date="2009-01-16T16:14:45"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
<msg 
  url="2009/01/936fa2e3b8bb8806b844c999b8a5676c"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-16T16:19:47"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
<msg 
  url="2009/01/61e18a7af59c099177257fb94efd1e05"
  from="Andrej Bauer &lt;andrej.bauer@a...&gt;"
  author="Andrej Bauer"
  date="2009-01-16T19:09:18"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
<msg 
  url="2009/01/35ccf1fa409bb70e0fc0ff5b7660582e"
  from="Andrej Bauer &lt;andrej.bauer@a...&gt;"
  author="Andrej Bauer"
  date="2009-01-16T20:48:43"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
<msg 
  url="2009/01/4ff47b3362226617fce6cf06a44ec5e5"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-17T09:28:47"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
<msg 
  url="2009/01/4274d9a042cd64c80ff97c7575ccf3cb"
  from="Andrej Bauer &lt;andrej.bauer@a...&gt;"
  author="Andrej Bauer"
  date="2009-01-17T11:39:16"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
<msg 
  url="2009/01/63b5ac98757d28b595b8fd8a8df1de67"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-17T15:48:05"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
<msg 
  url="2009/01/e4b1f2ea536665130434f46b955e0a2a"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-17T16:08:47"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2009/01/3df558eab339e52cfc1c949697540acd"
  from="Kuba Ober &lt;ober.14@o...&gt;"
  author="Kuba Ober"
  date="2009-01-16T21:46:47"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
<msg 
  url="2009/01/e187f047fd50ec739e715541cee2a5ec"
  from="Hugo Ferreira &lt;hmf@i...&gt;"
  author="Hugo Ferreira"
  date="2009-01-17T09:46:06"
  subject="Re: [Caml-list] Optimizing symbolic processing code">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
Hello,

Kuba Ober wrote:
 &gt;
 &gt; On Jan 16, 2009, at 11:19 AM, Hugo Ferreira wrote:
 &gt;
 &gt;&gt; Peter Ilberg wrote:
 &gt;&gt;&gt; On Friday 16 January 2009 08:42:52 Hugo Ferreira wrote:
 &gt;&gt;&gt;&gt; I have implemented a simple Prolog like inference engine
 &gt;&gt;&gt;&gt; to be used in machine learning algorithms (ILP). My first
 &gt;&gt;&gt;&gt; basic test shows that inference is dismally slow (compared
 &gt;&gt;&gt;&gt; to a Prolog compiler).
 &gt;&gt;&gt;&gt; Consequently I am looking for information on optimizing the code.
 &gt;&gt;&gt; For implementing a Prolog-like language, you might want to look at
 &gt;&gt;&gt; this book on the Warren Abstract Machine:
 &gt;&gt;&gt; 
http://web.archive.org/web/20030213072337/http://www.vanx.org/archive/wam/wam.html 

 &gt;&gt;&gt;
 &gt;&gt;
 &gt;&gt; Ok, new of this document. But I think this demands too-much effort.
 &gt;
 &gt; What you expect, basically, is for OCaml to magically translate your
 &gt; likely cobbled-together, slowly performing interpreter into a bytecode
 &gt; compiler and a VM.
 &gt;

See response to Andrej Bauer's e-mail please.

 &gt; That ain't happening, and it's not OCaml's fault. Try compiling your
 &gt; code in F# and see how fast it runs - I doubt you'll see an
 &gt; improvement of more than an order of magnitude, unless you're really
 &gt; unlucky to hit some OCaml's deficiencies.

This is exactly the type of information I am looking for.
What deficiencies does Ocaml have that may cause efficiency problems?
How should one go about looking for these problems?
What can one do to avoid or correct these problems?

 &gt; I doubt that SWI Prolog would be
 &gt; substantially (as in more than an order of magnitude linear constant)
 &gt; slower
 &gt; if it were ported to OCaml.
 &gt;

Let me make this clear: I am not attempting to port anything.
I want a resolution based system to be used in a learning algorithm.
Naturally I want performance on par with possibly less efficient
Prolog implementations like SWI (BTW, SWI is my preferred Prolog 
interpreter, so don't misread what I just said). In fact I don't
need much of Prolog's programming capabilities (otherwise I would
have used Prolog).

 &gt; Writing a well-performing Prolog system is not an overnight task, at
 &gt; least not without using some decent compiler/system building
 &gt; libraries, which may not even exist.
 &gt;

Admittedly I am no expert in this or any other area for that matter.
Nevertheless this has not been "an overnight task". Again see
response to Andrej Bauer's e-mail please.

Hugo F.


 &gt; Cheers, Kuba
 &gt;
 &gt; _______________________________________________
 &gt; Caml-list mailing list. Subscription management:
 &gt; http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
 &gt; Archives: http://caml.inria.fr
 &gt; Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
 &gt; Bug reports: http://caml.inria.fr/bin/caml-bugs
 &gt;

</contents>

</message>

