Re: [Caml-list] Optimizing symbolic processing code

2009-01-17 Thread Hugo Ferreira
Hello, Just to rule out the issue with string comparison, I did a test by changing the predicate names names. I include the Prolog code for you. The results are: ~/Desktop/prolog_test/miniprolog$ time ./miniprolog.native -n prolog_opt.pl A = p B = r C = o D = l E = o F = g real11m27.547s use

Re: [Caml-list] Optimizing symbolic processing code

2009-01-17 Thread Hugo Ferreira
Hello Andrej, Andrej Bauer wrote: Dear Hugo, you have not noticed miniprolog before because it was not there until yesterday. I see. Almost any optimization will cause my interpreter to go much faster. Not quite. It depends a lot on the problem to solve and the order in which the knowled

Re: [Caml-list] Optimizing symbolic processing code

2009-01-17 Thread Andrej Bauer
Dear Hugo, you have not noticed miniprolog before because it was not there until yesterday. Almost any optimization will cause my interpreter to go much faster. I think the most reasonable one to do would be to avoid explicit subtitutions during unification (since I already keep track of the envi

Re: [Caml-list] Optimizing symbolic processing code

2009-01-17 Thread Hugo Ferreira
Hello, Kuba Ober wrote: > > On Jan 16, 2009, at 11:19 AM, Hugo Ferreira wrote: > >> Peter Ilberg wrote: >>> On Friday 16 January 2009 08:42:52 Hugo Ferreira wrote: I have implemented a simple Prolog like inference engine to be used in machine learning algorithms (ILP). My first bas

Re: [Caml-list] Optimizing symbolic processing code

2009-01-17 Thread Hugo Ferreira
Andrej, First and foremost thanks for taking the time to answer. Andrej Bauer wrote: After being so bad spirited in my last message, I decided to make it up by doing something positive. I have added to the PL Zoo a mini prolog interpreter, see http://andrej.com/plzoo/ . Interesting. I had vi

Re: [Caml-list] Optimizing symbolic processing code

2009-01-16 Thread Kuba Ober
On Jan 16, 2009, at 11:19 AM, Hugo Ferreira wrote: Peter Ilberg wrote: On Friday 16 January 2009 08:42:52 Hugo Ferreira wrote: I have implemented a simple Prolog like inference engine to be used in machine learning algorithms (ILP). My first basic test shows that inference is dismally slow (c

Re: [Caml-list] Optimizing symbolic processing code

2009-01-16 Thread Andrej Bauer
After being so bad spirited in my last message, I decided to make it up by doing something positive. I have added to the PL Zoo a mini prolog interpreter, see http://andrej.com/plzoo/ . It is very slow and I am sure a decent implementation would speed it up by an order of magnitude (at least a 100

Re: [Caml-list] Optimizing symbolic processing code

2009-01-16 Thread Andrej Bauer
On Fri, Jan 16, 2009 at 5:19 PM, Hugo Ferreira wrote: >> http://web.archive.org/web/20030213072337/http://www.vanx.org/archive/wam/wam.html > > Ok, new of this document. But I think this demands too-much effort. Judging from what your responses, the most probable explanation for inefficiency is t

Re: [Caml-list] Optimizing symbolic processing code

2009-01-16 Thread Hugo Ferreira
Peter Ilberg wrote: On Friday 16 January 2009 08:42:52 Hugo Ferreira wrote: I have implemented a simple Prolog like inference engine to be used in machine learning algorithms (ILP). My first basic test shows that inference is dismally slow (compared to a Prolog compiler). Consequently I am l

Re: [Caml-list] Optimizing symbolic processing code

2009-01-16 Thread Peter Ilberg
On Friday 16 January 2009 08:42:52 Hugo Ferreira wrote: I have implemented a simple Prolog like inference engine to be used in machine learning algorithms (ILP). My first basic test shows that inference is dismally slow (compared to a Prolog compiler). Consequently I am looking for informatio

Re: [Caml-list] Optimizing symbolic processing code

2009-01-16 Thread Hugo Ferreira
Jon Harrop wrote: On Friday 16 January 2009 08:42:52 Hugo Ferreira wrote: Hello, I have implemented a simple Prolog like inference engine to be used in machine learning algorithms (ILP). My first basic test shows that inference is dismally slow (compared to a Prolog compiler). Can you quantif

Re: [Caml-list] Optimizing symbolic processing code

2009-01-16 Thread Jon Harrop
On Friday 16 January 2009 08:42:52 Hugo Ferreira wrote: > Hello, > > I have implemented a simple Prolog like inference engine > to be used in machine learning algorithms (ILP). My first > basic test shows that inference is dismally slow (compared > to a Prolog compiler). Can you quantify that? >

Re: [Caml-list] Optimizing symbolic processing code

2009-01-16 Thread Hugo Ferreira
blue storm wrote: On 1/16/09, Hugo Ferreira wrote: I have implemented a simple Prolog like inference engine to be used in machine learning algorithms (ILP). My first basic test shows that inference is dismally slow (compared to a Prolog compiler). Consequently I am looking for information on op

Re: [Caml-list] Optimizing symbolic processing code

2009-01-16 Thread blue storm
On 1/16/09, Hugo Ferreira wrote: > I have implemented a simple Prolog like inference engine > to be used in machine learning algorithms (ILP). My first > basic test shows that inference is dismally slow (compared > to a Prolog compiler). Consequently I am looking for > information on optimizing th

[Caml-list] Optimizing symbolic processing code

2009-01-16 Thread Hugo Ferreira
Hello, I have implemented a simple Prolog like inference engine to be used in machine learning algorithms (ILP). My first basic test shows that inference is dismally slow (compared to a Prolog compiler). Consequently I am looking for information on optimizing the code. I have found: http://ocaml