root/tags/lgt2311/configs/gnu.config

Revision 3986, 10.5 KB (checked in by pmoura, 13 months ago)

Updated the release number to 2.31.1.

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