| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| I have a few questions about Prolog. In fact, the questions are about Prolog implementations. Next term, I will be taking a course on logic programming, and I decided to learn the thing beforehand. I tried a few Prolog implementations, and would appreciate if the community could correct my first impressions about the language. 1-- I started with SWI-Prolog, but I ran into an unexpected behavior of the compiler: I have written a few simple drills for who are learning French; the programs work, but I get nasty error messages that spoil the output aesthetic. I posted a simplified version of the culprit code on this forum, and you can check it if you want. Besides this, SWI-Prolog seems to use a lot of memory for its many stacks. Even a small bechmark requires 200 M of stack space. Is it true that SWI-Prolog uses a lot of memory for stacks? I am not sure whether this conclusion is correct, because I may be doing something really stupid, like running the programs with the debug on. 2-- My next trial was GNU-Prolog. Since I need a nice GUI, and I found three very good GUI implementations for GNU-Prolog, it would be my first choice, except for its hunger for memory space. In fact, GNU- Prolog seems to have three stacks, and refuses to run even the smallest program before getting at least 500 M of memory. For instance, in order to run tak 100 times, it requires 300M of local stack, 120M of trail stack, etc. Therefore, the only point that I could find in favor of GNU-Prolog is a good choice of GUI. 3-- YAP. This implementation is quite interesting. It seems that YAP is an interpreter, but it is as fast as GNU-Prolog in most benchmarks, and does not consume as much memory; in fact, YAP goes through all benchmarks without a single message of memory overflow. Am I right? On the other hand, I could not find a single GUI ready to go on YAP. If it had a GUI for Windows, my choice would be YAP. However, I think that my only option is GNU-Prolog. If I am wrong, let me know. |
|
#2
| |||
| |||
| On Fri, 25 Jul 2008 23:47:44 -0700 (PDT), phi500ac@yahoo.ca wrote: >I have a few questions about Prolog. In fact, the questions are about >Prolog implementations. Next term, I will be taking a course on logic >programming, and I decided to learn the thing beforehand. I tried a >few Prolog implementations, and would appreciate if the community >could correct my first impressions about the language. > >1-- I started with SWI-Prolog, but I ran into an unexpected behavior >of the compiler: I have written a few simple drills for who are >learning French; the programs work, but I get nasty error messages >that spoil the output aesthetic. I posted a simplified version of the >culprit code on this forum, and you can check it if you want. Besides >this, SWI-Prolog seems to use a lot of memory for its many stacks. >Even a small bechmark requires 200 M of stack space. Is it true that >SWI-Prolog uses a lot of memory for stacks? I am not sure whether this >conclusion is correct, because I may be doing something really stupid, >like running the programs with the debug on. > I am afraid that behavior of compiler is correct, this what is unexpected is behavior of your program caused by programming error. SWI Prolog is no different than other Prologs regarding using memory. However, wrong programming can cause behavior as you describe, and this can happen with ANY. See thread anout memory leaks some time ago on this group. >2-- My next trial was GNU-Prolog. Since I need a nice GUI, and I found >three very good GUI implementations for GNU-Prolog, it would be my >first choice, except for its hunger for memory space. In fact, GNU- >Prolog seems to have three stacks, and refuses to run even the >smallest program before getting at least 500 M of memory. For >instance, in order to run tak 100 times, it requires 300M of local >stack, 120M of trail stack, etc. Therefore, the only point that I >could find in favor of GNU-Prolog is a good choice of GUI. > There is something wrong with your programs... >3-- YAP. This implementation is quite interesting. It seems that YAP >is an interpreter, but it is as fast as GNU-Prolog in most benchmarks, >and does not consume as much memory; in fact, YAP goes through all >benchmarks without a single message of memory overflow. Am I right? On >the other hand, I could not find a single GUI ready to go on YAP. > >If it had a GUI for Windows, my choice would be YAP. However, I think >that my only option is GNU-Prolog. If I am wrong, let me know. SWI is THE BEST Prolog available among free Prologs. As I recall, there is also good GUI available for SWI. GNU seems to be a bit outdated, and is not actively maintained. A.L. |
|
#3
| |||
| |||
| On 26 jul, 11:43, A.L. <alewa...@zanoza.com> wrote: > On Fri, 25 Jul 2008 23:47:44 -0700 (PDT), phi50...@yahoo.ca wrote: > >I have a few questions about Prolog. In fact, the questions are about > >Prolog implementations. Next term, I will be taking a course on logic > >programming, and I decided to learn the thing beforehand. I tried a > >few Prolog implementations, and would appreciate if the community > >could correct my first impressions about the language. > > >1-- I started with SWI-Prolog, but I ran into an unexpected behavior > >of the compiler: I have written a few simple drills for who are > >learning French; the programs work, but I get nasty error messages > >that spoil the output aesthetic. I posted a simplified version of the > >culprit code on this forum, and you can check it if you want. Besides > >this, SWI-Prolog seems to use a lot of memory for its many stacks. > >Even a small bechmark requires 200 M of stack space. Is it true that > >SWI-Prolog uses a lot of memory for stacks? I am not sure whether this > >conclusion is correct, because I may be doing something really stupid, > >like running the programs with the debug on. > > I am afraid that behavior of compiler is correct, this what is > unexpected is behavior of your program caused by programming error. > > SWI Prolog is no different than other Prologs regarding using memory. > However, wrong programming can cause behavior as you describe, and > this can happen with ANY. See thread anout memory leaks some time ago > on this group. > > >2-- My next trial was GNU-Prolog. Since I need a nice GUI, and I found > >three very good GUI implementations for GNU-Prolog, it would be my > >first choice, except for its hunger for memory space. In fact, GNU- > >Prolog seems to have three stacks, and refuses to run even the > >smallest program before getting at least 500 M of memory. For > >instance, in order to run tak 100 times, it requires 300M of local > >stack, 120M of trail stack, etc. Therefore, the only point that I > >could find in favor of GNU-Prolog is a good choice of GUI. > > There is something wrong with your programs... > > >3-- YAP. This implementation is quite interesting. It seems that YAP > >is an interpreter, but it is as fast as GNU-Prolog in most benchmarks, > >and does not consume as much memory; in fact, YAP goes through all > >benchmarks without a single message of memory overflow. Am I right? On > >the other hand, I could not find a single GUI ready to go on YAP. > > >If it had a GUI for Windows, my choice would be YAP. However, I think > >that my only option is GNU-Prolog. If I am wrong, let me know. > > SWI is THE BEST Prolog available among free Prologs. As I recall, > there is also good GUI available for SWI. GNU seems to be a bit > outdated, and is not actively maintained. > > A.L. Hi, A.L. Thank you for answering my questions. I will tell you what was my problem with SWI Prolog GUI. I hope you can tell me what I did wrong. The program below works perfectly well with all versions of SWI Prolog, except the last one. In the last version it complains that prolog_file_type/2 is not declared public. As you can see, I do not use this predicate. My conclusion is: There is a bug in previous versions of GNU-Prolog, or the bug is in the current stable version. The third option is an undocumented change in behavior. By the way, the program is given in the manual. Therefore, if there is a bug, it is in the manual. Since the program works with old versions of the language, a possibility is that SWI-Prolog changed the behavior of a predicate or another, but the manual is dated. Since I need a stand along exec file, I saved the program using the following goal: ?- qsave_program('d:/pl/bin/drill.exe', [ goal=ask_name, toplevel=halt, stand_alone=true]). Here is the program: %:- use_module(library(pce)). ask_name :- nodebug, new(@nom, dialog('Register')), send(@nom, append, new(NameItem, text_item(name))), send(@nom, append, new(Eval, text_item(evaluation))), send(@nom, append, button(ok, message(@nom, return, NameItem?selection))), send(@nom, append, button(cancel, message(@nom, return, @nil))), send(@nom, default_button, ok), test(T,Gab), %write(T),nl, send(NameItem,value,T), get(@nom, confirm, Rval), %send(NameItem,clear), checar(Rval,Gab, Eval). ask_name :- free(@nom). test(crayon, pencil). test(finir, end). test(livre, book). |
|
#4
| |||
| |||
| On Sat, 26 Jul 2008 13:55:57 -0700 (PDT), phi500ac@yahoo.ca wrote: > >Hi, A.L. >Thank you for answering my questions. I will tell you what was my >problem with SWI Prolog GUI. Sorry, but: a. I am not using SWI, b. I an not using "Prolog GUI". In my opinion (and I am not alone) Prolog place is on the server, and GUI should be implemented in one of languages/tools/frameworks that are good for this purpose. Checj Amzi Porlog "Logic Server", www.amzi.com to see how this can be done A.L. |
|
#5
| |||
| |||
| On Jul 26, 10:23*pm, A.L. <alewa...@zanoza.com> wrote: > On Sat, 26 Jul 2008 13:55:57 -0700 (PDT), phi50...@yahoo.ca wrote: > > >Hi, A.L. > >Thank you for answering my questions. I will tell you what was my > >problem with SWI Prolog GUI. * > > Sorry, but: > > a. I am not using SWI, > b. I an not using "Prolog GUI". In my opinion (and I am not alone) > Prolog place is on the server, and GUI should be implemented in one of > languages/tools/frameworks that are good for this purpose. > > Checj Amzi Porlog "Logic Server",www.amzi.comto see how this can be > done > > A.L. Perhaps what the OP means by "GUI" is commonly referred to as an IDE (integrated development environment). regards, chip |
|
#6
| |||
| |||
| On Sun, 27 Jul 2008 20:38:34 -0700 (PDT), Chip Eastham <hardmath@gmail.com> wrote: >On Jul 26, 10:23*pm, A.L. <alewa...@zanoza.com> wrote: >> On Sat, 26 Jul 2008 13:55:57 -0700 (PDT), phi50...@yahoo.ca wrote: >> >> >Hi, A.L. >> >Thank you for answering my questions. I will tell you what was my >> >problem with SWI Prolog GUI. * >> >> Sorry, but: >> >> a. I am not using SWI, >> b. I an not using "Prolog GUI". In my opinion (and I am not alone) >> Prolog place is on the server, and GUI should be implemented in one of >> languages/tools/frameworks that are good for this purpose. >> >> Checj Amzi Porlog "Logic Server",www.amzi.comto see how this can be >> done >> >> A.L. > >Perhaps what the OP means by "GUI" is commonly referred >to as an IDE (integrated development environment). > Maybe. But Prolog (actually, almost all Prologs) are not very strong in this area... A.L. |
|
#7
| |||
| |||
| On Jul 28, 8:32*am, A.L. <alewa...@zanoza.com> wrote: > On Sun, 27 Jul 2008 20:38:34 -0700 (PDT), Chip Eastham > > > > <hardm...@gmail.com> wrote: > >On Jul 26, 10:23*pm, A.L. <alewa...@zanoza.com> wrote: > >> On Sat, 26 Jul 2008 13:55:57 -0700 (PDT), phi50...@yahoo.ca wrote: > > >> >Hi, A.L. > >> >Thank you for answering my questions. I will tell you what was my > >> >problem with SWI Prolog GUI. * > > >> Sorry, but: > > >> a. I am not using SWI, > >> b. I an not using "Prolog GUI". In my opinion (and I am not alone) > >> Prolog place is on the server, and GUI should be implemented in one of > >> languages/tools/frameworks that are good for this purpose. > > >> Checj Amzi Porlog "Logic Server",www.amzi.comtosee how this can be > >> done > > >> A.L. > > >Perhaps what the OP means by "GUI" is commonly referred > >to as an IDE (integrated development environment). > > Maybe. But Prolog (actually, almost all Prologs) are not very strong > in this area... > > A.L. Hi, A.L. Since you mentioned Amzi! Prolog (in the context of a server-based engine), I'll recommend the OP take a look at the way they leverage the (Java-based) Eclipse IDE for code editing and debugging: http://www.amzi.com regards, chip |
|
#8
| |||
| |||
| On 2008-07-26, phi500ac@yahoo.ca <phi500ac@yahoo.ca> wrote: > I have a few questions about Prolog. In fact, the questions are about > Prolog implementations. Next term, I will be taking a course on logic > programming, and I decided to learn the thing beforehand. I tried a > few Prolog implementations, and would appreciate if the community > could correct my first impressions about the language. > > 1-- I started with SWI-Prolog, but I ran into an unexpected behavior > of the compiler: I have written a few simple drills for who are > learning French; the programs work, but I get nasty error messages > that spoil the output aesthetic. I posted a simplified version of the > culprit code on this forum, and you can check it if you want. Besides > this, SWI-Prolog seems to use a lot of memory for its many stacks. > Even a small bechmark requires 200 M of stack space. Is it true that > SWI-Prolog uses a lot of memory for stacks? I am not sure whether this > conclusion is correct, because I may be doing something really stupid, > like running the programs with the debug on. If you run a program in debug mode is disables most of the space optimizations. In techy talk: it disables last-call optimization and pushes dummy choicepoints to allow for retry. Somehow the prolog_file_type message will be fixed if it can be reproduced. Sofar, I failed. Did you change the default extension from .pl to something else? --- Jan |
|
#9
| |||
| |||
| On 31 jul, 06:34, Jan Wielemaker <j...@nospam.ct.xs4all.nl> wrote: > On 2008-07-26, phi50...@yahoo.ca <phi50...@yahoo.ca> wrote: > > > > > I have a few questions about Prolog. In fact, the questions are about > > Prolog implementations. Next term, I will be taking a course on logic > > programming, and I decided to learn the thing beforehand. I tried a > > few Prolog implementations, and would appreciate if the community > > could correct my first impressions about the language. > > > 1-- I started with SWI-Prolog, but I ran into an unexpected behavior > > of the compiler: I have written a few simple drills for who are > > learning French; the programs work, but I get nasty error messages > > that spoil the output aesthetic. I posted a simplified version of the > > culprit code on this forum, and you can check it if you want. Besides > > this, SWI-Prolog seems to use a lot of memory for its many stacks. > > Even a small bechmark requires 200 M of stack space. Is it true that > > SWI-Prolog uses a lot of memory for stacks? I am not sure whether this > > conclusion is correct, because I may be doing something really stupid, > > like running the programs with the debug on. > > If you run a program in debug mode is disables most of the space > optimizations. In techy talk: it disables last-call optimization and > pushes dummy choicepoints to allow for retry. > > Somehow the prolog_file_type message will be fixed if it can be > reproduced. Sofar, I failed. Did you change the default extension > from .pl to something else? > > --- Jan No, Jan, I did not change the extension from .pl to something else. However, I discovered that the problem does not happen if I switch to version version 5.4.7. I will do the following. I will send you a copy of the program, and the stand alone file that I generated. I think that this will help you in removing the message. |
|
#10
| |||
| |||
| On 2008-08-01, phi500ac@yahoo.ca <phi500ac@yahoo.ca> wrote: >> Somehow the prolog_file_type message will be fixed if it can be >> reproduced. Sofar, I failed. Did you change the default extension >> from .pl to something else? >> >> --- Jan > > No, Jan, I did not change the extension from .pl to something else. > However, I discovered that the problem does not happen if I switch to > version version 5.4.7. I will do the following. I will send you a copy > of the program, and the stand alone file that I generated. I think > that this will help you in removing the message. I see it. Please, *don't* send executable code. It doesn't help and I'll never run it anyway. I'll try to have a look shortly. --- Ja |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.