root/tags/lgt2306/configs/NOTES.txt

Revision 3883, 17.4 KB (checked in by pmoura, 15 months ago)

Minor documentation improvements.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1================================================================
2Logtalk - Open source object-oriented logic programming language
3Release 2.30.6
4
5Copyright (c) 1998-2007 Paulo Moura.  All Rights Reserved.
6================================================================
7
8
9This file contains some notes about the config files provided. If you
10improve or correct some of these files, or write new ones for other
11Prolog compilers, please send me a copy. It is impossible for me to
12individually test Logtalk under each Prolog listed here (or, for that
13mater, to own a copy of each one of these compilers). For some of
14these Prolog compilers I only have the manuals available on-line.
15
16As a general rule, always try to use the latest version of your Prolog
17compiler of choice. Most Prolog compilers are moving towards better
18ISO Standard compatibility and, as a consequence, improved Logtalk
19compatibility.
20
21
22template config file
23
24    template.config
25
26    If a config file for your favorite Prolog is not available, use this
27    file as a template for writing one. For each predicate in the file,
28    see if it is built-in in your Prolog, available in a library, or if
29    you can write a better definition.
30
31
32ALS Prolog 3.1
33
34    als.config
35
36    Only a few tests have been done with this compiler. One known problem: an
37    ALS bug in operator handling that make calls like "\+ ::Pred" be
38    interpreted like "::(\+ Pred)" instead of "\+ (::Pred)". A workaround is
39    to replace all occurrences of "\+ ::Pred" by "\+ (::Pred)" and all
40    occurrences of "\+ Obj::Pred" by "\+ (Obj::Pred)". Please report any other
41    problems that you might find. Don't forget to use the cd/1 predicate to
42    set the working directory before loading the library or an example. Consult
43    the file builtins/comp_d10.pro in the ALS Prolog installation directory in
44    order to get the definition of predicate numbervars/3 needed by the Logtalk
45    built-in debugger. Supports smart compilation of source files. Does not
46    support the "altdirs" compiler flag.
47
48
49Amzi! Prolog 7.6.1 and later versions
50
51    amzi.config
52
53    For Amzi! Prolog 7.6.1 and later versions. You need to patch the Logtalk
54    compiler (the "compiler/logtalk.pl" file) by searching for all calls of
55    ':'/2 and wrap them inside call/1. For better performance, use the Amzi!
56    "acmp" command-line compiler to compile the files "configs/amzi.config",
57    "compiler/logtalk.pl", and "libpaths/libpaths.pl" and then load the
58    resulting ".plm" files using the predicate load/1 (you will need first
59    to change the extension of the config file to either ".pl" or ".pro" and
60    to edit the "libpaths.pl" file by following the instructions on the
61    "libpaths/NOTES.txt" file).
62   
63    One potential problem is that the compiler definition of the compare/3
64    built-in predicate returns the atom == instead of = for identical terms
65    (contrary to every other Prolog compiler!). Search the library files for
66    all calls of the compare/3 predicate and make the necessary changes.
67    The built-in sort/2 predicate does not eliminate duplicates, which may
68    result in problems with some of the examples. Don't forget to use the
69    chdir/1 predicate to set the working directory before loading a library
70    or an example.
71
72
73B-Prolog 7.0 and later versions
74
75    b.config
76
77    For B-Prolog 7.0 and later versions. Don't forget to use the chdir/1
78    predicate to set the working directory before loading the library or
79    an example. Note that this configuration file redefines the B-Prolog
80    ::/2 finite-domain built-in predicate (you may use the alternative
81    in/2 predicate instead).
82
83    You can generate a new Prolog top level that includes the config file, the
84    Logtalk compiler/runtime, and the library paths file by doing something
85    like:
86
87        | ?- set_prolog_flag(redefined, off).
88
89        | ?- compile(['configs/b.config', 'compiler/logtalk.pl', 'libpaths/libpaths.pl']).
90   
91    These calls will result in the creation of three files, "b.config.out",
92    "logtalk.out", and "libpaths.out". Place these files on the $BPDIR
93    directory and then copy the "bp" script to a "bplgt" file and modify it
94    by adding the names of the three *.out files after the "$BPDIR/bp.out"
95    file (prefixing them with $BPDIR/). You will probably need to increase
96    the sizes of the code areas on the "bplgt" script if you run into
97    out-of-memory errors with complex applications.
98
99
100Bin-Prolog 8.x~10.x
101
102    bin.config
103
104    Start BinProlog using "bp -l4". You will need to create project files to
105    workaround the restriction of only one top-level file per interactive
106    session. For instance, the project file for the "metapredicates" example
107    will look like (in the Unix version):
108   
109        :- ['$LOGTALKHOME/configs/bin.config'].
110        :- ['$LOGTALKHOME/compiler/logtalk.pl'].
111       
112        :- ['$LOGTALKHOME/examples/metapredicates/meta.pl'].
113        :- ['$LOGTALKHOME/examples/metapredicates/sort1.pl'].
114        ...
115   
116    You will probably want to have a project file including only the config
117    and the pre-processor/runtime files (logtalk.pl) in order to compile the
118    examples using logtalk_compile/1-2 (do NOT use logtalk_load/1-2 or the
119    provided loader files). Don't forget to call the cd/1 predicate to set
120    the working directory before compiling the library or an example.
121    Supports smart compilation of source files.
122
123    Updated and tested with help of Arun Majumdar.
124
125
126CIAO Prolog 1.8p2 and later versions
127
128    ciao.config
129    ciao_aux.config
130
131    The "ciao.config" file is just a loader file containing two include/1
132    directives which load the "ciao_aux.config" and the Logtalk compiler/
133    runtime. You must edit the contents of the file ciao.config to match
134    your operating system (the include directive arguments are file paths
135    that differ between operating systems).
136
137    The definition of the predicate '$lgt_predicate_property'/2 in the file
138    "ciao_aux.config" is a bit of a hack, but should enable you to run the
139    Logtalk companion examples and to try out your own Logtalk programs.
140
141    Don't forget to call the cd/1 predicate to set the working directory
142    before compiling the library or an example (you will need first to
143    load the library system that exports the cd/1 predicate by calling the
144    goal use_module(library(system)). Supports smart compilation of source
145    files.
146
147
148CxProlog 0.95.x or later versions
149
150    cx.config
151
152    Experimental config file. Due to CxProlog native representation of file
153    paths, it's not currently possible to use library notation to load the
154    Logtalk examples and other source files.
155
156
157ECLiPSe 5.10#26 or later versions
158
159    eclipse.config
160    eclipseiso.config
161
162    There are two configs files for this compiler. The first one, named
163    "eclipse.config", should be used when, for some reason, we don't want
164    to load the "iso" library. The second file, "eclipseiso.config" contains
165    a call to load the "iso" library. Both config files may be used with
166    ECLiPSe 5.10 or later version.
167   
168    You should use the eclipseiso.config whenever possible. The alternative
169    config file may not contain all the needed definitions for ISO Prolog
170    predicates that are needed for compiling Logtalk itself, the Logtalk
171    library, or the Logtalk examples.
172
173    There is a clash between Logtalk and ECLiPSe regarding the ::/2 operator.
174    You may still use the ::/2 operator defined on the ECLiPSe constraint
175    solver libraries by using explicit module qualification by writing
176    "{library:(Var::Domain)}" (replace "library" by the actual library name;
177    the {}/1 control construct allows you to bypass the Logtalk compiler).
178
179    For improved performance, add the following calls to the top of all the
180    files in the "compiler" sub-directory:
181   
182        :- pragma(system).
183        :- pragma(nodebug).
184
185    These calls disables debugging support for the Logtalk compiler/runtime
186    Prolog code and mark the Logtalk predicates as built-ins. Make sure that
187    the library top-level is loaded if you want to use the Logtalk built-in
188    debugger.
189
190    Adopted from a config file written and tested with help of Taner Bilgic
191    for Logtalk 1.x. Don't forget to use the cd/1 predicate to set the working
192    directory before loading the library or an example. Supports smart
193    compilation of source files.
194
195    With this Prolog compiler, avoid reloading Logtalk source files declaring
196    and defining dynamic predicates. Due to the semantics of the ECLiPSe
197    built-in predicate compile/1, new clauses for dynamic predicates are
198    appended to the old ones instead of replacing them!
199
200
201GNU Prolog GNU Prolog 1.2.14 and later versions
202
203    gnu.config
204
205    GNU Prolog supports the ISO Prolog standard. No problems expected. You
206    can generate a new Prolog top level that includes the config file and
207    the Logtalk compiler/runtime by doing something like:
208
209        % cd $LOGTALKHOME
210        % mv configs/gnu.config configs/gnu.pl
211
212    Edit the compiler/logtalk.pl file and add the line ":- built_in." to
213    the top. Then:
214
215        % gplc -o logtalk configs/gnu.pl compiler/logtalk.pl
216        % mv logtalk /usr/local/bin/
217
218    This way, every time you want to work with Logtalk you will just need
219    to type:
220
221        % logtalk
222
223    Don't forget to use the change_directory/1 predicate to set the working
224    directory before loading the library or an example. Supports smart
225    compilation of source files.
226
227
228IF/Prolog 5.1 and later versions
229
230    if.config
231
232    IF/Prolog 5.1 supports the ISO Prolog standard. No problems expected.
233    Don't forget to use the cd/1 predicate to set the working directory
234    before loading the library or an example. Supports smart compilation
235    of source files. Does not support the "altdirs" compiler flag.
236
237
238JIProlog 3.0.2-6 and later versions
239
240    ji.config
241
242    Written with the help of the JIProlog author (but if you find any Logtalk
243    problem please report it to me). Don't forget to use the cd/1 predicate to
244    set the working directory before loading the library or an example. Some
245    examples may not compile or run due to work in progress regarding ISO
246    Prolog standard compliance. Supports smart compilation of source files.
247
248
249K-Prolog 5.1.2a and later versions
250
251    k.config
252
253    K-Prolog 5.1.2a supports the ISO Prolog standard. No problems expected.
254    Config file written and tested with the help of Nobukuni Kino. Don't
255    forget to use the cd/1 predicate to set the working directory before
256    loading the library or an example. Supports smart compilation of source
257    files.
258
259
260LPA MacProlog32 1.25
261
262    lpamac.config
263
264    This is my old Prolog development environment. Two known problems: (1) an
265    LPA bug in operator handling that make calls like "\+ ::Pred" be
266    interpreted like "::(\+ Pred)" instead of "\+ (::Pred)". A workaround is
267    to replace all occurrences of "\+ ::Pred" by "\+ (::Pred)"; (2) If you call
268    the \+ operator in your code the writeq/1 built-in don't always output a
269    space after the operator resulting in calls like "\+(...)". Because \+ is
270    not defined as a predicate this will fail. Don't forget to use the dvol/1
271    predicate to set the working directory before loading an example.
272    Due to the size of the Logtalk pre-processor file, you must load it by
273    using the consult/1 predicate instead of using the File:Open menu option.
274    Be aware that this configuration file redefines some built-ins that
275    you may use in your own programs. You must be careful to not consult the
276    config file twice. Supports smart compilation of source files. Does not
277    support the "altdirs" compiler flag.
278
279
280LPA WinProlog32 4.0x
281
282    lpawin.config
283
284    Written with the help of the LPA support team. Of course, if you find any
285    bugs please direct your flames to me ;-). Be aware that this configuration
286    file redefines some built-ins that you may use in your programs. Don't
287    forget to use the chdir/1 predicate to set the working directory before
288    loading the library or an example. Be careful to not consult the config
289    file twice. Supports smart compilation of source files. Does not support
290    the "altdirs" compiler flag.
291
292
293MasterProlog 4.1
294
295    master.config
296
297    Written with the help of the MasterProlog support team (but if you find
298    any Logtalk problem please report it to me).
299    If in the MasterProlog version that you are using the implementation of
300    the close/1 predicate does not follow the ISO standard, you will have to
301    apply the following patch to the Logtalk pre-processor: replace every
302    call of close(...) with fclose(...).  Does not support the "altdirs"
303    compiler flag.
304
305
306Open Prolog 1.1b5
307
308    open.config
309
310    Limited test done. Please report any problems that you may find.
311    Don't forget to use the set_folder/1 predicate to set the working
312    directory before loading the library or an example. Does not support
313    the "altdirs" compiler flag.
314
315
316PrologII+ 4.5 and later versions
317
318    prologII.config
319
320    Written and tested with the help of Claude Lai from PrologIA. You need
321    to apply the following patches to the Logtalk pre-processor/runtime:
322    Search and replace every instance of "quoted(true)" with "quoted(:true)";
323    "open(File, write, Stream)" with "open(File, :write, Stream)",
324    "catch(close(Stream), _, true)" with "catch(close(Stream), _, :true)",
325    "open(File, read, Stream)" with "open(File, :read, Stream, [eof_action(eof_code)])".
326    Remember that you need to use the set_import_dir/1 built-in predicate to
327    set the working directory before loading the library or an example.
328    Does not support the "altdirs" compiler flag.
329
330
331Qu-Prolog 8.1
332
333    qu.config
334
335    In order to compile and load both the config file and the Logtalk compiler,
336    the following sequence of steps is advised. First make a copy of the config
337    file:
338
339        % cd $LOGTALKHOME/configs; cp qu.config qu.ql
340
341    Second, start Qu-Prolog using adequate switches. For example:
342
343        % qp -T 16 -s 2048 -d 1024 -h 2000
344
345    Third, compile and load the config file using:
346
347        | ?- fcompile('qu.ql', [assemble_only(true)]), load(qu).
348
349    Next, compile and load the Logtalk compiler:
350
351        | ?- chdir('../compiler/'), fcompile('logtalk.pl', [assemble_only(true), string_table(256)]), load(logtalk).
352
353    Finally, compile and load the library paths file:
354
355        | ?- chdir('../libpaths/'), fcompile('libpaths.pl', [assemble_only(true)]), load(libpaths).
356
357    Don't forget to use the chdir/1 predicate to set the working directory
358    before loading the library or an example.
359
360    Written and tested with the help of Peter Robinson.
361
362
363Quintus Prolog 3.3~3.5
364
365    quintus.config
366
367    Written and tested with help of a friend of mine, Paulo Urbano, for a
368    previous version. Adopted (but not tested) for the current release by
369    using information available on-line in the internet. Don't forget to use
370    the unix(cd(Dir)) predicate to set the working directory before loading
371    the library or an example. Supports smart compilation of source files.
372
373
374SICStus Prolog 3.8~3.12.x
375
376    sicstus.config
377   
378    For versions 3.8.x~3.12.x. The config file sets the flag language to
379    iso, but that is only recommended and should not be needed to run Logtalk.
380    No problems expected although not fully tested. Don't forget to use the
381    SICStus working_directory/2 predicate to set the working directory before
382    loading the library or an example. Supports smart compilation of source
383    files.
384
385    If you want SICStus Prolog to automatically load Logtalk at startup, then
386    add the following lines to your ~/.sicstusrc or ~/.sicstus.ini initialization
387    file:
388   
389        :- compile('$LOGTALKHOME/configs/sicstus.config').
390        :- compile('$LOGTALKHOME/compiler/logtalk.pl').
391
392    Consult the SICStus Prolog documentation for further information on the
393    ~/.sicstusrc and ~/.sicstus.ini user initialization files.
394
395
396SICStus Prolog 4.0
397
398    sicstus4.config
399
400    Config file for the forthcoming SICStus Prolog 4.0 version (tested with
401    the Windows beta version).
402
403
404SWI Prolog 5.6.x and later versions
405
406    swi.config
407    swihook.pl
408    xpcehook.pl
409    swi_set_logtalk_context.pl
410
411    No problems expected. Please report any problem found (with a solution
412    if possible). Don't forget to use the cd/1 predicate to set the working
413    directory before loading the library or an example. Supports smart
414    compilation of source files. To improve the integration between Logtalk
415    and SWI-Prolog edit the compiler/logtalk.pl file and add the line
416    ":- system_module." to the top of the file. You may also load the file
417    configs/swihook.pl in order to be able to load Logtalk entities using
418    SWI-Prolog load_files/2 and consult/1 predicates.
419
420    If you want SWI-Prolog to automatically load Logtalk at startup, then add
421    the following lines to your pl.ini (on Windows):
422
423        :- ['drive:\\path to logtalk installation\\configs\\swi.config'].
424        :- ['drive:\\path to logtalk installation\\compiler\\logtalk.pl'].
425
426     or to your .plrc (on MacOS X, Linux, Unix, and similar systems):
427   
428        :- ['$LOGTALKHOME/configs/swi.config'].
429        :- ['$LOGTALKHOME/compiler/logtalk.pl'].
430
431    See the SWI-Prolog documentation for further information on the .plrc and
432    pl.ini user initialization files.
433
434    If you intend to use Logtalk and XPCE at the same time, and if you are
435    using an SWI-Prolog version older than 5.5.13, you will need to edit the
436    compiler/logtalk.pl file and, around line 35, change the declaration of
437    the @/1 operator to op(100, fx, @). You may load the configs/xpcehook.pl
438    file in order to support Logtalk message sending goals as XPCE call-back
439    goals.
440
441    See the comments in the "swi_set_logtalk_context.pl" itself for a
442    description of its functionality.
443
444    With multi-threading support turned on, you will get an warmless message
445    when halting the system regarding threads that wouldn't die: you can
446    supress the message on POSIX systems by using "% swilgt 2> /dev/null".
447
448
449XSB 3.1 and later versions
450
451    xsb.config
452
453    Don't forget to use the cd/1 predicate to set the working directory
454    before loading the library or an example. Supports smart compilation
455    of source files.
456
457
458YAP 5.1.2 and later versions
459
460    yap.config
461
462    Don't forget to use the cd/1 predicate to set the working directory
463    before loading the library or an example. Supports smart compilation
464    of source files.
Note: See TracBrowser for help on using the browser.