| 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 2 | % |
|---|
| 3 | % Logtalk - Open source object-oriented logic programming language |
|---|
| 4 | % Release 2.31.1 |
|---|
| 5 | % |
|---|
| 6 | % configuration file for JIProlog 3.0.2-6 or later versions |
|---|
| 7 | % |
|---|
| 8 | % last updated: October 24, 2007 |
|---|
| 9 | % |
|---|
| 10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 15 | % |
|---|
| 16 | % ISO Prolog Standard predicates that we must define because they are |
|---|
| 17 | % not built-in |
|---|
| 18 | % |
|---|
| 19 | % add a clause for lgt_iso_predicate/1 declaring each ISO predicate that |
|---|
| 20 | % we must define; there must be at least one clause for this predicate |
|---|
| 21 | % whose call should fail if we don't define any ISO predicates |
|---|
| 22 | % |
|---|
| 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | initialization(Goal) :- |
|---|
| 27 | Goal. |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | % '$lgt_iso_predicate'(?callable). |
|---|
| 31 | % |
|---|
| 32 | % table of definition for missing ISO predicates |
|---|
| 33 | |
|---|
| 34 | '$lgt_iso_predicate'(_) :- % remove this clause if you need |
|---|
| 35 | fail. % to define any ISO predicate |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 40 | % |
|---|
| 41 | % predicate properties |
|---|
| 42 | % |
|---|
| 43 | % this predicate must return at least static, dynamic, and built_in |
|---|
| 44 | % properties for an existing predicate |
|---|
| 45 | % |
|---|
| 46 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | % '$lgt_predicate_property'(+callable, ?predicate_property) |
|---|
| 50 | |
|---|
| 51 | '$lgt_predicate_property'(Pred, Prop) :- |
|---|
| 52 | functor(Pred, Functor, Arity), |
|---|
| 53 | predicate_property(Functor/Arity, Prop). |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 58 | % |
|---|
| 59 | % meta-predicates |
|---|
| 60 | % |
|---|
| 61 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | % call_cleanup(+callable, +callble) |
|---|
| 65 | |
|---|
| 66 | call_cleanup(_, _) :- |
|---|
| 67 | throw(not_supported(call_cleanup/2)). |
|---|
| 68 | |
|---|
| 69 | |
|---|
| 70 | % forall(+callable, +callble) -- built-in |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | % retractall(+callable) -- built-in |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | % lgt_call/2-9 |
|---|
| 77 | % |
|---|
| 78 | % if your compiler provides call/1-9 as built-in |
|---|
| 79 | % predicates rewrite these definitions using call(...). |
|---|
| 80 | |
|---|
| 81 | call_with_args(F, A) :- |
|---|
| 82 | call(F, A). |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | call_with_args(F, A1, A2) :- |
|---|
| 86 | call(F, A1, A2). |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | call_with_args(F, A1, A2, A3) :- |
|---|
| 90 | call(F, A1, A2, A3). |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | call_with_args(F, A1, A2, A3, A4) :- |
|---|
| 94 | call(F, A1, A2, A3, A4). |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | call_with_args(F, A1, A2, A3, A4, A5) :- |
|---|
| 98 | Call =.. [F, A1, A2, A3, A4, A5], |
|---|
| 99 | Call. |
|---|
| 100 | |
|---|
| 101 | |
|---|
| 102 | call_with_args(F, A1, A2, A3, A4, A5, A6) :- |
|---|
| 103 | Call =.. [F, A1, A2, A3, A4, A5, A6], |
|---|
| 104 | Call. |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | call_with_args(F, A1, A2, A3, A4, A5, A6, A7) :- |
|---|
| 108 | Call =.. [F, A1, A2, A3, A4, A5, A6, A7], |
|---|
| 109 | Call. |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | call_with_args(F, A1, A2, A3, A4, A5, A6, A7, A8) :- |
|---|
| 113 | Call =.. [F, A1, A2, A3, A4, A5, A6, A7, A8], |
|---|
| 114 | Call. |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 119 | % |
|---|
| 120 | % Prolog built-in meta-predicates |
|---|
| 121 | % |
|---|
| 122 | % (excluding ISO Prolog Standard meta-predicates) |
|---|
| 123 | % |
|---|
| 124 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | % '$lgt_pl_meta_predicate'(?callable). |
|---|
| 128 | |
|---|
| 129 | '$lgt_pl_meta_predicate'(ignore(::)). |
|---|
| 130 | '$lgt_pl_meta_predicate'(not(::)). |
|---|
| 131 | '$lgt_pl_meta_predicate'(one(::)). |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | |
|---|
| 135 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 136 | % |
|---|
| 137 | % file extension predicates |
|---|
| 138 | % |
|---|
| 139 | % these extensions are used by Logtalk load/compile predicates |
|---|
| 140 | % |
|---|
| 141 | % you may want to change the extension for Prolog files to match |
|---|
| 142 | % the one expected by your Prolog compiler |
|---|
| 143 | % |
|---|
| 144 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 145 | |
|---|
| 146 | |
|---|
| 147 | % '$lgt_file_extension'(?atom, ?atom) |
|---|
| 148 | |
|---|
| 149 | '$lgt_file_extension'(logtalk, '.lgt'). |
|---|
| 150 | '$lgt_file_extension'(prolog, '.pl'). |
|---|
| 151 | '$lgt_file_extension'(xml, '.xml'). |
|---|
| 152 | |
|---|
| 153 | |
|---|
| 154 | |
|---|
| 155 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 156 | % |
|---|
| 157 | % default flag values |
|---|
| 158 | % |
|---|
| 159 | % if your Prolog compiler supports the ISO definition of the |
|---|
| 160 | % initialization/1 then change the default value below to true |
|---|
| 161 | % |
|---|
| 162 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 163 | |
|---|
| 164 | |
|---|
| 165 | % '$lgt_default_flag'(?atom, ?atom) |
|---|
| 166 | % |
|---|
| 167 | % default values for all flags |
|---|
| 168 | |
|---|
| 169 | '$lgt_default_flag'(xmldocs, on). |
|---|
| 170 | '$lgt_default_flag'(xslfile, 'lgtxml.xsl'). |
|---|
| 171 | '$lgt_default_flag'(xmlspec, dtd). |
|---|
| 172 | '$lgt_default_flag'(xmlsref, local). |
|---|
| 173 | |
|---|
| 174 | '$lgt_default_flag'(unknown, warning). |
|---|
| 175 | '$lgt_default_flag'(misspelt, warning). |
|---|
| 176 | '$lgt_default_flag'(singletons, warning). |
|---|
| 177 | '$lgt_default_flag'(lgtredef, warning). |
|---|
| 178 | '$lgt_default_flag'(plredef, silent). |
|---|
| 179 | '$lgt_default_flag'(portability, silent). |
|---|
| 180 | |
|---|
| 181 | '$lgt_default_flag'(report, on). |
|---|
| 182 | |
|---|
| 183 | '$lgt_default_flag'(smart_compilation, off). |
|---|
| 184 | '$lgt_default_flag'(reload, always). |
|---|
| 185 | |
|---|
| 186 | '$lgt_default_flag'(startup_message, flags(verbose)). |
|---|
| 187 | |
|---|
| 188 | '$lgt_default_flag'(underscore_variables, singletons). |
|---|
| 189 | |
|---|
| 190 | '$lgt_default_flag'(code_prefix, '$'). |
|---|
| 191 | |
|---|
| 192 | '$lgt_default_flag'(debug, off). |
|---|
| 193 | '$lgt_default_flag'(break_predicate, false). |
|---|
| 194 | |
|---|
| 195 | '$lgt_default_flag'(events, off). |
|---|
| 196 | |
|---|
| 197 | '$lgt_default_flag'(altdirs, off). |
|---|
| 198 | '$lgt_default_flag'(tmpdir, 'lgt_tmp/'). |
|---|
| 199 | '$lgt_default_flag'(xmldir, 'xml_docs/'). |
|---|
| 200 | |
|---|
| 201 | '$lgt_default_flag'(encoding_directive, unsupported). |
|---|
| 202 | '$lgt_default_flag'(threads, unsupported). |
|---|
| 203 | |
|---|
| 204 | '$lgt_default_flag'(context_switching_calls, allow). |
|---|
| 205 | |
|---|
| 206 | |
|---|
| 207 | |
|---|
| 208 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 209 | % |
|---|
| 210 | % list predicates |
|---|
| 211 | % |
|---|
| 212 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 213 | |
|---|
| 214 | |
|---|
| 215 | '$lgt_append'([], List, List). |
|---|
| 216 | '$lgt_append'([Head| Tail], List, [Head| Tail2]) :- |
|---|
| 217 | '$lgt_append'(Tail, List, Tail2). |
|---|
| 218 | |
|---|
| 219 | |
|---|
| 220 | '$lgt_member'(Head, [Head| _]). |
|---|
| 221 | '$lgt_member'(Head, [_| Tail]) :- |
|---|
| 222 | '$lgt_member'(Head, Tail). |
|---|
| 223 | |
|---|
| 224 | |
|---|
| 225 | '$lgt_member_var'(V, [H| _]) :- |
|---|
| 226 | V == H. |
|---|
| 227 | '$lgt_member_var'(V, [_| T]) :- |
|---|
| 228 | '$lgt_member_var'(V, T). |
|---|
| 229 | |
|---|
| 230 | |
|---|
| 231 | '$lgt_is_list'([]) :- |
|---|
| 232 | !. |
|---|
| 233 | '$lgt_is_list'([_| Tail]) :- |
|---|
| 234 | '$lgt_is_list'(Tail). |
|---|
| 235 | |
|---|
| 236 | |
|---|
| 237 | '$lgt_is_proper_list'(List) :- |
|---|
| 238 | List == [], !. |
|---|
| 239 | '$lgt_is_proper_list'([_| Tail]) :- |
|---|
| 240 | nonvar(Tail), |
|---|
| 241 | '$lgt_is_proper_list'(Tail). |
|---|
| 242 | |
|---|
| 243 | |
|---|
| 244 | |
|---|
| 245 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 246 | % |
|---|
| 247 | % file predicates |
|---|
| 248 | % |
|---|
| 249 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 250 | |
|---|
| 251 | |
|---|
| 252 | % '$lgt_file_exists'(+atom) |
|---|
| 253 | % |
|---|
| 254 | % checks if a file exist in the current directory |
|---|
| 255 | |
|---|
| 256 | '$lgt_file_exists'(File) :- |
|---|
| 257 | exists_file(File). |
|---|
| 258 | |
|---|
| 259 | |
|---|
| 260 | % '$lgt_directory_exists'(+atom) |
|---|
| 261 | % |
|---|
| 262 | % checks if a directory exists |
|---|
| 263 | |
|---|
| 264 | '$lgt_directory_exists'(Directory) :- |
|---|
| 265 | exists_directory(Directory). |
|---|
| 266 | |
|---|
| 267 | |
|---|
| 268 | % '$lgt_current_directory'(-atom) |
|---|
| 269 | % |
|---|
| 270 | % gets current working directory |
|---|
| 271 | |
|---|
| 272 | '$lgt_current_directory'(Directory) :- |
|---|
| 273 | working_directory(Directory, Directory). |
|---|
| 274 | |
|---|
| 275 | |
|---|
| 276 | % '$lgt_change_directory'(+atom) |
|---|
| 277 | % |
|---|
| 278 | % changes current working directory |
|---|
| 279 | |
|---|
| 280 | '$lgt_change_directory'(Directory) :- |
|---|
| 281 | chdir(Directory). |
|---|
| 282 | |
|---|
| 283 | |
|---|
| 284 | % '$lgt_make_directory'(+atom) |
|---|
| 285 | % |
|---|
| 286 | % makes a new directory; succeeds if the directory already exists |
|---|
| 287 | |
|---|
| 288 | '$lgt_make_directory'(Directory) :- |
|---|
| 289 | exists_directory(Directory) -> |
|---|
| 290 | true |
|---|
| 291 | ; |
|---|
| 292 | make_directory(Directory). |
|---|
| 293 | |
|---|
| 294 | |
|---|
| 295 | % '$lgt_load_prolog_code'(+atom, +atom) |
|---|
| 296 | % |
|---|
| 297 | % compile and load a Prolog file |
|---|
| 298 | |
|---|
| 299 | '$lgt_load_prolog_code'(File, _) :- |
|---|
| 300 | consult(File). |
|---|
| 301 | |
|---|
| 302 | |
|---|
| 303 | % '$lgt_compare_file_mtimes'(?atom, +atom, +atom) |
|---|
| 304 | % |
|---|
| 305 | % compare file modification times |
|---|
| 306 | % |
|---|
| 307 | % should fail if file modification times cannot be retrived |
|---|
| 308 | % or if one of the files does not exist |
|---|
| 309 | |
|---|
| 310 | '$lgt_compare_file_mtimes'(Result, File1, File2) :- |
|---|
| 311 | exists_file(File1), |
|---|
| 312 | exists_file(File2), |
|---|
| 313 | file_attributes(File1, _, _, _, _, _, Time1), |
|---|
| 314 | file_attributes(File2, _, _, _, _, _, Time2), |
|---|
| 315 | compare(Result, Time1, Time2). |
|---|
| 316 | |
|---|
| 317 | |
|---|
| 318 | |
|---|
| 319 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 320 | % |
|---|
| 321 | % sorting predicates |
|---|
| 322 | % |
|---|
| 323 | % note that sort/2 and keysort/2 are buitl-in predicates in most Prolog |
|---|
| 324 | % compilers |
|---|
| 325 | % |
|---|
| 326 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 327 | |
|---|
| 328 | |
|---|
| 329 | % '$lgt_keysort'(+list, -list) |
|---|
| 330 | |
|---|
| 331 | '$lgt_keysort'(_, _) :- |
|---|
| 332 | fail. |
|---|
| 333 | |
|---|
| 334 | |
|---|
| 335 | % '$lgt_sort'(+list, -list) |
|---|
| 336 | |
|---|
| 337 | '$lgt_sort'(List, Sorted) :- |
|---|
| 338 | sort(List, Sorted). |
|---|
| 339 | |
|---|
| 340 | |
|---|
| 341 | |
|---|
| 342 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 343 | % |
|---|
| 344 | % time and date predicates |
|---|
| 345 | % |
|---|
| 346 | % if your Prolog compiler does not provide access to the operating system |
|---|
| 347 | % time and date just write dummy definitions |
|---|
| 348 | % |
|---|
| 349 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 350 | |
|---|
| 351 | |
|---|
| 352 | % '$lgt_current_date'(?Year, ?Month, ?Day) |
|---|
| 353 | |
|---|
| 354 | '$lgt_current_date'(Year, Month, Day) :- |
|---|
| 355 | time(Year, Month, Day, _, _, _, _). |
|---|
| 356 | |
|---|
| 357 | |
|---|
| 358 | % '$lgt_current_time'(?Hours, ?Mins, ?Secs) |
|---|
| 359 | |
|---|
| 360 | '$lgt_current_time'(Hours, Mins, Secs) :- |
|---|
| 361 | time(_, _, _, Hours, Mins, Secs, _). |
|---|
| 362 | |
|---|
| 363 | |
|---|
| 364 | |
|---|
| 365 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 366 | % |
|---|
| 367 | % timing predicate |
|---|
| 368 | % |
|---|
| 369 | % if your Prolog compiler does not provide access to a timing predicate |
|---|
| 370 | % just write dummy definition |
|---|
| 371 | % |
|---|
| 372 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 373 | |
|---|
| 374 | |
|---|
| 375 | % '$lgt_cpu_time'(-Seconds) |
|---|
| 376 | |
|---|
| 377 | '$lgt_cpu_time'(Seconds) :- |
|---|
| 378 | Seconds is cputime. |
|---|
| 379 | |
|---|
| 380 | |
|---|
| 381 | |
|---|
| 382 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 383 | % |
|---|
| 384 | % comparison predicate |
|---|
| 385 | % |
|---|
| 386 | % the usual compare/3 definition |
|---|
| 387 | % |
|---|
| 388 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 389 | |
|---|
| 390 | |
|---|
| 391 | % compare(?atom, @term, @term) -- built-in |
|---|
| 392 | |
|---|
| 393 | |
|---|
| 394 | |
|---|
| 395 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 396 | % |
|---|
| 397 | % callable predicate |
|---|
| 398 | % |
|---|
| 399 | % the usual callable/1 definition |
|---|
| 400 | % |
|---|
| 401 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 402 | |
|---|
| 403 | |
|---|
| 404 | % callable(@term) -- built-in |
|---|
| 405 | |
|---|
| 406 | |
|---|
| 407 | |
|---|
| 408 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 409 | % |
|---|
| 410 | % read character predicate |
|---|
| 411 | % |
|---|
| 412 | % read a single character echoing it and writing a newline after |
|---|
| 413 | % |
|---|
| 414 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 415 | |
|---|
| 416 | |
|---|
| 417 | '$lgt_read_single_char'(Char) :- |
|---|
| 418 | get_char(Char), |
|---|
| 419 | ( peek_code(10) -> % hack to workaround the lack of built-in |
|---|
| 420 | get_code(_) % support for unbuffered character input |
|---|
| 421 | ; true |
|---|
| 422 | ). |
|---|
| 423 | |
|---|
| 424 | |
|---|
| 425 | |
|---|
| 426 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 427 | % |
|---|
| 428 | % pretty print a term by naming its free variables |
|---|
| 429 | % (avoid instantiating variables in term by using double negation if necessary) |
|---|
| 430 | % |
|---|
| 431 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 432 | |
|---|
| 433 | |
|---|
| 434 | '$lgt_pretty_print_vars'(Stream, Term) :- |
|---|
| 435 | write(Stream, Term). |
|---|
| 436 | |
|---|
| 437 | |
|---|
| 438 | '$lgt_pretty_print_vars_quoted'(Stream, Term) :- |
|---|
| 439 | writeq(Stream, Term). |
|---|
| 440 | |
|---|
| 441 | |
|---|
| 442 | |
|---|
| 443 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 444 | % |
|---|
| 445 | % getting stream current line number |
|---|
| 446 | % (needed for improved compiler error messages) |
|---|
| 447 | % |
|---|
| 448 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 449 | |
|---|
| 450 | |
|---|
| 451 | % '$lgt_stream_current_line_number'(@stream, -integer) |
|---|
| 452 | |
|---|
| 453 | '$lgt_stream_current_line_number'(_, _) :- |
|---|
| 454 | fail. |
|---|
| 455 | |
|---|
| 456 | |
|---|
| 457 | |
|---|
| 458 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 459 | % |
|---|
| 460 | % handling of Prolog-proprietary directives on Logtalk source files |
|---|
| 461 | % |
|---|
| 462 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 463 | |
|---|
| 464 | |
|---|
| 465 | % '$lgt_ignore_pl_directive'(@callable) |
|---|
| 466 | |
|---|
| 467 | '$lgt_ignore_pl_directive'(_) :- |
|---|
| 468 | fail. |
|---|
| 469 | |
|---|
| 470 | |
|---|
| 471 | % '$lgt_rewrite_and_copy_pl_directive'(@callable, -callable) |
|---|
| 472 | |
|---|
| 473 | '$lgt_rewrite_and_copy_pl_directive'(_, _) :- |
|---|
| 474 | fail. |
|---|
| 475 | |
|---|
| 476 | |
|---|
| 477 | % '$lgt_rewrite_and_recompile_pl_directive'(@callable, -callable) |
|---|
| 478 | |
|---|
| 479 | '$lgt_rewrite_and_recompile_pl_directive'(_, _) :- |
|---|
| 480 | fail. |
|---|
| 481 | |
|---|
| 482 | |
|---|
| 483 | |
|---|
| 484 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 485 | % |
|---|
| 486 | % Shortcut to the Logtalk built-in predicate logtalk_load/1 |
|---|
| 487 | % |
|---|
| 488 | % defined in the config files in order to be able to comment it out in case |
|---|
| 489 | % of conflict with some Prolog native feature; it implies conformance with |
|---|
| 490 | % the ISO Prolog standard regarding the definition of the {}/1 syntax |
|---|
| 491 | % |
|---|
| 492 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 493 | |
|---|
| 494 | {File, Files} :- |
|---|
| 495 | !, |
|---|
| 496 | logtalk_load(File), |
|---|
| 497 | {Files}. |
|---|
| 498 | {File} :- |
|---|
| 499 | logtalk_load(File). |
|---|
| 500 | |
|---|
| 501 | |
|---|
| 502 | |
|---|
| 503 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 504 | % |
|---|
| 505 | % end! |
|---|
| 506 | % |
|---|
| 507 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|