| 1 | ================================================================= |
|---|
| 2 | Logtalk - Object oriented extension to Prolog |
|---|
| 3 | Release 2.21.0 |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved. |
|---|
| 6 | ================================================================= |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | This file contains some notes about the config files provided. If you |
|---|
| 10 | improve or correct some of these files, or write new ones for other |
|---|
| 11 | Prolog compilers, please send me a copy. It is impossible for me to |
|---|
| 12 | individually test Logtalk under each Prolog listed here (or, for that |
|---|
| 13 | mater, to own a copy of each one of these compilers). For some of |
|---|
| 14 | these Prologs I only have the (on-line available) manuals. |
|---|
| 15 | |
|---|
| 16 | As a general rule, always try to use the most recent version of your |
|---|
| 17 | Prolog compiler of choice. Most Prolog compilers are moving towards |
|---|
| 18 | better ISO Standard compatibility and, as a consequence, improved |
|---|
| 19 | Logtalk compatibility. |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | template config file |
|---|
| 23 | |
|---|
| 24 | template.config |
|---|
| 25 | |
|---|
| 26 | If a config file for your favorite Prolog is not available, use this |
|---|
| 27 | file to write one. For each predicate in the file, see if it is built-in |
|---|
| 28 | in your Prolog, available in a library, or if you can write a better |
|---|
| 29 | definition. |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | ALS 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. |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | Amzi! Prolog 6.2.2 and later versions |
|---|
| 49 | |
|---|
| 50 | amzi.config |
|---|
| 51 | |
|---|
| 52 | For Amzi! Prolog 6.22 and later releases. The compiler definition of the |
|---|
| 53 | compare/3 built-in predicate returns the atom == instead of = for |
|---|
| 54 | identical terms (contrary to every other Prolog compiler!). You need to |
|---|
| 55 | search the library files for all calls of the compare/3 predicate and |
|---|
| 56 | make the necessary changes. Don't forget to use the chdir/1 predicate |
|---|
| 57 | to set the working directory before loading the library or an example. |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | B-Prolog 4.0~5.0, 6.4 and later versions |
|---|
| 61 | |
|---|
| 62 | b5.config |
|---|
| 63 | |
|---|
| 64 | For B-Prolog 4.0 or 5.0. |
|---|
| 65 | The (Logtalk) predicates '$lgt_current_date'/3 and '$lgt_current_time'/3 |
|---|
| 66 | have dummy definitions. Don't forget to use the chdir/1 predicate to |
|---|
| 67 | set the working directory before loading the library or an example. |
|---|
| 68 | |
|---|
| 69 | b6.config |
|---|
| 70 | |
|---|
| 71 | For B-Prolog 6.4 and later versions. |
|---|
| 72 | This version contains a bug in the atom_concat/3 predicate that prevents |
|---|
| 73 | some examples such as the "symdiff" from running. Don't forget to use the |
|---|
| 74 | chdir/1 predicate to set the working directory before loading the library |
|---|
| 75 | or an example. |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | Bin-Prolog 8.x~10.x |
|---|
| 79 | |
|---|
| 80 | bin.config |
|---|
| 81 | |
|---|
| 82 | Start BinProlog using "bp -l4". You will need to create project files to |
|---|
| 83 | workaround the restriction of only one top-level file per interactive |
|---|
| 84 | session. For instance, the project file for the metapredicates example |
|---|
| 85 | will look like (in the Unix version): |
|---|
| 86 | |
|---|
| 87 | :- ['$LOGTALKHOME/configs/bin.config']. |
|---|
| 88 | :- ['$LOGTALKHOME/compiler/logtalk.pl']. |
|---|
| 89 | |
|---|
| 90 | :- ['$LOGTALKHOME/examples/metapredicates/meta.pl']. |
|---|
| 91 | :- ['$LOGTALKHOME/examples/metapredicates/sort1.pl']. |
|---|
| 92 | ... |
|---|
| 93 | |
|---|
| 94 | You will probably want to have a project file including only the config |
|---|
| 95 | and the pre-processor/runtime files (logtalk.pl) in order to compile the |
|---|
| 96 | examples using logtalk_compile/1-2 (do NOT use logtalk_load/1-2 or the |
|---|
| 97 | provided loader files). Don't forget to call the cd/1 predicate to set |
|---|
| 98 | the working directory before compiling the library or an example. |
|---|
| 99 | Supports smart compilation of source files. |
|---|
| 100 | |
|---|
| 101 | Updated and tested with help of Arun Majumdar. |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | CIAO Prolog 1.8p2 and later versions |
|---|
| 105 | |
|---|
| 106 | ciao.config |
|---|
| 107 | ciao_aux.config |
|---|
| 108 | |
|---|
| 109 | The ciao.config is just a loader file with two include/1 directives |
|---|
| 110 | that load the ciao_aux.config and the Logtalk compiler/runtime. You |
|---|
| 111 | must edit the contents of the file ciao.config to match your operating |
|---|
| 112 | system (the include directives arguments are file paths that differ |
|---|
| 113 | between operating systems). The definition of the '$lgt_predicate_property'/2 |
|---|
| 114 | in file ciao_aux.config is a bit of a hack, but should enable you to run |
|---|
| 115 | the Logtalk companion examples and to try out your own Logtalk programs. |
|---|
| 116 | Don't forget to call the cd/1 predicate to set the working directory before |
|---|
| 117 | compiling the library or an example (you will need first to load the library |
|---|
| 118 | system that exports the cd/1 predicate by calling the goal |
|---|
| 119 | use_module(library(system)). Supports smart compilation of source files. |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | ECLiPSe 5.5~5.7 |
|---|
| 123 | |
|---|
| 124 | eclipse.config |
|---|
| 125 | eclipseiso.config |
|---|
| 126 | |
|---|
| 127 | There are two configs files for this compiler. The first one, named |
|---|
| 128 | "eclipse.config", should be used when, for some reason, we don't want |
|---|
| 129 | to load the "iso" library. The second file, "eclipseiso.config" contains |
|---|
| 130 | a call to load the "iso" library. Both config files may be used with |
|---|
| 131 | ECLiPSe versions from 5.5 to 5.7 |
|---|
| 132 | |
|---|
| 133 | You should use the eclipseiso.config whenever possible. The alternative |
|---|
| 134 | config file may not contain all the needed definitions for ISO Prolog |
|---|
| 135 | predicates that are needed for compiling Logtalk itself, the Logtalk |
|---|
| 136 | library or the Logtalk examples. |
|---|
| 137 | |
|---|
| 138 | For improved performance, add the following calls to the top of all the |
|---|
| 139 | files in the "compiler" sub-directory: |
|---|
| 140 | |
|---|
| 141 | :- pragma(system). |
|---|
| 142 | :- pragma(nodebug). |
|---|
| 143 | |
|---|
| 144 | These calls disables debugging support for the Logtalk compiler/runtime |
|---|
| 145 | Prolog code and mark the Logtalk predicates as built-ins. Make sure that |
|---|
| 146 | the library toplevel is loaded if you want to use the Logtalk built-in |
|---|
| 147 | debugger. |
|---|
| 148 | |
|---|
| 149 | Adopted from a config file written and tested with help of Taner Bilgic |
|---|
| 150 | for Logtalk 1.x. Don't forget to use the cd/1 predicate to set the working |
|---|
| 151 | directory before loading the library or an example. Supports smart |
|---|
| 152 | compilation of source files. |
|---|
| 153 | |
|---|
| 154 | |
|---|
| 155 | GNU Prolog 1.1.2 (and later versions, except 1.2.13) |
|---|
| 156 | |
|---|
| 157 | gnu.config |
|---|
| 158 | |
|---|
| 159 | GNU Prolog supports the ISO Prolog standard. No problems expected. You |
|---|
| 160 | can generate a new Prolog top level that includes the Logtalk config file |
|---|
| 161 | and pre-processor plus the runtime by doing something like: |
|---|
| 162 | |
|---|
| 163 | % cd $LOGTALKHOME |
|---|
| 164 | % mv configs/gnu.config configs/gnu.pl |
|---|
| 165 | |
|---|
| 166 | Edit the compiler/logtalk.pl file and add the line ":- built_in." to the |
|---|
| 167 | top. Then: |
|---|
| 168 | |
|---|
| 169 | % gplc -o logtalk configs/gnu.pl compiler/logtalk.pl |
|---|
| 170 | % mv logtalk /usr/local/bin/ |
|---|
| 171 | |
|---|
| 172 | This way, every time you want to work with Logtalk you will just need to |
|---|
| 173 | type: |
|---|
| 174 | |
|---|
| 175 | % logtalk |
|---|
| 176 | |
|---|
| 177 | Don't forget to use the change_directory/1 predicate to set the working |
|---|
| 178 | directory before loading the library or an example. Supports smart |
|---|
| 179 | compilation of source files. |
|---|
| 180 | |
|---|
| 181 | |
|---|
| 182 | IF/Prolog 5.1 |
|---|
| 183 | |
|---|
| 184 | if.config |
|---|
| 185 | |
|---|
| 186 | IF/Prolog 5.1 supports the ISO Prolog standard. No problems expected. |
|---|
| 187 | Don't forget to use the cd/1 predicate to set the working directory |
|---|
| 188 | before loading the library or an example. Supports smart compilation |
|---|
| 189 | of source files. |
|---|
| 190 | |
|---|
| 191 | |
|---|
| 192 | K-Prolog 5.01 Linux/Solaris, 5.02 Windows and later versions |
|---|
| 193 | |
|---|
| 194 | k.config |
|---|
| 195 | |
|---|
| 196 | Config file for the Linux/Solaris 5.01 version or Windows 5.0.2 version or |
|---|
| 197 | later versions (if you are still running version 5.00, please upgrade before |
|---|
| 198 | using Logtalk). K-Prolog 5.01 supports the ISO Prolog standard. No problems |
|---|
| 199 | expected. This config file have been written with the help of Nobukuni Kino. |
|---|
| 200 | Don't forget to use the cd/1 predicate to set the working directory before |
|---|
| 201 | loading the library or an example. Supports smart compilation of source files. |
|---|
| 202 | |
|---|
| 203 | |
|---|
| 204 | LPA MacProlog32 1.25 |
|---|
| 205 | |
|---|
| 206 | lpamac.config |
|---|
| 207 | |
|---|
| 208 | This is my old Prolog development environment. Two known problems: (1) an |
|---|
| 209 | LPA bug in operator handling that make calls like "\+ ::Pred" be |
|---|
| 210 | interpreted like "::(\+ Pred)" instead of "\+ (::Pred)". A workaround is |
|---|
| 211 | to replace all occurrences of "\+ ::Pred" by "\+ (::Pred)"; (2) If you call |
|---|
| 212 | the \+ operator in your code the writeq/1 built-in don't always output a |
|---|
| 213 | space after the operator resulting in calls like "\+(...)". Because \+ is |
|---|
| 214 | not defined as a predicate this will fail. Don't forget to use the dvol/1 |
|---|
| 215 | predicate to set the working directory before loading an example. |
|---|
| 216 | Due to the size of the Logtalk pre-processor file, you must load it by |
|---|
| 217 | using the consult/1 predicate instead of using the File:Open menu option. |
|---|
| 218 | Be aware that this configuration file redefines some built-ins that |
|---|
| 219 | you may use in your own programs. You must be careful to not consult the |
|---|
| 220 | config file twice. Supports smart compilation of source files. |
|---|
| 221 | |
|---|
| 222 | |
|---|
| 223 | LPA WinProlog32 4.0x |
|---|
| 224 | |
|---|
| 225 | lpawin.config |
|---|
| 226 | |
|---|
| 227 | Written with the help of the LPA support team. Of course, if you find any |
|---|
| 228 | bugs please direct your flames to me ;-). Be aware that this configuration |
|---|
| 229 | file redefines some built-ins that you may use in your programs. Don't |
|---|
| 230 | forget to use the chdir/1 predicate to set the working directory before |
|---|
| 231 | loading the library or an example. Be careful to not consult the config |
|---|
| 232 | file twice. Supports smart compilation of source files. |
|---|
| 233 | |
|---|
| 234 | |
|---|
| 235 | MasterProlog 4.1 |
|---|
| 236 | |
|---|
| 237 | master.config |
|---|
| 238 | |
|---|
| 239 | Written with the help of the MasterProlog support team (but if you find |
|---|
| 240 | any Logtalk problem please report it to me). |
|---|
| 241 | If in the MasterProlog version that you are using the implementation of |
|---|
| 242 | the close/1 predicate does not follow the ISO standard, you will have to |
|---|
| 243 | apply the following patch to the Logtalk pre-processor: replace every |
|---|
| 244 | call of close(...) with fclose(...). |
|---|
| 245 | |
|---|
| 246 | |
|---|
| 247 | Open Prolog 1.1b5 |
|---|
| 248 | |
|---|
| 249 | open.config |
|---|
| 250 | |
|---|
| 251 | Limited test done. Please report any problems that you may find. |
|---|
| 252 | Don't forget to use the set_folder/1 predicate to set the working |
|---|
| 253 | directory before loading the library or an example. |
|---|
| 254 | |
|---|
| 255 | |
|---|
| 256 | PrologII+ 4.5 and later versions |
|---|
| 257 | |
|---|
| 258 | prologII.config |
|---|
| 259 | |
|---|
| 260 | Written and tested with the help of Claude Lai from PrologIA. You need |
|---|
| 261 | to apply the following patches to the Logtalk pre-processor/runtime: |
|---|
| 262 | Search and replace every instance of "quoted(true)" with "quoted(:true)"; |
|---|
| 263 | "open(File, write, Stream)" with "open(File, :write, Stream)", |
|---|
| 264 | "catch(close(Stream), _, true)" with "catch(close(Stream), _, :true)", |
|---|
| 265 | "open(File, read, Stream)" with "open(File, :read, Stream, [eof_action(eof_code)])". |
|---|
| 266 | Remember that you need to use the set_import_dir/1 built-in predicate to |
|---|
| 267 | set the working directory before loading the library or an example. |
|---|
| 268 | |
|---|
| 269 | |
|---|
| 270 | Qu-Prolog 6.5 |
|---|
| 271 | |
|---|
| 272 | qu.config |
|---|
| 273 | |
|---|
| 274 | Qu-Prolog 6.5 does not support floats. In order to compile the Logtalk |
|---|
| 275 | library and the Logtalk examples you will need to replace all occurrences |
|---|
| 276 | of floats by either integers or (quoted) atoms. In Unix-like systems, you |
|---|
| 277 | may perform the changes by running the following commands: |
|---|
| 278 | |
|---|
| 279 | % cd $LOGTALKHOME |
|---|
| 280 | % find . -name "*.lgt" -exec perl -pi -e "s/version is (\d)\.(\d)/version is '\1\.\2'/" {} \; |
|---|
| 281 | |
|---|
| 282 | Not that the above patch will not enable some examples that use floats to |
|---|
| 283 | run. |
|---|
| 284 | |
|---|
| 285 | In order to compile and load both the config file and the Logtalk compiler, |
|---|
| 286 | the following sequence of steps is advised. First make a copy of the config |
|---|
| 287 | file: |
|---|
| 288 | |
|---|
| 289 | % cd $LOGTALKHOME/configs; cp qu.config qu.ql |
|---|
| 290 | |
|---|
| 291 | Second, start Qu-Prolog using adequate switches. For example: |
|---|
| 292 | |
|---|
| 293 | % qp -s 2048 -d 1024 -h 2000 |
|---|
| 294 | |
|---|
| 295 | Next, compile and load the config file using: |
|---|
| 296 | |
|---|
| 297 | | ?- fcompile('qu.ql', [assemble_only(true)]), load(qu). |
|---|
| 298 | |
|---|
| 299 | Finally, compile and load the Logtalk compiler: |
|---|
| 300 | |
|---|
| 301 | | ?- chdir('../compiler/'), fcompile('logtalk.pl', [assemble_only(true), string_table(256)]), load(logtalk). |
|---|
| 302 | |
|---|
| 303 | Don't forget to use the chdir/1 predicate to set the working directory |
|---|
| 304 | before loading the library or an example. |
|---|
| 305 | |
|---|
| 306 | Written and tested with the help of Peter Robinson. |
|---|
| 307 | |
|---|
| 308 | |
|---|
| 309 | Quintus Prolog 3.3~3.5 |
|---|
| 310 | |
|---|
| 311 | quintus.config |
|---|
| 312 | |
|---|
| 313 | Written and tested with help of a friend of mine, Paulo Urbano, for a |
|---|
| 314 | previous version. Adopted (but not tested) for the current release by |
|---|
| 315 | using information available on-line in the internet. Don't forget to use |
|---|
| 316 | the unix(cd(Dir)) predicate to set the working directory before loading |
|---|
| 317 | the library or an example. Supports smart compilation of source files. |
|---|
| 318 | |
|---|
| 319 | |
|---|
| 320 | SICStus Prolog 3.8~3.11.x |
|---|
| 321 | |
|---|
| 322 | sicstus.config |
|---|
| 323 | |
|---|
| 324 | For versions 3.8.x~3.11.x. The config file sets the flag language to |
|---|
| 325 | iso, but that is only recommended and should not be needed to run Logtalk. |
|---|
| 326 | No problems expected although not fully tested. Don't forget to use the |
|---|
| 327 | SICStus working_directory/2 predicate to set the working directory before |
|---|
| 328 | loading the library or an example. Supports smart compilation of source |
|---|
| 329 | files. |
|---|
| 330 | |
|---|
| 331 | If you want SICStus Prolog to automatically load Logtalk at startup, then |
|---|
| 332 | add the following lines to your ~/.sicstusrc or ~/.sicstus.ini initialization |
|---|
| 333 | file: |
|---|
| 334 | |
|---|
| 335 | :- compile('$LOGTALKHOME/configs/sicstus.config'). |
|---|
| 336 | :- compile('$LOGTALKHOME/compiler/logtalk.pl'). |
|---|
| 337 | |
|---|
| 338 | Consult the SICStus Prolog documentation for further information on the |
|---|
| 339 | ~/.sicstusrc and ~/.sicstus.ini user initialization files. |
|---|
| 340 | |
|---|
| 341 | |
|---|
| 342 | SWI Prolog 3.3.x and all later versions |
|---|
| 343 | |
|---|
| 344 | swi.config |
|---|
| 345 | |
|---|
| 346 | For version 3.3.x and all later versions (5.2.3 or later recommended) |
|---|
| 347 | |
|---|
| 348 | No problems expected. Please report any problem found (with a solution |
|---|
| 349 | if possible). Don't forget to use the cd/1 predicate to set the working |
|---|
| 350 | directory before loading the library or an example. Supports smart |
|---|
| 351 | compilation of source files. To improve the integration between Logtalk |
|---|
| 352 | and SWI-Prolog edit the compiler/logtalk.pl file and add the line |
|---|
| 353 | ":- system_module." to the top of the file. You may also load the file |
|---|
| 354 | configs/swihook.pl in order to be able to load Logtalk entities using |
|---|
| 355 | SWI-Prolog load_files/2 and consult/1 predicates. |
|---|
| 356 | |
|---|
| 357 | If you want SWI-Prolog to automatically load Logtalk at startup, then add |
|---|
| 358 | the following lines to your pl.ini (on Windows): |
|---|
| 359 | |
|---|
| 360 | :- ['drive:\\path to logtalk installation\\configs\\swi.config']. |
|---|
| 361 | :- ['drive:\\path to logtalk installation\\compiler\\logtalk.pl']. |
|---|
| 362 | |
|---|
| 363 | or to your .plrc (on MacOS X, Unix, and similar systems): |
|---|
| 364 | |
|---|
| 365 | :- ['$LOGTALKHOME/configs/swi.config']. |
|---|
| 366 | :- ['$LOGTALKHOME/compiler/logtalk.pl']. |
|---|
| 367 | |
|---|
| 368 | See the SWI-Prolog documentation for further information on the .plrc and |
|---|
| 369 | pl.ini user initialization files. |
|---|
| 370 | |
|---|
| 371 | |
|---|
| 372 | XSB Prolog 2.6 |
|---|
| 373 | |
|---|
| 374 | xsb.config |
|---|
| 375 | |
|---|
| 376 | You need to rename both the config file and the Logtalk pre-processor to |
|---|
| 377 | end with a '.P' extension otherwise the (re)consult built-in predicate |
|---|
| 378 | will not find them! |
|---|
| 379 | |
|---|
| 380 | You also need to apply the following patch to the Logtalk compiler. Open |
|---|
| 381 | the file compiler/logtalk.pl, find the clauses that read: |
|---|
| 382 | |
|---|
| 383 | '$lgt_current_object_'(user, ...). |
|---|
| 384 | '$lgt_current_object_'(debugger, ...). |
|---|
| 385 | |
|---|
| 386 | '$lgt_dbg_leasing_'(...). |
|---|
| 387 | |
|---|
| 388 | and replace it with the queries: |
|---|
| 389 | |
|---|
| 390 | :- assertz('$lgt_current_object_'(user, ...)). |
|---|
| 391 | :- assertz('$lgt_current_object_'(debugger, ...)). |
|---|
| 392 | |
|---|
| 393 | :- assertz('$lgt_dbg_leasing_'(...)). |
|---|
| 394 | |
|---|
| 395 | You may get syntax errors while compiling the Logtalk pre-processor |
|---|
| 396 | or some of the examples due to a know bug in the XSB parsing of infix |
|---|
| 397 | operators: just add a space after the infix operator. |
|---|
| 398 | |
|---|
| 399 | The write_canonical/2 predicates may output code that in some instances |
|---|
| 400 | can not be read back with read_term/3. If you receive a syntax error |
|---|
| 401 | while loading a Logtalk compiled file we will have to fix the problem by |
|---|
| 402 | editing the file (the Prolog output, not the Logtalk source). Don't |
|---|
| 403 | forget to use the cd/1 predicate to set the working directory before |
|---|
| 404 | loading the library or an example. |
|---|
| 405 | |
|---|
| 406 | |
|---|
| 407 | YAP 4.3.x~4.5.x |
|---|
| 408 | |
|---|
| 409 | yap.config |
|---|
| 410 | |
|---|
| 411 | For all 4.3.x and later versions. Don't forget to use the cd/1 predicate |
|---|
| 412 | to set the working directory before loading the library or an example. |
|---|
| 413 | Supports smart compilation of source files. |
|---|