root/tags/lgt2215/configs/swi.config

Revision 1657, 9.4 KB (checked in by pmoura, 4 years ago)

Added a new optimization compiler flag, "events", which can be used to switch off event-driven programming support when not needed, resulting in increased message sending performance.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%
3%  Logtalk - Object oriented extension to Prolog
4%  Release 2.21.5
5%
6%  configuration file for SWI Prolog 3.3.x and later versions
7%
8%  last updated: October 30, 2004
9%
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12
13:- set_prolog_flag(prompt_alternatives_no_bindings, true).
14:- system_module.
15
16
17
18%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19%
20%  ISO Prolog Standard predicates that we must define because they are
21%  not built-in
22%
23%  add a clause for lgt_iso_predicate/1 declaring each ISO predicate that
24%  we must define; there must be at least one clause for this predicate
25%  whose call should fail if we don't define any ISO predicates
26%
27%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28
29
30% '$lgt_iso_predicate'(?callable).
31
32'$lgt_iso_predicate'(_) :-
33    fail.
34
35
36
37%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38%
39%  predicate properties
40%
41%  this predicate must return at least static, dynamic, and built_in
42%  properties for an existing predicate
43%
44%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45
46
47% '$lgt_predicate_property'(+callable, ?predicate_property)
48
49'$lgt_predicate_property'(Pred, Prop) :-
50    predicate_property(Pred, Prop).
51
52
53
54%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55%
56%  metapredicates
57%
58%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59
60
61% lgt_call/2-8
62%
63% use these definitions only if your compiler does
64% not provide call/1-8 as built-in predicates
65
66'$lgt_call'(F, A) :-
67    call(F, A).
68
69
70'$lgt_call'(F, A1, A2) :-
71    call(F, A1, A2).
72
73
74'$lgt_call'(F, A1, A2, A3) :-
75    call(F, A1, A2, A3).
76
77
78'$lgt_call'(F, A1, A2, A3, A4) :-
79    call(F, A1, A2, A3, A4).
80
81
82'$lgt_call'(F, A1, A2, A3, A4, A5) :-
83    call(F, A1, A2, A3, A4, A5).
84
85
86'$lgt_call'(F, A1, A2, A3, A4, A5, A6) :-
87    call(F, A1, A2, A3, A4, A5, A6).
88
89
90'$lgt_call'(F, A1, A2, A3, A4, A5, A6, A7) :-
91    call(F, A1, A2, A3, A4, A5, A6, A7).
92
93
94% lgt_once/2-8
95%
96% if your compiler provides call/1-8 as built-in
97% predicates rewrite these definitions using call(...), !.
98
99'$lgt_once'(F, A) :-
100    call(F, A),
101    !.
102
103
104'$lgt_once'(F, A1, A2) :-
105    call(F, A1, A2),
106    !.
107
108
109'$lgt_once'(F, A1, A2, A3) :-
110    call(F, A1, A2, A3),
111    !.
112
113
114'$lgt_once'(F, A1, A2, A3, A4) :-
115    call(F, A1, A2, A3, A4),
116    !.
117
118
119'$lgt_once'(F, A1, A2, A3, A4, A5) :-
120    call(F, A1, A2, A3, A4, A5),
121    !.
122
123
124'$lgt_once'(F, A1, A2, A3, A4, A5, A6) :-
125    call(F, A1, A2, A3, A4, A5, A6),
126    !.
127
128
129'$lgt_once'(F, A1, A2, A3, A4, A5, A6, A7) :-
130    call(F, A1, A2, A3, A4, A5, A6, A7),
131    !.
132
133
134
135%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
136%
137%  Prolog built-in metapredicates
138%
139%  (excluding ISO Prolog Standard metapredicates)
140%
141%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
142
143
144% '$lgt_pl_metapredicate'(?callable).
145
146'$lgt_pl_metapredicate'(;(*->(::, ::), ::)).
147'$lgt_pl_metapredicate'(call_cleanup(::, ::)).
148'$lgt_pl_metapredicate'(call_cleanup(::, *, ::)).
149'$lgt_pl_metapredicate'(call_with_depth_limit(::, *, *)).
150'$lgt_pl_metapredicate'(freeze(*, ::)).
151'$lgt_pl_metapredicate'(ignore(::)).
152'$lgt_pl_metapredicate'(not(::)).
153'$lgt_pl_metapredicate'(notrace(::)).
154'$lgt_pl_metapredicate'(on_signal(*, *, ::)).
155
156'$lgt_pl_metapredicate'(thread_at_exit(::)).
157'$lgt_pl_metapredicate'(thread_create(::, *, *)).
158'$lgt_pl_metapredicate'(thread_signal(*, ::)).
159'$lgt_pl_metapredicate'(with_mutex(*, ::)).
160
161
162
163%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164%
165%  file extension predicates
166%
167%  these extensions are used by Logtalk load/compile predicates
168%
169%  you may want to change the extension for Prolog files to match
170%  the one expected by your Prolog compiler
171%
172%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
173
174
175% '$lgt_file_extension'(?atom, ?atom)
176
177'$lgt_file_extension'(metafile, '.mlgt').
178'$lgt_file_extension'(logtalk, '.lgt').
179'$lgt_file_extension'(prolog, '.pl').
180'$lgt_file_extension'(xml, '.xml').
181
182
183
184%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
185%
186%  default flag values
187%
188%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
189
190
191% '$lgt_default_flag'(?atom, ?atom)
192%
193% default values for all flags
194
195'$lgt_default_flag'(iso_initialization_dir, true).
196
197'$lgt_default_flag'(xml, on).
198'$lgt_default_flag'(xsl, 'lgtxml.xsl').
199'$lgt_default_flag'(xmlspec, dtd).
200'$lgt_default_flag'(doctype, local).
201
202'$lgt_default_flag'(unknown, warning).
203'$lgt_default_flag'(misspelt, warning).
204'$lgt_default_flag'(singletons, warning).
205'$lgt_default_flag'(lgtredef, warning).
206'$lgt_default_flag'(plredef, silent).
207'$lgt_default_flag'(portability, silent).
208
209'$lgt_default_flag'(report, on).
210
211'$lgt_default_flag'(smart_compilation, off).
212
213'$lgt_default_flag'(startup_message, flags).
214
215'$lgt_default_flag'(underscore_vars, singletons).
216
217'$lgt_default_flag'(code_prefix, '$').
218
219'$lgt_default_flag'(debug, off).
220'$lgt_default_flag'(supports_break_predicate, true).
221
222'$lgt_default_flag'(events, on).
223
224
225
226%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
227%
228%  list predicates
229%
230%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
231
232
233'$lgt_append'([], List, List).
234'$lgt_append'([Head| Tail], List, [Head| Tail2]) :-
235    '$lgt_append'(Tail, List, Tail2).
236
237
238'$lgt_member'(Head, [Head| _]).
239'$lgt_member'(Head, [_| Tail]) :-
240    '$lgt_member'(Head, Tail).
241
242
243'$lgt_member_var'(V, [H| _]) :-
244    V == H.
245'$lgt_member_var'(V, [_| T]) :-
246    '$lgt_member_var'(V, T).
247
248
249'$lgt_proper_list'([]).
250'$lgt_proper_list'([_| List]) :-
251    '$lgt_proper_list'(List).
252
253
254'$lgt_reverse'(List, Reversed) :-
255    '$lgt_reverse'(List, [], Reversed, Reversed).
256
257'$lgt_reverse'([], Reversed, Reversed, []).
258'$lgt_reverse'([Head| Tail], List, Reversed, [_| Bound]) :-
259    '$lgt_reverse'(Tail, [Head| List], Reversed, Bound).
260
261
262
263%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
264%
265%  file predicates
266%
267%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
268
269
270% '$lgt_file_exists'(+atom)
271%
272% see if a file exist in the current directory
273
274'$lgt_file_exists'(File) :-
275    exists_file(File).
276
277
278% '$lgt_load_prolog_code'(+atom)
279%
280% compile and load a Prolog file
281
282'$lgt_load_prolog_code'(File) :-
283    consult(File).
284
285
286% '$lgt_compare_file_mtimes'(?atom, +atom, +atom)
287%
288% compare file modification times
289
290'$lgt_compare_file_mtimes'(Result, File1, File2) :-
291    time_file(File1, Time1),
292    time_file(File2, Time2),
293    compare(Result, Time1, Time2).
294
295
296
297%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
298%
299%  sorting predicates
300%
301%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
302
303
304% '$lgt_keysort'(+list, -list)
305
306'$lgt_keysort'(List, Sorted) :-
307    keysort(List, Sorted).
308
309
310% '$lgt_sort'(+list, -list)
311
312'$lgt_sort'(List, Sorted) :-
313    sort(List, Sorted).
314
315
316
317%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
318%
319%  time and date predicates
320%
321%  if your Prolog compiler does not provide access to the operating system
322%  time and date just write dummy definitions
323%
324%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
325
326
327% '$lgt_current_date'(?Year, ?Month, ?Day)
328
329'$lgt_current_date'(Year, Month, Day) :-
330    get_time(Time),
331    convert_time(Time, Year, Month, Day, _, _, _, _).
332
333
334% '$lgt_current_time'(?Hours, ?Mins, ?Secs)
335
336'$lgt_current_time'(Hours, Mins, Secs) :-
337    get_time(Time),
338    convert_time(Time, _, _, _, Hours, Mins, Secs, _).
339
340
341
342%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
343%
344%  timing predicate
345%
346%  if your Prolog compiler does not provide access to a timing predicate
347%  just write dummy definition
348%
349%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
350
351
352% '$lgt_cpu_time'(-Seconds)
353
354'$lgt_cpu_time'(Seconds) :-
355    Seconds is cputime.
356
357
358
359%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
360%
361%  comparison predicate
362%
363%  the usual compare/3 definition
364%
365%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
366
367
368% compare(?atom, @term, @term) -- built-in
369
370
371
372%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
373%
374%  callable predicate
375%
376%  the usual callable/1 definition
377%
378%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
379
380
381% callable(@term) -- built-in
382
383
384
385%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
386%
387%  read character predicate
388%
389%  read a single character echoing it and writing a newline after
390%
391%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
392
393
394'$lgt_read_single_char'(Char) :-
395    get_single_char(Code), put_code(Code), nl, char_code(Char, Code).
396
397
398
399%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
400%
401%  pretty print a term by naming its free variables
402%  (avoid instantiating variables in term by using double negation if necessary)
403%
404%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
405
406
407'$lgt_pretty_print_vars'(Stream, Term) :-
408    \+ \+ (
409        numbervars(Term, '$VAR', 0, _),
410        write_term(Stream, Term, [numbervars(true)])).
411
412
413'$lgt_pretty_print_vars_quoted'(Stream, Term) :-
414    \+ \+ (
415        numbervars(Term, '$VAR', 0, _),
416        write_term(Stream, Term, [numbervars(true), quoted(true)])).
417
418
419
420%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
421%
422%  end!
423%
424%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.